liveBook · Manning

AIC

As explained in Statistics Slam Dunk

The Akaike information criterion is a model-selection score that balances goodness of fit against model complexity, with lower values generally preferred among comparable models.

AIC compares competing statistical models by balancing explained variation against model complexity. Lower values are preferred, but an isolated AIC score has little meaning. section 5.7.6 section 14.5.2

Use AIC with these practical rules:

  • Compare models fitted to the same analytical problem rather than interpreting one score alone. section 5.7.6
  • Prefer the model with the lower AIC when other evidence is comparable. section 14.5.2
  • Treat a difference of two or more AIC units as a rule-of-thumb indication of a significantly better fit. section 5.7.6

NBA regression comparison

A reduced regression predicting wins from screen assists, deflections, and loose balls had AIC 514, versus 518 for the fuller model. The reduced model therefore compared favorably, alongside slightly better adjusted R² and cleaner diagnostics, although its average prediction error was marginally larger. section 5.7.6

fit2 <- lm(wins ~ screen_assists_pts + deflections + loose_balls, 
          data = train)

tidy(fit2)
## # A tibble: 4 × 5
##   term               estimate std.error statistic p.value
##   <chr>                 <dbl>     <dbl>     <dbl>   <dbl>
## 1 (Intercept)          -56.1     25.5       -2.20 0.0317 
## 2 screen_assists_pts     1.12     0.422      2.65 0.0101 
## 3 deflections            2.35     0.859      2.74 0.00805
## 4 loose_balls            4.81     1.98       2.42 0.0182
augment(fit2) -> fit_tbl2
print(fit_tbl2)
# A tibble: 67 × 10
##    wins screen_assists_pts deflections loose_balls .fitted  .resid   
##   <int>              <dbl>       <dbl>       <dbl>   <dbl>   <dbl>  
## 1    49               20          14.1         8.3    39.3   9.66  
## 2    42               26.2        12.1         8      40.1   1.85  
## 3    39               25.7        12.6         8.1    41.2  -2.24  
## 4    19               22.4        11.8         7.6    33.3 -14.3   
## 5    33               20.1        11.5         8.4    33.8  -0.825 
## 6    54               19.9        13.9         8.6    40.2  13.8   
## 7    57               26.3        14.2         8.7    48.6   8.44  
## 8    53               16.6        14.9         8.4    37.9  15.1   
## 9    48               20.2        14.2         8.6    41.2   6.76  
##10    37               20.1        11.9         8.5    35.2   1.75  
##         hat .sigma  .cooksd .std.resid
##       <dbl>  <dbl>    <dbl>      <dbl>
## 1    0.0224   10.8 0.00472      0.907 
## 2    0.0726   10.8 0.000626     0.179 
## 3    0.0568   10.8 0.000691    -0.214 
## 4    0.0647   10.7 0.0324      -1.37  
## 5    0.0749   10.9 0.000128    -0.0797
## 6    0.0316   10.7 0.0138       1.30  
## 7    0.0792   10.8 0.0144       0.817 
## 8    0.0550   10.7 0.0303       1.44  
## 9    0.0298   10.8 0.00312      0.637 
##10    0.0632   10.9 0.000478     0.168 
## # ... with 57 more rows

fit_tbl2 %>%
 mutate(wins_dif = abs(wins - .fitted)) -> fit_tbl2
mean(fit_tbl2$wins_dif)
## [1] 8.427093
glance(fit2)
## # A tibble: 1 × 12
##   r.squared adj.r.squared sigma statistic p.value    df logLik   
##       <dbl>         <dbl> <dbl>     <dbl>   <dbl> <dbl>  <dbl> 
## 1     0.194         0.156  10.8      5.06 0.00334     3  -252.  
##        AIC   BIC deviance df.residual  nobs
##       dbl> <dbl>    <dbl>       <int> <int>
## 1     514.  525.    7302.          63    67

vif(fit2)
## screen_assists_pts        deflections        loose_balls 
##           1.085184           1.031128           1.098619
par(mfrow = c(2,2))
plot(fit2)

Inspect the reduced regression, its coefficient output, and augmented predictions before comparing model diagnostics and AIC. section 5.7.6

How Statistics Slam Dunk covers it

How deep it goes
Defines the score and interpretation rule, then applies it to regression and ANOVA comparisons without deriving its formula.
Examples
Uses NBA win regressions and offense-versus-defense ANOVAs, including R outputs with AIC values of 514 versus 518 and 729.2831 versus 760.9676.
What it assumes
Assumes fitted regression or ANOVA models and basic fit statistics, while defining AIC before applying it.
What you can do after
Evaluate competing models with R's glance() or AIC() functions and interpret lower scores alongside diagnostics and other statistics.
How it connects
Connects model selection with goodness of fit, model complexity, log likelihood, adjusted R², p-values, diagnostics, and ANOVA.

Also explained in

Compare how 3 books explain AIC →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Statistics Slam Dunk. The section links point to the parts of the book it draws on.