BookmarkSubscribeRSS Feed
jhwang
Calcite | Level 5

Hello,

 

I'm trying to force a variable to stay within a stepwise regression.

 

When I follow the instructions published on "SAS Notes", it only retains that particular variable and no longer goes through the stepwise selection process.

 

Is there a way to let the program do the selection for me, but make sure to keep that particular variable as one of the selected?

 

The instructions were as follows:

  1. Set the Selection Model property to Backward, Forward, or Stepwise.
  2. Set the Use Selection Defaults property to No.
  3. Click the Selection Options ... property. A Selection Options window is displayed.
  4. In the Force Candidate Effects property, enter the number of variables that you want to force into the model. Click OK to close the Selection Options window.
  5. Change the User Terms property to Yes.
  6. Click the Term Editor ... property. A Term window is displayed.
  7. One at a time, click the variable that you want to force into the model, click the right-arrow button, and click Save. Make sure that the variables that you want to include are listed first. When finished, click OK to close the Term window.
  8. Run the node.

Thanks.

1 REPLY 1
DougWielenga
SAS Employee

It appears the instructions are not quite complete if you want to do further selection.  If you follow those steps and review the Output window in the Regression node results, you will likely find something like the following:

 

/*** BEGIN EXCERPT ***/


NOTE: The stepwise model building process has reached the MAXSTEP= 0 limit.

 

The selected model is the model trained in the last step (Step 0). It consists of the following effects:

 

/*** END EXCERPT ***/

 

The Maximum Number of Steps property in the Selection Options dialog is set to 0 by default which means that no steps will be taken unless you change that value.  Setting Maximum Number of Steps = 5 will allow the stepwise regression to take up to 5 steps before stopping.   Try modifying this option and let me know if that doesn't solve the problem.

 

Hope this helps!

Doug

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!

How to choose a machine learning algorithm

Use this tutorial as a handy guide to weigh the pros and cons of these commonly used machine learning algorithms.

Find more tutorials on the SAS Users YouTube channel.

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