0

When doing a backward elimination using the step(), is it possible to only include those factors that are significant, for example, at P<0.05?

I am using this line at the moment

step(FulMod3,direction="backward",trace=FALSE)

to get my final model.

Paul Hiemstra
  • 59,984
  • 12
  • 142
  • 149
baz
  • 6,817
  • 11
  • 36
  • 37

1 Answers1

6

Answers to these questions give starting points

In particular they point you towards fastbw in the rms package, which can be used in conjunction with rms::lrm (logistic regression). They also explain why stepwise regression via p values is often a really, really, really, BAD idea: see also http://www.stata.com/support/faqs/stat/stepwise.html . There are a few contexts where it is appropriate (otherwise Frank Harrell, the author of the rms package and crusader against foolish uses of stepwise regression, wouldn't have written fastbw), but they are relatively rare, usually dominated by (e.g.) penalized regression approaches or by stepwise approaches via AIC (as implemented in step): see e.g. https://stats.stackexchange.com/questions/13686/what-are-modern-easily-used-alternatives-to-stepwise-regression and https://stats.stackexchange.com/questions/20836/algorithms-for-automatic-model-selection

Community
  • 1
  • 1
Ben Bolker
  • 211,554
  • 25
  • 370
  • 453
  • 1
    +1, this is good advice. 1 more link: it may help to understand *why* stepwise selection methods are a bad idea. An answer I wrote [here](http://stats.stackexchange.com/questions/20836/algorithms-for-automatic-model-selection/20856#20856) may help to explain that. – gung - Reinstate Monica Apr 22 '12 at 17:07