Assumptions and Rigor
Thinking about statistics
Principle or heuristic
Intermediate
You can’t have one without the other.
What it is
Gelman’s post is a song parody, “with apologies to Sammy Cahn and Jimmy Van Heusen”, the writers of “Love and Marriage”:
Assumps and rigor, ’sumps and rigor Go together with utmost vigor. This I tell you brother You can’t have one without the other.
The post makes its point in verse and adds no argument. Our reading of it: “rigorous” methods come with guarantees, such as unbiasedness, nominal coverage or consistency, and every one of those guarantees is conditional on assumptions. A rigorous result is a precise statement of what follows if the assumptions hold, so you can’t have the rigor without the assumptions.
Why it matters
Methods get marketed as “assumption-free” or “rigorous” in contrast with “model-based” approaches, as if some designs needed no assumptions. Difference-in-differences needs parallel trends. Instrumental variables need exclusion. Randomization inference needs a correctly specified estimand and no interference. Treating the rigor as unconditional hides the assumptions, and that is exactly where things go wrong.
How it works
Take difference-in-differences. The estimator is unbiased for the treatment effect if treated and control groups would have followed parallel trends without treatment. If the treated group’s trend differs by \(\delta\) per period, the estimator’s bias is \(\delta\) times the number of periods. Its standard error and confidence interval know nothing about this. Coverage falls as the assumption fails, while the stated interval stays just as “rigorous.”
Simulated example
A difference-in-differences study with a true effect of 1. Introduce a violation of parallel trends and watch the rigorous-looking interval lose its guarantee.
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, variance, fmt, pct} from "../js/stats.js"
viewof delta = Inputs.range([-1, 1], {value: 0.4, step: 0.05, label: "Violation of parallel trends δ"})
viewof n = Inputs.range([20, 500], {value: 100, step: 10, label: "Units per group"})
viewof seed = Inputs.range([1, 500], {value: 86, step: 1, label: "Random seed"})
did = {
const r = rng(seed);
return range(300).map(k => {
const cPre = r.normals(n, 0, 1), cPost = r.normals(n, 0.5, 1);
const tPre = r.normals(n, 0.3, 1), tPost = r.normals(n, 0.3 + 0.5 + delta + 1, 1);
const est = (mean(tPost) - mean(tPre)) - (mean(cPost) - mean(cPre));
const se = Math.sqrt((variance(tPost) + variance(tPre) + variance(cPost) + variance(cPre)) / n);
return {k, est, lo: est - 1.96 * se, hi: est + 1.96 * se};
});
}
Plot.plot({
ariaLabel: "Assumptions and Rigor: simulation chart",
ariaDescription: "Horizontal axis: Replication (first 50). Vertical axis: DiD estimate with 95% interval. The chart updates with the controls above it, and the summary below the charts states the result in words.",
height: 280,
x: {label: "Replication (first 50)"},
y: {label: "DiD estimate with 95% interval", grid: true},
marks: [
Plot.ruleX(did.slice(0, 50), {x: "k", y1: "lo", y2: "hi", stroke: d => d.lo <= 1 && 1 <= d.hi ? "#2166ac" : "#d6604d"}),
Plot.dot(did.slice(0, 50), {x: "k", y: "est", r: 2, fill: "currentColor"}),
Plot.ruleY([1], {stroke: "currentColor", strokeDasharray: "4 3"})
]
})# Assumptions and Rigor: difference-in-differences without parallel trends.
1delta <- 0.4 # violation of parallel trends
n <- 100 # units per group
2set.seed(86)
did <- t(replicate(300, {
c_pre <- rnorm(n, 0)
c_post <- rnorm(n, 0.5) # control group
t_pre <- rnorm(n, 0.3)
3 t_post <- rnorm(n, 0.3 + 0.5 + delta + 1)
4 est <- (mean(t_post) - mean(t_pre)) - (mean(c_post) - mean(c_pre))
se <- sqrt((var(t_post) + var(t_pre) + var(c_post) + var(c_pre)) / n)
c(est = est, lo = est - 1.96 * se, hi = est + 1.96 * se)
}))
5covered <- did[, "lo"] <= 1 & did[, "hi"] >= 1 # the true effect is 1
cat("Coverage of the nominal 95% interval: ",
round(100 * mean(covered), 1), "%\n",
sep = ""
)
cat("Average estimate:", round(mean(did[, "est"]), 2), "(true effect: 1)\n")
d <- did[1:50, ]
6plot(1:50, d[, "est"],
pch = 19, cex = 0.6, ylim = range(d[, -1]),
xlab = "Replication", ylab = "Estimate with 95% interval"
)
segments(1:50, d[, "lo"], 1:50, d[, "hi"],
col = ifelse(covered[1:50], "#2166ac", "#d6604d")
)
abline(h = 1, lty = 2)- 1
- The page’s controls: how far the treated group’s trend departs from the control group’s, and the group sizes.
- 2
- Fixes the random numbers so the run is reproducible.
- 3
- The treated group’s post-period outcome: its own trend, plus the violation of parallel trends, plus the true effect of 1.
- 4
- The difference-in-differences estimate, which is rigorous only if the parallel-trends assumption holds.
- 5
- Whether each replication’s 95% interval covers the true effect of 1.
- 6
- Fifty replications with their intervals. Red intervals miss the truth, and the share that miss is the cost of the violated assumption.
# Assumptions and Rigor: difference-in-differences without parallel trends.
import numpy as np
import matplotlib.pyplot as plt
delta = 0.4 # violation of parallel trends
n = 100 # units per group
rng = np.random.default_rng(86)
est, lo, hi = [], [], []
for _ in range(300):
c_pre, c_post = rng.normal(0, 1, n), rng.normal(0.5, 1, n) # control
t_pre = rng.normal(0.3, 1, n)
t_post = rng.normal(0.3 + 0.5 + delta + 1, 1, n)
e = (t_post.mean() - t_pre.mean()) - (c_post.mean() - c_pre.mean())
se = np.sqrt((t_post.var(ddof=1) + t_pre.var(ddof=1) + c_post.var(ddof=1)
+ c_pre.var(ddof=1)) / n)
est.append(e); lo.append(e - 1.96 * se); hi.append(e + 1.96 * se)
est, lo, hi = map(np.array, (est, lo, hi))
covered = (lo <= 1) & (hi >= 1) # the true effect is 1
print(f"Coverage of the nominal 95% interval: {100 * covered.mean():.1f}%")
print(f"Average estimate: {est.mean():.2f} (true effect: 1)")
k = np.arange(50)
plt.vlines(k, lo[:50], hi[:50],
colors=np.where(covered[:50], "#2166ac", "#d6604d"))
plt.plot(k, est[:50], "o", color="black", markersize=3)
plt.axhline(1, color="black", linestyle="--")
plt.xlabel("Replication")
plt.ylabel("Estimate with 95% interval")
plt.show()Key takeaways
- Every rigorous guarantee is conditional on assumptions. State them.
- “Assumption-free” methods have assumptions too. They’re just less visible.
- Check assumptions where possible, and report how conclusions change when they’re relaxed.
Source
- Andrew Gelman, ‘Sumps and rigor (2019).