[R] drop1() seems to give unexpected results compare to anova()

Thomas P C Chu tchu11 at netscape.net
Fri Aug 1 16:18:37 CEST 2008


Interestingly, if I fitted the model using glm() rather than lm(), 
drop1() would behave as expected:

summary(model.glm <- glm(y ~ ., data = sim.set, family = 'gaussian'))
summary(model.lm <- lm(y ~ ., data = sim.set))
drop1(model.glm, test = 'F')
drop1(model.lm, test = 'F')
model.glm <- step(model.glm, direction = 'both', test = 'F')
model.lm <- step(model.lm, direction = 'both', test = 'F')
summary(model.glm)
summary(model.lm)

Although it is debatable whether one should use glm(family = 
'gaussian') rather than lm() for fitting models with normal 
distribution residuals. This raises the suspicion that there could be a 
bug in drop1() and step(), which I think uses add1() and drop1() 
repeatedly.


Thomas P C Chu
________________________________________________________________________
AOL Email goes Mobile! You can now read your AOL Emails whilst on the 
move. Sign up for a free AOL Email account with unlimited storage today.



**************************************
See what's new at http://www.aol.com



More information about the R-help mailing list