Laura Bonnett
2009-Nov-30 15:40 UTC
[R] Using stepAIC to produce a p-value for when a particular variable was taken out of the model
Dear all, I have decided after much deliberation to use backward elimination and forward selection to produce a multivariate model. Having read about the problems with choosing selection values I have chosen to base my decisions of inclusion and exclusion on the AIC and am consequently using the stepAIC function. This post however does not relate to whether or not this is the correct decision! I am interested in determining what the p-value was when a particular variable was taken out of the model. If I choose trace=TRUE then I obviously can see each step of the elimination process together with the AIC and the degrees of freedom for each variable and for the null model. When the stepwise process is complete it is possible to call the "anova" value which shows deviances and assocaited degrees of freedoms for variables left in the model. Therefore I could use this information to calculate p-values. However, is it possible to do the same for the varaibles which were thrown out of the model? There doesn't seem to be any literature on how to use AICs to get p-values as the distribution isn't quite a chi-squared one. Does anyone therefore know how I can determine the p-value for a variable when it was taken out of the model? Thank you, Laura [[alternative HTML version deleted]]
Laura Bonnett
2009-Nov-30 15:52 UTC
[R] Using stepAIC to produce a p-value for when a particular variable was taken out of the model
I've just realised that this is a very silly post as I can't read!!! The output in the "anova" is the excluded variables - very sorry! Laura 2009/11/30 Laura Bonnett <l.j.bonnett@googlemail.com>> Dear all, > > I have decided after much deliberation to use backward elimination and > forward selection to produce a multivariate model. Having read about the > problems with choosing selection values I have chosen to base my decisions > of inclusion and exclusion on the AIC and am consequently using the stepAIC > function. This post however does not relate to whether or not this is the > correct decision! > > I am interested in determining what the p-value was when a particular > variable was taken out of the model. If I choose trace=TRUE then I > obviously can see each step of the elimination process together with the AIC > and the degrees of freedom for each variable and for the null model. When > the stepwise process is complete it is possible to call the "anova" value > which shows deviances and assocaited degrees of freedoms for variables left > in the model. Therefore I could use this information to calculate > p-values. However, is it possible to do the same for the varaibles which > were thrown out of the model? > > There doesn't seem to be any literature on how to use AICs to get p-values > as the distribution isn't quite a chi-squared one. Does anyone therefore > know how I can determine the p-value for a variable when it was taken out of > the model? > > Thank you, > > Laura >[[alternative HTML version deleted]]
Maybe Matching Threads
- Forcing a variableinto a model using stepAIC
- Help understanding why glm and lrm.fit runs with my data, but lrm does not
- Isolating a single plot from plots produced simultaneously
- repeat write.table with the same code many times
- Help understanding why glm and lrm.fit runs with my data, but lrm does not