Day 3 · Interactive

Shrinkage: how a random effect borrows strength

Eight sites, each with its own noisy estimate. A mixed model pulls each site's estimate toward the overall mean — a lot when a site has little data or sites are alike, a little when a site has lots of data or sites truly differ.

● no-pooling estimate (site mean) ● partial-pooling estimate (mixed model) — overall (grand) mean
Show the plotted values as a table

Things to try

  1. Small τ → strong shrinkage. Slide τ toward 0. The model decides sites are basically alike, so every site estimate collapses onto the grand mean.
  2. Large τ → almost no shrinkage. Slide τ up. The model trusts each site's own data, and the teal estimates sit almost on top of the orange ones.
  3. More data → less shrinkage. Raise n. Each site's own mean becomes more reliable, so it is pulled less toward the center.
  4. Noisier observations → more shrinkage. Raise σ. Each site's own mean is now measured badly, so the model leans harder on the grand mean. Notice that τ and σ/√n are in a tug of war: only their ratio matters.
  5. The shrinkage weight shown below is τ² / (τ² + σ²/n): the fraction of the way each estimate stays at its own site mean rather than the grand mean.

← Back to the Day 3 lab