The R documentation for either does not shed much light. All that I can get from this link is that using either one should be fine. What I do not get is why they are not equal.
Fact: The stepwise regression function in R, step() uses extractAIC().
Interestingly, running a lm() model and a glm() 'null' model (only the intercept) on the 'mtcars' data set of R gives different results for AIC and extractAIC().
> null.glm = glm(mtcars$mpg~1)
> null.lm = lm(mtcars$mpg~1)
> AIC(null.glm)
[1] 208.7555
> AIC(null.lm)
[1] 208.7555
> extractAIC(null.glm)
[1] 1.0000 208.7555
> extractAIC(null.lm)
[1] 1.0000 115.9434
It is weird, given that both the models above are the same, and AIC() gives the same results for both.
Can anyone throw some light on the issue?
extractAIC(null.lm) != AIC(null.lm)whileextractAIC(null.glm) == AIC(null.glm)even thoughnull.lmis the same model asnull.glm. Could you expand your answer a little? – smillig Nov 16 '12 at 18:26extractAICuses different methods forlmfits andglmfits, i.e.,extractAIC.lmandextractAIC.glm. You can usegetAnywhereto study their code.AICuses the same method for both. – Roland Nov 17 '12 at 15:18extractAIC()gives lower (negative) value for Model 1, while AIC gives lower (positive) value for Model 2. – Maxim.K Sep 10 '13 at 11:25