Skip to main content

Objects of the class

Thinking about statistics
Law or aphorism
Intermediate
From Foghorn Leghorn to Jacques Cousteau.
Published

November 9, 2026

Modified

November 13, 2026

Entry #141 in Andrew Gelman’s Handy Statistical Lexicon. Original discussion: Objects of the class “Objects of the class”.

Filed under Thinking about statistics · Law or aphorism · Intermediate.

Source check: ✓ The explanation was checked against the source.

What it is

Gelman’s post is a list of categories, each named after a prototypical member. Some examples:

  • “Foghorn Leghorn”: parodies that are more famous than the original.
  • “Whoopi Goldberg”: actors who are undeniably talented but almost always in movies unworthy of their talent.
  • “Weekend at Bernie’s”: low-quality movies that nobody has actually seen but everybody knows the plot of.
  • “George Orwell”: when something is called “Orwellian,” it’s something Orwell would have hated (and the same for Kafka).
  • “Sherlock Holmes”: cultural products that are well remembered but systematically misremembered.
  • “Verbal Behavior”: works whose criticisms are more widely read than the works themselves.
  • “Jacques Cousteau”: people who are world famous in a category with only one famous person (Evel Knievel, Stradivarius, James Naismith).

It’s a playful exercise, and Gelman ends with “We need some more.” It also touches a real statistical issue: which class you put something in determines what you predict about it. That is the reference class problem, and it is what this page’s simulation explores. The statistical extension is ours, not part of the post.

Why it matters

Naming a class after a prototype makes a pattern easy to spot and remember. In statistics, the same move has consequences, because every prediction about an individual case borrows information from a class of similar cases. Is this new study a psychology experiment (low replication rate), a preregistered experiment (higher), or a preregistered experiment with a large sample (higher still)? Different reasonable classes give different base rates. Narrow classes are more relevant but have few members and noisy rates. Broad classes are stable but less relevant. Naming the class explicitly, as Gelman’s examples do, makes the choice visible.

How it works

Choose among nested reference classes for a new case: broad, medium and narrow. The narrow class’s rate is closest to the case’s true rate but is estimated from few members. The broad class’s rate is precise but biased. Partial pooling, which shrinks the narrow class’s rate toward the broader ones, usually beats any single class. That is the multilevel answer to the reference class problem.

Simulated example

A new case belongs to nested classes with different true base rates. Compare predictions from each reference class, and from partial pooling, over many repetitions.

Show simulation code

The R version uses base R, and the Python version uses NumPy and Matplotlib. Where the simulation draws random numbers, each language draws its own, so exact numbers differ slightly but show the same pattern. The numbered markers in the R code are explained under it.

import {rng, range, mean, fmt, debounce} from "../js/stats.js"

viewof nNarrow = debounce(Inputs.range([3, 200], {value: 12, step: 1, label: "Members of the narrow class"}))
viewof gapRate = debounce(Inputs.range([0, 0.4], {value: 0.2, step: 0.01, label: "How different the narrow class really is"}))
viewof seed = debounce(Inputs.range([1, 500], {value: 141, step: 1, label: "Random seed"}))

classes = {
  const r = rng(seed);
  const pBroad = 0.35, pMed = pBroad + gapRate / 2, pNarrow = pBroad + gapRate;
  const err = {Broad: [], Medium: [], Narrow: [], "Partial pooling": []};
  for (let k = 0; k < 2000; k++) {
    const eB = r.binomial(3000, pBroad) / 3000, eM = r.binomial(300, pMed) / 300, eN = r.binomial(nNarrow, pNarrow) / nNarrow;
    const prior = eM, w = nNarrow / (nNarrow + 25);
    const pooled = w * eN + (1 - w) * prior;
    err.Broad.push((eB - pNarrow) ** 2); err.Medium.push((eM - pNarrow) ** 2); err.Narrow.push((eN - pNarrow) ** 2); err["Partial pooling"].push((pooled - pNarrow) ** 2);
  }
  return Object.entries(err).map(([cls, e]) => ({cls, rmse: Math.sqrt(mean(e))}));
}

Plot.plot({
  ariaLabel: "Objects of the class: simulation chart",
  ariaDescription: "Horizontal axis: RMSE predicting the new case's true rate. The chart updates with the controls above it, and the summary below the charts states the result in words.",
  height: 200,
  marginLeft: 120,
  x: {label: "RMSE predicting the new case's true rate", grid: true},
  y: {label: null, domain: ["Broad", "Medium", "Narrow", "Partial pooling"]},
  marks: [Plot.barX(classes, {y: "cls", x: "rmse", fill: d => d.cls === "Partial pooling" ? "#2166ac" : "#8a8a8a"}), Plot.ruleX([0])]
})
# Objects of the class: broad, narrow, or partially pooled reference class.
1n_narrow <- 12 # members of the narrow class
gap_rate <- 0.2 # how different the narrow class really is
2set.seed(141)

p_broad <- 0.35
p_med <- p_broad + gap_rate / 2
3p_narrow <- p_broad + gap_rate # the rate we want to estimate
est <- replicate(2000, {
  broad <- rbinom(1, 3000, p_broad) / 3000
  medium <- rbinom(1, 300, p_med) / 300
4  narrow <- rbinom(1, n_narrow, p_narrow) / n_narrow
5  w <- n_narrow / (n_narrow + 25) # shrink the narrow class toward medium
  c(
    Broad = broad, Medium = medium, Narrow = narrow,
    "Partial pooling" = w * narrow + (1 - w) * medium
  )
})
rmse <- sqrt(rowMeans((est - p_narrow)^2))
print(round(rmse, 3)) # error in estimating the narrow class's rate

6barplot(rmse,
  col = c("grey70", "grey70", "grey70", "#2166ac"),
  ylab = "Root mean squared error"
)
1
The page’s controls: how many members the narrow reference class has, and how different it really is from the broad one.
2
Fixes the random numbers so the run is reproducible.
3
The rate we want: the narrow class’s.
4
The narrow class’s observed rate is right on average but noisy, because the class is small.
5
Partial pooling: shrink the narrow class’s rate toward the medium class’s, more when the narrow class is smaller.
6
Error of each reference class, and of partial pooling, which usually beats any single class.
# Objects of the class: broad, narrow, or partially pooled reference class.
import numpy as np
import matplotlib.pyplot as plt

n_narrow = 12   # members of the narrow class
gap_rate = 0.2  # how different the narrow class really is
rng = np.random.default_rng(141)

p_broad = 0.35
p_med = p_broad + gap_rate / 2
p_narrow = p_broad + gap_rate  # the rate we want to estimate
broad = rng.binomial(3000, p_broad, 2000) / 3000
medium = rng.binomial(300, p_med, 2000) / 300
narrow = rng.binomial(n_narrow, p_narrow, 2000) / n_narrow
w = n_narrow / (n_narrow + 25)  # shrink the narrow class toward medium
est = {"Broad": broad, "Medium": medium, "Narrow": narrow,
       "Partial pooling": w * narrow + (1 - w) * medium}
rmse = {k: np.sqrt(np.mean((v - p_narrow) ** 2)) for k, v in est.items()}
for k, v in rmse.items():
    print(f"{k}: RMSE {v:.3f}")

plt.bar(list(rmse), list(rmse.values()),
        color=["0.7", "0.7", "0.7", "#2166ac"])
plt.ylabel("Root mean squared error")
plt.show()

Key takeaways

  • Naming a case’s class is a modeling choice that drives the prediction.
  • Narrow classes are relevant but noisy. Broad classes are stable but biased.
  • Multilevel models pool across nested classes instead of forcing a single choice.

Source

Back to top