Robustness checks
Noise and evidence
Law or aphorism
Intermediate
are a joke.
What it is
Papers routinely include a “robustness checks” table showing the main result surviving alternative specifications. Gelman’s complaint is that these are usually a ritual. Authors choose which checks to report, they run checks until enough agree, and checks that undermine the result tend to be left out or explained away. A robustness table that always says “robust” carries no information.
Why it matters
Robustness checks are supposed to probe whether a result depends on arbitrary choices. Selected to reassure, they do the opposite: they hide the dependence. Readers see five specifications agreeing and conclude the result is solid, when twenty other reasonable specifications might have disagreed. Honest robustness work reports the full range of reasonable specifications, as in a specification curve or multiverse analysis, including the ones that hurt.
How it works
Suppose there are \(K\) reasonable specifications, and the main estimate is significant in some of them. Authors report the main specification plus the \(m\) checks that agree most. The reported table is robust by selection. Even under a null effect, if any specification is significant, there are usually several correlated neighbors that agree with it.
Simulated example
The true effect is zero, and 30 reasonable specifications give correlated estimates. We simulate datasets until one produces a significant specification, because that’s the dataset that becomes a paper. The authors lead with the most significant estimate and report the 5 checks closest to it. Compare the reported table with the full set of specifications.
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, fmt} from "../js/stats.js"
viewof trueEff = Inputs.range([0, 0.5], {value: 0, step: 0.05, label: "True effect"})
viewof corr = Inputs.range([0, 0.95], {value: 0.7, step: 0.05, label: "Correlation among specifications"})
viewof seed = Inputs.range([1, 500], {value: 120, step: 1, label: "Random seed"})
specs = {
const r = rng(seed);
const se = 0.15;
// Only datasets where some specification is significant turn into a paper.
let all, tries = 0;
do {
const common = r.normal(0, se);
all = range(30).map(k => {
const est = trueEff + Math.sqrt(corr) * common + Math.sqrt(1 - corr) * r.normal(0, se);
return {k, est, lo: est - 1.96 * se, hi: est + 1.96 * se, sig: Math.abs(est) > 1.96 * se};
});
tries++;
} while (!all.some(d => d.sig) && tries < 500);
all = all.sort((a, b) => a.est - b.est).map((d, i) => ({...d, rank: i, tries}));
const main = all.reduce((a, b) => Math.abs(b.est) > Math.abs(a.est) ? b : a);
const reported = all.slice().sort((a, b) => Math.abs(a.est - main.est) - Math.abs(b.est - main.est)).slice(0, 6).map(d => d.k);
return all.map(d => ({...d, reported: reported.includes(d.k)}));
}
Plot.plot({
ariaLabel: "Robustness checks: simulation chart",
ariaDescription: "Horizontal axis: Specification (sorted by estimate). Vertical axis: Estimate ± 1.96 se. The chart updates with the controls above it, and the summary below the charts states the result in words.",
height: 300,
x: {label: "Specification (sorted by estimate)"},
y: {label: "Estimate ± 1.96 se", grid: true},
marks: [
Plot.ruleX(specs, {x: "rank", y1: "lo", y2: "hi", stroke: d => d.reported ? "#d6604d" : "#8a8a8a", strokeWidth: d => d.reported ? 3 : 1.5}),
Plot.dot(specs, {x: "rank", y: "est", fill: d => d.reported ? "#d6604d" : "#8a8a8a", r: 3}),
Plot.ruleY([0]),
Plot.ruleY([trueEff], {stroke: "#2166ac", strokeDasharray: "4 3"})
]
})# Robustness checks: 30 specifications, only a few of them reported.
1true_eff <- 0 # true effect
corr <- 0.7 # correlation among specifications
2set.seed(118)
se <- 0.15
# Only datasets where some specification is significant become a paper
tries <- 0
repeat {
tries <- tries + 1
common <- rnorm(1, 0, se)
3 est <- true_eff + sqrt(corr) * common + sqrt(1 - corr) * rnorm(30, 0, se)
4 if (any(abs(est) > 1.96 * se) || tries >= 500) break
}
5main <- est[which.max(abs(est))] # the headline specification
6reported <- order(abs(est - main))[1:6] # and five "robustness checks"
cat("Datasets tried before a significant one: ", tries, "\n",
"Significant: ", sum(abs(est[reported]) > 1.96 * se), " of 6 reported",
" specifications, ", sum(abs(est) > 1.96 * se), " of all 30\n",
sep = ""
)
o <- order(est)
7plot(est[o], 1:30,
pch = 19, xlim = range(est) + c(-0.3, 0.3),
col = ifelse(o %in% reported, "#d6604d", "grey50"),
xlab = "Estimate with 95% interval", ylab = "Specification"
)
segments(est[o] - 1.96 * se, 1:30, est[o] + 1.96 * se, 1:30,
col = ifelse(o %in% reported, "#d6604d", "grey70")
)
abline(v = c(0, true_eff), lty = c(1, 2))- 1
- The page’s controls: the true effect and how correlated the 30 specifications are.
- 2
- Fixes the random numbers so the run is reproducible.
- 3
- Thirty reasonable specifications of the same analysis, with correlated estimates.
- 4
- Only a dataset in which some specification is significant becomes a paper.
- 5
- The headline specification: the most significant one.
- 6
- The robustness checks: the five specifications that agree most closely with the headline.
- 7
- All 30 specifications, the reported six in red. The table was chosen, not discovered.
# Robustness checks: 30 specifications, only a few of them reported.
import numpy as np
import matplotlib.pyplot as plt
true_eff = 0 # true effect
corr = 0.7 # correlation among specifications
rng = np.random.default_rng(120)
se = 0.15
# Only datasets where some specification is significant become a paper
for tries in range(1, 501):
common = rng.normal(0, se)
est = (true_eff + np.sqrt(corr) * common
+ np.sqrt(1 - corr) * rng.normal(0, se, 30))
if np.any(np.abs(est) > 1.96 * se):
break
main = est[np.argmax(np.abs(est))] # the headline specification
reported = np.argsort(np.abs(est - main))[:6] # and five "robustness checks"
sig = np.abs(est) > 1.96 * se
print(f"Datasets tried before a significant one: {tries}")
print(f"Significant: {sig[reported].sum()} of 6 reported specifications, "
f"{sig.sum()} of all 30")
o = np.argsort(est)
cols = np.where(np.isin(o, reported), "#d6604d", "0.5")
plt.errorbar(est[o], np.arange(30), xerr=1.96 * se, fmt="none",
ecolor=cols)
plt.scatter(est[o], np.arange(30), c=cols, zorder=3)
plt.axvline(0, color="black")
plt.xlabel("Estimate with 95% interval (red: reported)")
plt.ylabel("Specification")
plt.show()Key takeaways
- Selected robustness checks show only what the authors chose to show.
- Report all reasonable specifications, as in a specification curve or multiverse analysis.
- A check that couldn’t have failed isn’t a check.
Source
- Andrew Gelman, Robustness checks are a joke (2018).