简体   繁体   中英

How to add one variable at a time in regression model in SAS?

I would like to run an ordinal logistic regression using either PROC LOGISTIC or PROC GENMOD in SAS, I have difficulty in programming the variable selection step, here is the variable selection method:

Add one variable to this model at a time, track the AIC score of that individual predictor, and then proceed to the next stage by adding another variable, track the AIC score, select model with lowest AIC, and so forth.

I don't know how to write a loop to run this selection procedure, also, how to get the AIC score for each step (output option?)?

Many thanks!

All you need is a selection=stepwise option in your model statement.

Please refer to: Stepwise Logistic Regression and Ordinal Regression

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM