[R] Odd behaviour of step (and stepAIC)?

Anon. bob.ohara at helsinki.fi
Fri Mar 19 16:25:31 CET 2004


I can only assume I'm betraying my ignorance here, but this is not what 
I would expect.

I'm getting the following from a stepwise selection (with both step and 
stepAIC):

 > step(lm(sqrt(Grids)~ SE + Edge + NH), scope=~ (Edge + SE + NH)^2)
Start:  AIC= 593.56
  sqrt(Grids) ~ SE + Edge + NH

           Df Sum of Sq    RSS    AIC
<none>                 2147.0  593.6
+ Edge:NH  1       3.0 2143.9  595.1
+ SE:NH    4      23.2 2123.8  598.4
- NH       1      75.8 2222.8  601.6
- Edge     1     448.7 2595.7  646.4
- SE       4    1033.7 3180.6  699.1


My problem is that the SE:Edge term is not added.  Now, I know that I've 
specified the terms in a different order in the start model and the 
scope, but this shouldn't matter, should it?  Aren't these model 
specifications commutative?

Am I missing something important, or is this just an obscure feature?

Bob

-- 
Bob O'Hara

Dept. of Mathematics and Statistics
P.O. Box 4 (Yliopistonkatu 5)
FIN-00014 University of Helsinki
Finland
Telephone: +358-9-191 23743
Mobile: +358 50 599 0540
Fax:  +358-9-191 22 779
WWW:  http://www.RNI.Helsinki.FI/~boh/
Journal of Negative Results - EEB: http://www.jnr-eeb.org




More information about the R-help mailing list