Help using Base SAS procedures

Force a variable as a regressor during stepwise selection

Accepted Solution Solved
Reply
Contributor
Posts: 52
Accepted Solution

Force a variable as a regressor during stepwise selection

reg data = clean_data

outest = data_a;

model volume = price factor1 factor2 factor3/selection = stepwise;
output out=model_res  ;

quit;

I have the above regression model using stepwise selection method. In the model, I want to keep price as a regressor (or explanatory variable) no matter how it is related to volume.

How can I force the price as a regressor as the stepwise step won't remove it?  Thank you.


Accepted Solutions
Solution
‎03-31-2015 06:28 PM
Super User
Posts: 18,586

Re: Force a variable as a regressor during stepwise selection

Use the INCLUDE option with n=1.

INCLUDE=n

forces the first n independent variables listed in the MODEL statement to be included in all models. The selection methods are performed on the other variables in the MODEL statement. The INCLUDE= option is not available with SELECTION=NONE.

SAS/STAT(R) 9.2 User's Guide, Second Edition

View solution in original post


All Replies
Solution
‎03-31-2015 06:28 PM
Super User
Posts: 18,586

Re: Force a variable as a regressor during stepwise selection

Use the INCLUDE option with n=1.

INCLUDE=n

forces the first n independent variables listed in the MODEL statement to be included in all models. The selection methods are performed on the other variables in the MODEL statement. The INCLUDE= option is not available with SELECTION=NONE.

SAS/STAT(R) 9.2 User's Guide, Second Edition

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 1 reply
  • 2571 views
  • 0 likes
  • 2 in conversation