Interactive demo · Probability and Statistical Inference · Chapter 19

Choosing a log-linear model across the hierarchy: deviance, AIC and BIC

A three-way table has nine hierarchical log-linear models that keep all three main effects, ordered from mutual independence (bottom) to the saturated model (top); each step up adds one interaction. Every model is fitted by iterative proportional fitting. The deviance compares a model with the saturated one; AIC = ℓ − |M| and BIC = ℓ − |M| log(n)/2 trade fit against size (larger is better, the book's convention). The backward search starts at the top and removes one term at a time while the criterion improves.

Data

True model for the simulation

Sample size n

Criterion

Level of the deviance tests α

Try these

Simulated tables: n draws from the cell probabilities of the chosen model fitted to the breast cancer data, by inversion with the seeded generator (seed in the readout). |M| counts ψ∅, as the book does; the deviance has N − |M| degrees of freedom (N = number of cells). "Smallest model not rejected" picks, among the models whose deviance test does not reject, one with the fewest parameters (ties: the larger p-value).

In the lecture notes