Skip to main content

Looking for a needle in a pile of needles

Causes, samples and populations
Principle or heuristic
Intermediate
They’re not looking for a needle in a haystack, they’re . . .
Published

November 9, 2026

Modified

November 13, 2026

Entry #88 in Andrew Gelman’s Handy Statistical Lexicon. Original discussion: “Positive Claims get Publicity, Refutations do Not: Evidence from the 2020 Flu”.

Filed under Causes, samples and populations · Principle or heuristic · Intermediate.

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

What it is

A needle in a haystack is hard to find, but once found it’s obviously a needle. A needle in a pile of needles can’t be picked out at all, because everything around it looks the same. Gelman used the phrase about an observational study claiming that U.S. cities with stronger public-health interventions during the 1918 flu had faster economic growth afterwards. Comparing cities, “the tide of the correlation is so much larger than the swells of the treatment effect.” Cities differed in many ways that also predicted growth. When other researchers extended the data backwards, the intervention measures “explained” growth from before 1918 just as well as growth after it, which leaves a noisy zero.

Why it matters

Observational comparisons across places, firms or people mix any treatment effect with every pre-existing difference that happens to correlate with treatment. If those differences are large and the effect is small, the estimate mostly reflects the differences. Adding controls and robustness checks doesn’t fix this, and Gelman notes the authors had done both. The data simply can’t single out the needle. He stresses that this isn’t a slam on the authors, who used standard methods carefully. It’s that the method can’t solve this problem.

How it works

Let city \(c\) have a background growth tendency \(g_c\) and treatment intensity \(x_c\) that is correlated with \(g_c\). Growth in a period is \(y_c = g_c + \beta x_c + \epsilon_c\). Regressing \(y\) on \(x\) gives roughly \(\beta + \text{cov}(x, g)/\text{var}(x)\). When the confounding term is much larger than \(\beta\), the estimate is driven by it. A placebo test, regressing pre-treatment growth on the later treatment, picks up the same confounding term, which is the tell-tale sign the replicators found.

Simulated example

There are 43 cities, as in the original study. Background growth differs by city and is correlated with how strongly each city intervened. Compare the “effect” estimated on post-1918 growth with the placebo estimate on pre-1918 growth, over 500 simulated datasets.

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, lm, fmt} from "../js/stats.js"

viewof beta = Inputs.range([0, 0.5], {value: 0.05, step: 0.01, label: "True effect of the intervention (β)"})
viewof confound = Inputs.range([0, 1], {value: 0.6, step: 0.05, label: "Correlation of intervention with background growth"})
viewof seed = Inputs.range([1, 500], {value: 88, step: 1, label: "Random seed"})

needles = {
  const r = rng(seed);
  return range(500).flatMap(k => {
    const cities = range(43).map(() => {
      const g = r.normal(), x = confound * g + Math.sqrt(1 - confound * confound) * r.normal();
      return {x, pre: g + r.normal(0, 0.5), post: g + beta * x + r.normal(0, 0.5)};
    });
    return [
      {period: "Placebo: growth before 1918", est: lm(cities.map(c => c.x), cities.map(c => c.pre)).b},
      {period: "Claimed effect: growth after 1918", est: lm(cities.map(c => c.x), cities.map(c => c.post)).b}
    ];
  });
}

Plot.plot({
  ariaLabel: "Looking for a needle in a pile of needles: simulation chart",
  ariaDescription: "Horizontal axis: Estimated 'effect' of the intervention on growth. Vertical axis: Simulated datasets. The chart updates with the controls above it, and the summary below the charts states the result in words.",
  height: 300,
  x: {label: "Estimated 'effect' of the intervention on growth", grid: true},
  y: {label: "Simulated datasets"},
  color: {legend: true, range: ["#2166ac", "#8a8a8a"], domain: ["Claimed effect: growth after 1918", "Placebo: growth before 1918"]},
  marks: [
    Plot.rectY(needles, Plot.binX({y: "count"}, {x: "est", fill: "period", fillOpacity: 0.55, thresholds: 50, mixBlendMode: "multiply"})),
    Plot.ruleX([beta], {stroke: "#d6604d", strokeWidth: 2}),
    Plot.ruleY([0])
  ]
})
# Looking for a needle in a pile of needles: a placebo test.
1beta <- 0.05 # true effect of the intervention
confound <- 0.6 # correlation of the intervention with background growth
2set.seed(88)

# 500 replications of a 43-city study
est <- t(replicate(500, {
  g <- rnorm(43) # background growth of each city
3  x <- confound * g + sqrt(1 - confound^2) * rnorm(43) # intervention
4  pre <- g + rnorm(43, 0, 0.5) # growth before 1918
  post <- g + beta * x + rnorm(43, 0, 0.5) # growth after 1918
5  c(placebo = coef(lm(pre ~ x))[[2]], claimed = coef(lm(post ~ x))[[2]])
}))
avg <- sprintf("%.2f", colMeans(est))
cat("Average estimate: claimed effect ", avg[2], ", placebo (before 1918) ",
  avg[1], ", true effect ", beta, "\n",
  sep = ""
)

6boxplot(est,
  names = c("Placebo: before 1918", "Claimed: after 1918"),
  col = c("grey70", "#2166ac"), ylab = "Estimated effect"
)
abline(h = beta, lty = 2)
1
The page’s controls: the intervention’s true effect, and how correlated it is with the cities’ background growth.
2
Fixes the random numbers so the run is reproducible.
3
Cities that were already growing were likelier to adopt the intervention.
4
The placebo outcome: growth before the intervention, which it cannot have caused.
5
The claimed effect and the placebo estimate, from the same regression on each period.
6
The two estimates across 500 replications. The placebo finds the same effect, so the needle is just another needle.
# Looking for a needle in a pile of needles: a placebo test.
import numpy as np
import matplotlib.pyplot as plt

beta = 0.05     # true effect of the intervention
confound = 0.6  # correlation of the intervention with background growth
rng = np.random.default_rng(88)


def slope(x, y):
    return np.polyfit(x, y, 1)[0]


# 500 replications of a 43-city study
placebo, claimed = [], []
for _ in range(500):
    g = rng.normal(size=43)               # background growth of each city
    x = confound * g + np.sqrt(1 - confound ** 2) * rng.normal(size=43)
    pre = g + rng.normal(0, 0.5, 43)      # growth before 1918
    post = g + beta * x + rng.normal(0, 0.5, 43)  # growth after 1918
    placebo.append(slope(x, pre))
    claimed.append(slope(x, post))
print(f"Average estimate: claimed effect {np.mean(claimed):.2f}, placebo "
      f"(before 1918) {np.mean(placebo):.2f}, true effect {beta}")

plt.boxplot([placebo, claimed])
plt.xticks([1, 2], ["Placebo: before 1918", "Claimed: after 1918"])
plt.axhline(beta, color="black", linestyle="--")
plt.ylabel("Estimated effect")
plt.show()

Key takeaways

  • When confounding correlations dwarf the treatment effect, the estimate mostly measures the confounding.
  • Placebo tests on pre-treatment outcomes reveal the problem: the “treatment” predicts the past too.
  • More controls and robustness checks don’t help if the method can’t separate the needle from the pile.

Source

Back to top