Last active
February 27, 2017 18:34
-
-
Save daviddalpiaz/ccc49357b215c6185584a6ab84284db6 to your computer and use it in GitHub Desktop.
extractAIC() vs AIC()
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fit_test = lm(dist ~ ., data = cars) | |
n = length(resid(fit_test)) | |
p = length(coef(fit_test)) | |
-2 * logLik(fit_test) + 2 * p | |
AIC(fit_test) | |
extractAIC(fit_test) + n + n * log(2 * pi) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
AIC is being calculated with a different
p
depending on the function used. It is not simply an issue of omitting a constant.