Stepwise regression using p-values to drop variables with nonsignificant p-values

后端 未结 6 994
感动是毒
感动是毒 2020-11-29 16:46

I want to perform a stepwise linear Regression using p-values as a selection criterion, e.g.: at each step dropping variables that have the

6条回答
  •  佛祖请我去吃肉
    2020-11-29 17:32

    Why not try using the step() function specifying your testing method?

    For example, for backward elimination, you type only a command:

    step(FullModel, direction = "backward", test = "F")
    

    and for stepwise selection, simply:

    step(FullModel, direction = "both", test = "F")
    

    This can display both the AIC values as well as the F and P values.

提交回复
热议问题