简体   繁体   English

如何在SAS的回归模型中一次添加一个变量?

[英]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: 我想使用SAS中的PROC LOGISTIC或PROC GENMOD运行有序逻辑回归,我在编程变量选择步骤时遇到了困难,这是变量选择方法:

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. 一次向此模型添加一个变量,跟踪该单个预测变量的AIC得分,然后通过添加另一个变量,跟踪AIC得分,选择具有最低AIC的模型,继续进行下一阶段。

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?)? 我不知道如何编写循环来运行此选择过程,也不知道如何获取每个步骤的AIC得分(输出选项?)?

Many thanks! 非常感谢!

All you need is a selection=stepwise option in your model statement. 您需要做的是在model语句中selection=stepwise一个selection=stepwise选项。

Please refer to: Stepwise Logistic Regression and Ordinal Regression 请参考: 逐步Logistic回归序数回归

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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