BookmarkSubscribeRSS Feed
CS_B
Calcite | Level 5

I am using the SAS command to run a linear multiple regression, stepwise method. However, I have covariates and I would like to know, which is the correct SAS command for this. My actual command is:

proc reg data=a;

model dependent_variable= independent_variables/selection=stepwise;

run;

2 REPLIES 2
PaigeMiller
Diamond | Level 26
model dependent_variable=covariate independent_variables/selection=stepwise;

If you want stepwise to force the covariate into the model, so it must be selected, use include=1 which forces the first variable listed to always be selected.

 

model dependent_variable=covariate independent_variables/selection=stepwise include=1;

I feel compelled to advise about the dangers of using Stepwise regression, as many statisticians don't trust it, find it unreliable and misleading. Use your favorite internet search engine to search for "problems with stepwise regression" and you'll have enough to read on this topic for a week. Alternatives are PROC PLS and PROC GLMSELECT.

 

 

--
Paige Miller
CS_B
Calcite | Level 5
Thank you so much. I will read about stepwise issues. Thanks

sas-innovate-white.png

Missed SAS Innovate in Orlando?

Catch the best of SAS Innovate 2025 — anytime, anywhere. Stream powerful keynotes, real-world demos, and game-changing insights from the world’s leading data and AI minds.

 

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
  • 2 replies
  • 927 views
  • 1 like
  • 2 in conversation