BookmarkSubscribeRSS Feed
Amalik
Calcite | Level 5

Hi,

 

I want to run a constrained regression with the following constarints,

 

US_Small_Val + US_Small_Gr + US_Large_Gr  + _US_Large_Val = 1;

0 <= US_Small_Val <= 1; 0 <= US_Small_Gr <= 1; 0 <= US_Large_Gr <= 1; 0 <= _US_Large_Val <= 1;

where the model is,

AMP_AIT = US_Small_Val US_Small_Gr US_Large_Gr _US_Large_Val /noint;

 

I am attacing the code wci I have used but its not working.

 

Can smeone please help me out in this?

 

Regards,

Anum

6 REPLIES 6
PGStats
Opal | Level 21

What's the error message?

 

You could try starting the regression at a feasable point

 

parms US_Small_Val 0.25 US_Small_Gr 0.25 US_Large_Gr 0.25  _US_Large_Val 0.25;

PG
Amalik
Calcite | Level 5

 it says 


ERROR 22-322: Syntax error, expecting one of the following: ;, ADJSMMV, ALPHA, BLOCK, BREUSCH,
CATNAME, CHOW, COLLIN, CONVERGE, CORR, CORRB, CORRS, COV, COVB, COVBESTIMATOR,
COVS, DATA, DETAILS, DW, DWPROB, DYNAMIC, EPSILON, FASTSOLVE, FLOW, FORECAST,
FSRSQ, GENGMMV, GINV, GMM, GODFREY, GOF, GRAPH, HAUSMAN, HCCME, HESSIAN, HIDE,
I, INTGPRINT, IT2SLS, IT3SLS, ITALL, ITDETAILS, ITGMM, ITOLS, ITPRINT, ITSUR,
JACOBI, KERNEL, LIBNAME, LIST, LISTALL, LISTCODE, LISTDEP, LISTDER, LTEBOUND, M,
MAXERRORS, MAXITER, MAXSUBITER, MEMORYUSE, METHOD, MINTIMESTEP, MISSING, MOD,
MODEL, MODFILE, N2SLS, N3SLS, NAHEAD, NDEC, NDRAW, NEWTON, NODWPROB, NOGENGMMV,
NOHAUSMAN, NOINTGPRINT, NOMEM, NOMEMORYUSE, NONORMAL, NOOUTOBJVALS,
NOOUTVIOLATIONS, NOPRINT, NOREPORTMISSINGS, NORMAL, NOSTARTITER, NOSTORE,
NPREOBS, NVDRAW, OBFUSCATE, OLS, OPTIMIZE,

Rick_SAS
SAS Super FREQ

Looks like that error message is coming from the FIT statement.

PGStats
Opal | Level 21

I am just guessing, I think the proper syntax for your proc model invocation should be something like:

 

proc model data=temp1 noprint outest=Out_Estimates;
parms a 0.25 b 0.25 c 0.25 d 0.25;
bounds 0 <= a b c d <= 1;
restrict a + b + c + d = 1;
AMP_AIT = a*US_Small_Val + b*US_Small_Gr + c*US_Large_Gr + d*_US_Large_Val;
fit AMP_AIT;
run;
quit;  
PG
Amalik
Calcite | Level 5

Hi PG,

 

I have used the following code but the restriction  a + b + c + d = 1 is not being incorprated in my results.Can you identify the possible issue?

 

 

proc nlin data=temp1 noprint outest=Out_Estimates ;
parms a=.25 b=.25 c=.25 d=.25;
bounds 0 <= a b c d<= 1;
restrict a + b + c + d = 1;
model AMP_AIT = a*US_Small_Val + b*US_Small_Gr + c*US_Large_Gr + d*_US_Large_Val;
run;
quit;
title 'out_estimates, loop ' &i;
proc print data=Out_Estimates;run;
run;
quit;

PGStats
Opal | Level 21

restrict is not a valid statement in proc nlin.

 

You might want to try proc hpnlmod instead.

PG

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 6 replies
  • 1997 views
  • 0 likes
  • 3 in conversation