1

Does anyone know the stopping rule when I use the step() function in R with the test = 'F' option?

I.e., I'd like to set a significance level at which to stop the procedure. Currently I do something like this:

m.full = lm(score ~ ., data=evals)
m.best.backward = step(m.full, direction = 'backward', test = 'F', trace=T)

The largest p-value in this case is 0.148605. I'd like to proceed until the largest p-value is less than some specified level. Does anyone know how?

divibisan
  • 11,659
  • 11
  • 40
  • 58
Adam
  • 284
  • 3
  • 7
  • The usual advice is to not do stepwise regression at all (e.g., [see here](http://stats.stackexchange.com/a/17113/11849)). There are better alternatives. – Roland Nov 25 '14 at 10:24
  • Okay firstly that's bad advice. Stepwise regression will produce the same solution as l0 ''norm'' minimization in the noiseless case under certain conditions on the design matrix (and will recover the same support set in the noisy case), which also will be the same as the l1 norm minimization solution. That aside, I need to know how to do this for illustration for a course I'm teaching and I cannot seem to figure out how to do it... – Adam Nov 26 '14 at 03:59
  • Anyone have a useful response? – Adam Nov 26 '14 at 05:44
  • You are of course free to use any method you want. However, `step` does not have a `test` parameter, it uses AIC. – Roland Nov 26 '14 at 08:29
  • That's also incorrect Roland... it does in fact have a 'test' parameter. Try it yourself. Also see: http://stackoverflow.com/a/11026325/317120 – Adam Nov 26 '14 at 21:11
  • You are right. The parameter is passed to `add1` and the test results are printed. However, `step` still uses AIC. It stops if AIC changes by less than 1e-07. I still don't agree with your aim, but you could of course write your own function to achieve it. Personally, I don't use `step` (and would prefer `MuMIn::dredge` over it if I can't use something better). – Roland Nov 27 '14 at 09:29

0 Answers0