What is the difference between AIC() and extractAIC() in R? 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?
 A: According, to the help for these two function (use ?AIC and ?extractAIC) this is expected. 
Note that the AIC is just defined up to an additive constant, because this is also the case for the log-likelihood. This means you should check whether 
extractAIC(full.modell) - extractAIC(null.modell)

and
AIC(full.modell) - AIC(null.modell)

give the same result. As long as they do, both functions are equivalent for all practical purposes.
A: There are two differences for a usual linear regression model (lm) between AIC and extractAIC:

*

*AIC accounts for the estimation of the unknown variance of the error (i.e., scale) while extractAIC does not, hence $k$ is one less with extractAIC.

*AIC uses the formula $n\log\frac{RSS}{n}+n+n\log\left(2\pi\right)$ for the -2 log likelihood, while extractAIC drops the additive constant, and uses only $n\log\frac{RSS}{n}$. (At least by default; you can set a custom scale.)

Of course, none of these matters, if the values are only used in comparison.
In addition to these, and as already noted above, extractAIC behaves differently for lm and glm (in contrast to AIC!), namely, it uses the above formula only for lm, for glm it switches to the aic function of the fitted model, which is different.
