0
$\begingroup$

http://www.stat.wisc.edu/courses/st333-larget/aic.pdf

The AIC calculated with the model lm(SAT~1) was 560.4736, but the AIC calculated with stepwise selection starting with lm(SAT~1) was 419.42. May I ask why there is a difference? Thanks a lot.

$\endgroup$
5
  • 1
    $\begingroup$ Welcome to CV. Could you copy, or at least indicate the location of, the relevant part of the PDF? $\endgroup$ Nov 17, 2018 at 18:09
  • $\begingroup$ the author demonstrated how to calculate AIC on page 2 and then demonstrated forward selection on the bottom of page 3 $\endgroup$
    – CeraVeUser
    Nov 17, 2018 at 18:18
  • $\begingroup$ These are two different models. The first has only an intercept, while the second has several variables as selected by forward selection. $\endgroup$ Nov 17, 2018 at 18:43
  • $\begingroup$ > step(lm(SAT~1),SAT~.,direction="forward") Start: AIC=419.42 SAT ~ 1 Call: lm(formula = SAT ~ 1) Coefficients: (Intercept) 948.4 The starting AIC has considered several variables? $\endgroup$
    – CeraVeUser
    Nov 17, 2018 at 18:49
  • $\begingroup$ Ah. I misunderstood your question because I was confused about what you were looking at. $\endgroup$ Nov 17, 2018 at 21:12

1 Answer 1

1
$\begingroup$

See the note in the referenced paper:

This is what the functions AIC and BIC calculate in R. The AIC and BIC formulas in your textbook ignore the leading two terms n + n log 2π and use p instead of p + 1.

It looks like the "step" function in R uses the latter convention. You'll find that the difference between the two AICs here is n + n log 2π + 2, which is a quantity that doesn't depend on the model itself, and so doesn't have any effect on model selection.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.