Accessible version · How to use this site with a screen reader · Course home
Day 3 Afternoon · Accessible lecture notes

Hypothesis tests and model selection

A screen-reader-friendly transcript of the lecture slides: all slide text, tables, figure descriptions, and speaker notes.

About these notes

Each section is one slide. Figures carry text descriptions where available. For the concepts with worked examples, also read the plain-language summary and lab for this session.

Slide 1

1

Speaker notes for this slide

a

Slide 2: Model selection — Why?

Slide 3: Inference, Estimation, Prediction

Slide 4: Model selection — Why?

Slide 5: Fit?

Slide 6: Definitions: AIC, BIC, LRT

Slide 7: Hypothesis Tests to Compare Models (not parameters)

7

Slide 8: Nested Models

8

Slide 9: Hypothesis Tests for Models

9

Slide 10: Hypothesis Tests for Models

10

Compute the likelihood ratio

( −ln LA − (−ln LB) )

If using lm or glm objects in R: lrtest(full_model, reduced_model)

Slide 11: When is this useful rather than just interpreting coefficients?

Interpret coefficients when you're asking about individual parameters. Use a likelihood ratio test (LRT) when you're asking about a model or a collection of parameters.

glm(count ~ temperature + elevation, family = poisson)

No Need for LRT, just interpret coefficients

glm(count ~ treatment, family = poisson)

Suppose treatment has 5 levels. How do you know if the model is better with treatment? Use LRT

glm(count ~ treatment*temperature, family = poisson)

How do you know if the interaction term makes the model better? Use LRT

Slide 12: Usually the simpler model sets some parameters to zero, but null can be nonzero

Slide 13: Example-I

13

L = P130 (1 − P1)20 P210 (1 − P2)40

Slide 14: Example-II

Summary for this example

P̂1

P̂2

−ln L

Slide 15: Example-II

Figure 15.1. Chi-square distribution table: rows are degrees of freedom, columns are upper-tail probabilities from 0.99 to 0.01, giving critical chi-square values. Used to find p-values for likelihood ratio tests.
Figure 15.2. R console: 1-pchisq(8.630462*2, 1) returns 3.258189e-05, the p-value for the likelihood ratio test with 1 degree of freedom.

Slide 16

Slide 17: Information Theoretic Criteria for Model Selection

Look familiar?

Compare to chi.sq distribution with degrees of freedom = # parameters

AIC and BIC are meaningless on their own, but models with lower values are more parsimonious (i.e. supported). They balance better fit with more parameters. This is exactly what the likelihood ratio test does.

LRT = −2 loge ( ℒs(θˆ) / ℒg(θˆ) )

Slide 18

Compare to chi.sq distribution with degrees of freedom = # parameters

compare two models with k parameters and with k+1

Information Theoretic Criteria for Model Selection

Figure 18.1. Figure (vector image, not machine-readable here) illustrating the difference in information criteria between models with k versus k+1 parameters. Ask instructor for details.

LRT = −2 loge ( ℒs(θˆ) / ℒg(θˆ) )

Slide 19

Figure 19.1. Chi-square distribution table: rows are degrees of freedom, columns are upper-tail probabilities from 0.99 to 0.01, giving critical chi-square values. Used to find p-values for likelihood ratio tests.

Convention within>2 AIC units are “considered competitive”, and this is approximately the same as frequentist model selection using LRT

If 1 parameter separate the model. AIC likes bigger models

“the extra parameter is worth it”

Slide 20

Figure 20.1. Chi-square distribution table: rows are degrees of freedom, columns are upper-tail probabilities from 0.99 to 0.01, giving critical chi-square values. Used to find p-values for likelihood ratio tests.

What if 3 parameters separate the model? AIC likes bigger models

(reject the null that the parameters equal 0)

2 deltaAIC still equivalent to p = 0.05

Slide 21: Most common mistake in ecology!

AICi = −2 log Li + 2 pi

Slide 22

Figure 22.1. Journal of Wildlife Management article header: Arnold, "Uninformative Parameters and Model Selection Using Akaike's Information Criterion." Free Access.

Slide 23: The Cult of AIC

Burnham & Anderson (2002)

Figure 23.1. Book cover of 'Model Selection and Multimodel Inference: A Practical Information-Theoretic Approach,' Second Edition, by Kenneth P. Burnham and David R. Anderson (2002). The cover shows rows of stylized blue-and-yellow spotted frogs on a yellow band (top) and a blue band (bottom), with the title in a black central stripe. This is the foundational AIC and multimodel-inference textbook, shown under the slide title 'The Cult of AIC.'

Slide 24: Two key questions

From statisticians Mark Brewer and Adam Butler

Slide 25: AIC and p-values

Figure 25.1. Line plot from Murtaugh (2014, Ecology, Fig. 2) of the p-value (x-axis, 0 to 0.30) against delta-AIC (y-axis, about -1 to 15) for two models that differ by one parameter. Four curves are shown for sample sizes n = 10 (dashed), n = 20 (dotted), n = 50 (dash-dot) and n = infinity (solid). Every curve falls steeply as the p-value rises from 0, then flattens; all four cross delta-AIC = 0 at roughly p = 0.15 to 0.17 and become slightly negative by p = 0.30. The curves nearly coincide except near p = 0, where smaller samples give larger delta-AIC, illustrating that AIC differences and p-values carry essentially the same information for a one-parameter comparison.

Slide 26

Why does the cult of AIC hate p-values?

Slide 27: Confidence intervals and p-values

-3 -2 -1 0 1 2 3

Estimate and 95% CI. What is p?

Estimate and 99% CI. What is p?

Effect sizes and p tell you the same thing as effect sizes and CIs!

Slide 28: P-values should be interpreted on a continuum. Not a step function at 0.05. AIC should be interpreted in the same way!

Figure 28.1. Diagram: a horizontal p-value scale from 0 to 1, shaded from black (Convincing) at low values through Moderate and Suggestive-but-inconclusive to white (No evidence). Ramsey and Schafer 2002; p-value as a continuum.

deltaAIC=2

deltaAIC=7

Slide 29: So why use AIC?

Slide 30

Why did AIC take over wildlife science?

Slide 31: AIC in practice…

Var 1Var 2Var 3Var 4Var 5AICΔAICWeight
-0.539 (± 0.244)-0.602 (± 0.190)1789.730.000.26
-0.674 (± 0.336)-0.609 (± 0.192)0.173 (± 0.295)1791.381.650.12
-0.544 (± 0.245)0.003 (± 0.008)-0.566 (± 0.214)1791.601.860.10
-0.090 (± 0.333)-0.541 (± 0.244)-0.574 (± 0.217)1791.661.930.10
-0.641 (± 0.201)1792.232.500.08
-0.070 (± 0.335)-0.670 (± 0.336)-0.586 (± 0.220)0.167 (± 0.296)1793.343.610.04
-0.622 (± 0.198)-0.212 (± 0.222)1793.343.610.04
-0.662 (± 0.344)0.001 (± 0.008)-0.591 (± -0.591)0.155 (± 0.316)1793.353.620.04

Which is the top model? Which models are competitive?

Slide 32: AIC in practice

Figure 32.1. Model-selection table: models (e.g. Age+Method, Age) with columns Log-likelihood, K, deltaAICc, and weight w. Top model Age+Method has deltaAICc 0.00, w 0.14; several models within about 2 units.

Why would I hate this table as the only presentation of results?

AICc = AIC + (2k2 + 2k) / (n − k − 1)

wi = exp(−0.5 Δi) / Σr=1 R exp(−0.5 Δr)

Slide 33: Most common mistake in ecology!

AICi = −2 log Li + 2 pi

Slide 34

Figure 34.1. Journal of Wildlife Management article header: Arnold, "Uninformative Parameters and Model Selection Using Akaike's Information Criterion." Free Access.

Slide 35: Best recent paper as a resource to stop doing dumb stuff with AIC

(No text on this slide.)

Slide 36: B & A recipe for modelling

Slide 37: Burnham and Anderson did not advocate model dredging (fitting all/many combinations of predictors)

“An investigator with, say, 10 explanatory variables cannot expect to learn much from his data and a multiple linear regression analysis unless there is some substantial supporting science that can be used to help narrow the number of models to consider. In this example, there would be 1,024 models (many more if transformations or interaction terms were allowed), and over-fitting would surely be a serious risk. The analysis, by whatever method, should probably be considered exploratory and the results used to design further data gathering leading to a more confirmatory analysis, based on some a priori considerations” (Burnham and Anderson 2002:85)

Slide 38

(No text on this slide.)

Slide 39: Then what about BIC? Is it just a similar alternative?

Slide 40: AIC vs BIC

Slide 41

MethodPrimary purposeRequires nested models?Complexity penaltyProduces p-value?
Likelihood Ratio Test (LRT)Test a specific null hypothesisYesNone; compares improvement in likelihood to chi^2 distributionYes
AICSelect the model expected to predict new data bestNo2 AIC units per additional parameterNo
BICSelect the simplest plausible data-generating modelNoLog(n) BIC units per additional parameterNo

Slide 42: Crossvalidation: Split data, train model, compare predictions to actual using test data. Repeat.

Train

Test

Dataset

Slide 43: Recommended Readings

Slide 44

Figure 44.1. Journal article header: Murtaugh 2007, "Simplicity and Complexity in Ecological Data Analysis," Ecology, with abstract arguing analyses are often needlessly complicated.
Figure 44.2. Quote in italics: a professor says they could test hypotheses with simple t tests but want something more elegant to fit a better journal. Attributed to an Oregon State University professor requesting statistical help.

Slide 45: Don’t take my word for it…

One way to avoid some of the problems associated with model selection is to “just say no” to data-driven model selection—in other words, fit a single pre-specified model, one in which all explanatory variables are chosen prior to looking at their relationship with the response variable, and then use this model for inference (Harrell 2001, Babyak 2004, Whittingham et al. 2006, Guidice et al. 2012).

Slide 46

“If researchers want to accurately estimate the strength of multiple competing ecological processes along with reliable confidence intervals, their best hope is to use full (maximal) statistical models after making principled, a priori decisions about which predictors to include. “

Figure 46.1. Multi-panel plot of relative probability of selection versus canopy cover, distance to road, distance to water, and ruggedness, one row per species, with fitted curves and shaded confidence bands.

Don’t take my word for it…

Left as a preprint for years until Bolker finally submitted it to a journal after we chatted about this problem

Slide 47: Don’t take my word for it…

The associated sums of AIC model weights recommended to assess relative importance of individual predictors are really a measure of relative importance of models, with little information about contributions by individual predictors compared to other measures of relative importance based on effects size or variance reduction.

The standardized estimates or equivalently the t statistics on unstandardized estimates also can be used to provide more informative measures of relative importance than sums of AIC weights. Finally, I illustrate how seriously compromised statistical interpretations and predictions can be for all three of these flawed practices by critiquing their use in a recent species distribution modeling technique developed for predicting Greater Sage‐Grouse (Centrocercus urophasianus) distribution in Colorado, USA. These model averaging issues are common in other ecological literature and ought to be discontinued if we are to make effective scientific contributions to ecological knowledge and conservation of natural resources.