That narrow beach
Thinking about statistics
Principle or heuristic
Introductory
Where statistics lives, this zone of phase transition between the continent of clear effects and the sea of confusion.
What it is
Picture a continent of clear effects, where the signal is so strong you don’t need statistics (smoking and lung cancer at the population level, gravity), and a sea of confusion, where the signal is so weak that no analysis can extract it. Between them is a narrow beach, a phase transition where careful statistical analysis makes the difference between learning and not learning. That’s where statistics lives.
Why it matters
The image explains both the power and the limits of statistics. Good methods, such as partial pooling, careful measurement and sound design, move what can be learned a little way into the sea, which is valuable. But no method turns noise into signal. Researchers who wade out into the sea and claim discoveries are fooling themselves, and those who apply heavy machinery on the continent are wasting effort.
How it works
Compare two analysts deciding whether an effect is positive. One eyeballs the data. The other uses a proper statistical analysis. As the signal-to-noise ratio (SNR) rises, both approach 100% accuracy. As it falls, both drop toward 50%, a coin flip. The gap between them, the value added by statistics, is largest in a narrow band of intermediate SNR. That band is the beach.
Simulated example
Many decisions at various signal-to-noise ratios. Compare the eyeball analyst with the statistical analyst, and find the beach.
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 n = debounce(Inputs.range([5, 200], {value: 30, step: 5, label: "Observations per decision"}))
viewof seed = debounce(Inputs.range([1, 500], {value: 135, step: 1, label: "Random seed"}))
beach = {
const r = rng(seed);
return range(25).map(k => {
const snr = 10 ** (-2 + k * 0.125);
let eye = 0, stat = 0;
for (let i = 0; i < 600; i++) {
const sign = r() < 0.5 ? 1 : -1, y = r.normals(n, sign * snr, 1);
// Eyeball: look at a handful of points (the first 3) and go with their median sign.
const glance = y.slice(0, 3).sort((a, b) => a - b)[1];
eye += Math.sign(glance) === sign;
stat += Math.sign(mean(y)) === sign;
}
return {snr, eye: eye / 600, stat: stat / 600, gap: (stat - eye) / 600};
});
}
Plot.plot({
ariaLabel: "That narrow beach: simulation chart",
ariaDescription: "Horizontal axis: Signal-to-noise ratio (effect / sd per observation). Vertical axis: Accuracy deciding the sign. The chart updates with the controls above it, and the summary below the charts states the result in words.",
height: 300,
x: {type: "log", label: "Signal-to-noise ratio (effect / sd per observation)"},
y: {label: "Accuracy deciding the sign", domain: [0.4, 1], tickFormat: "%", grid: true},
color: {legend: true, domain: ["Eyeballing", "Statistical analysis", "Value added (the beach)"], range: ["#8a8a8a", "#2166ac", "#b8860b"]},
marks: [
Plot.areaY(beach, {x: "snr", y1: "eye", y2: "stat", fill: () => "Value added (the beach)", fillOpacity: 0.35}),
Plot.line(beach, {x: "snr", y: "eye", stroke: () => "Eyeballing", strokeWidth: 2}),
Plot.line(beach, {x: "snr", y: "stat", stroke: () => "Statistical analysis", strokeWidth: 2})
]
})# That narrow beach: where statistics beats eyeballing the data.
1n <- 30 # observations per decision
2set.seed(135)
# For each signal-to-noise ratio, 600 decisions about the sign of an effect
3snr <- 10^(-2 + 0:24 * 0.125)
res <- t(sapply(snr, function(s) {
hits <- replicate(600, {
sign <- if (runif(1) < 0.5) 1 else -1
y <- rnorm(n, sign * s, 1)
4 glance <- median(y[1:3]) # eyeball: a quick look at 3 points
c(eye = sign(glance) == sign, stat = sign(mean(y)) == sign)
})
rowMeans(hits)
}))
5gap <- res[, "stat"] - res[, "eye"]
cat("Statistics helps most at signal/noise ", signif(snr[which.max(gap)], 2),
": ", round(100 * res[which.max(gap), "stat"]), "% right vs ",
round(100 * res[which.max(gap), "eye"]), "% by eye\n",
sep = ""
)
6matplot(snr, res,
type = "l", lty = 1, lwd = 2, log = "x",
col = c("#d6604d", "#2166ac"), ylim = c(0.5, 1),
xlab = "Signal-to-noise ratio", ylab = "Share of correct decisions"
)
legend("topleft", c("Eyeball", "Statistics"),
col = c("#d6604d", "#2166ac"), lwd = 2, bty = "n"
)- 1
- The page’s control: observations per decision.
- 2
- Fixes the random numbers so the run is reproducible.
- 3
- Signal-to-noise ratios from hopeless to obvious.
- 4
- Eyeballing: a quick look at three points. Statistics: the mean of all n.
- 5
- How much statistics adds, at each ratio.
- 6
- Both methods’ accuracy. At the left nothing works; at the right anyone can see it; statistics matters only on the narrow beach between.
# That narrow beach: where statistics beats eyeballing the data.
import numpy as np
import matplotlib.pyplot as plt
n = 30 # observations per decision
rng = np.random.default_rng(135)
# For each signal-to-noise ratio, 600 decisions about the sign of an effect
snr = 10 ** (-2 + np.arange(25) * 0.125)
eye, stat = [], []
for s in snr:
sign = np.where(rng.uniform(size=600) < 0.5, 1, -1)
y = rng.normal(sign[:, None] * s, 1, (600, n))
glance = np.median(y[:, :3], axis=1) # eyeball: a quick look at 3 points
eye.append(np.mean(np.sign(glance) == sign))
stat.append(np.mean(np.sign(y.mean(axis=1)) == sign))
eye, stat = np.array(eye), np.array(stat)
k = np.argmax(stat - eye)
print(f"Statistics helps most at signal/noise {snr[k]:.2g}: "
f"{100 * stat[k]:.0f}% right vs {100 * eye[k]:.0f}% by eye")
plt.semilogx(snr, eye, color="#d6604d", linewidth=2, label="Eyeball")
plt.semilogx(snr, stat, color="#2166ac", linewidth=2, label="Statistics")
plt.ylim(0.5, 1)
plt.xlabel("Signal-to-noise ratio")
plt.ylabel("Share of correct decisions")
plt.legend()
plt.show()Key takeaways
- Statistics matters most in a narrow band between obvious and hopeless.
- Better methods move the beach a bit. They don’t drain the sea.
- Claims of discoveries from deep in the sea of noise deserve skepticism.