Programming the statistical procedures from SAS

constrained regression

Reply
Occasional Contributor
Posts: 17

constrained regression

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

Attachment
Respected Advisor
Posts: 4,756

Re: constrained regression

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
Occasional Contributor
Posts: 17

Re: constrained regression

 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,

SAS Super FREQ
Posts: 3,556

Re: constrained regression

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

Respected Advisor
Posts: 4,756

Re: constrained regression

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
Occasional Contributor
Posts: 17

Re: constrained regression

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;

Respected Advisor
Posts: 4,756

Re: constrained regression

restrict is not a valid statement in proc nlin.

 

You might want to try proc hpnlmod instead.

PG
Ask a Question
Discussion stats
  • 6 replies
  • 255 views
  • 0 likes
  • 3 in conversation