Random in
Noise and evidence
Law or aphorism
Intermediate
Random out.
What it is
A version of “garbage in, garbage out.” When the data are mostly noise, any conclusion drawn from them, whether a significant predictor, an interesting subgroup or a surprising interaction, is mostly noise too. Run the same analysis on a fresh draw of the same kind of data and you get a different conclusion. The method didn’t fail. It faithfully turned random input into random output.
Why it matters
Each noisy dataset yields some pattern, and the researcher reports it with all the trappings of a finding. Readers see one realization and can’t tell it apart from a robust result. The tell-tale sign is instability: different samples, different years or different research groups get different “findings.” A literature full of inconsistent results on the same question is often random-in, random-out.
How it works
Regress an outcome on \(K\) candidate predictors, none of which has any real effect. In each dataset, about \(0.05K\) predictors will be “significant,” and they will be different ones each time. If you report the significant ones and tell a story about them, the story changes with every new sample.
Simulated example
There are ten candidate predictors, all with zero true effect, and the analysis is repeated on 25 independent datasets. Each row of the grid is one dataset, and filled cells are the predictors that came out “significant.”
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, ols} from "../js/stats.js"
viewof n = Inputs.range([30, 500], {value: 80, step: 10, label: "Observations per dataset"})
viewof realEffect = Inputs.range([0, 0.5], {value: 0, step: 0.05, label: "True effect of predictor #1 (others zero)"})
viewof seed = Inputs.range([1, 500], {value: 79, step: 1, label: "Random seed"})
grid = {
const r = rng(seed);
return range(25).flatMap(rep => {
const X = range(n).map(() => r.normals(10));
const y = X.map(x => realEffect * x[0] + r.normal());
const f = ols(X, y);
return range(10).map(j => ({rep: rep + 1, pred: `x${j + 1}`, sig: Math.abs(f.coef[j + 1] / f.se[j + 1]) > 1.96, est: f.coef[j + 1]}));
});
}
Plot.plot({
ariaLabel: "Random in: simulation chart",
ariaDescription: "Horizontal axis: Predictor. Vertical axis: Dataset (replication). The chart updates with the controls above it, and the summary below the charts states the result in words.",
height: 380,
x: {label: "Predictor", domain: range(10).map(j => `x${j + 1}`)},
y: {label: "Dataset (replication)", reverse: true},
marks: [Plot.cell(grid, {x: "pred", y: "rep", fill: d => d.sig ? (d.est > 0 ? "#2166ac" : "#d6604d") : "#f0f0f0", inset: 1})]
})# Random in, random out: regressions on pure noise still find "effects".
1n <- 80 # observations per dataset
real_effect <- 0 # true effect of predictor 1 (the others are zero)
2set.seed(79)
# 25 datasets, each a regression of y on 10 predictors
sig <- t(replicate(25, {
3 X <- matrix(rnorm(n * 10), n)
y <- real_effect * X[, 1] + rnorm(n)
tab <- summary(lm(y ~ X))$coefficients[-1, ]
4 abs(tab[, 1] / tab[, 2]) > 1.96
}))
cat(sum(rowSums(sig) > 0), " of 25 datasets have at least one ",
"'significant' predictor\nPredictor 1 is significant in ",
sum(sig[, 1]), " of 25\n",
sep = ""
)
5image(1:10, 1:25, t(sig),
col = c("grey90", "#d6604d"),
xlab = "Predictor", ylab = "Dataset"
)- 1
- The page’s controls: observations per dataset and the true effect of the first predictor (the rest are zero).
- 2
- Fixes the random numbers so the run is reproducible.
- 3
- Ten predictors that are pure noise.
- 4
- Which predictors come out significant in each dataset.
- 5
- A grid of 25 datasets by 10 predictors. Something is significant in most datasets, and it is a different something each time.
# Random in, random out: regressions on pure noise still find "effects".
import numpy as np
import matplotlib.pyplot as plt
n = 80 # observations per dataset
real_effect = 0 # true effect of predictor 1 (the others are zero)
rng = np.random.default_rng(79)
# 25 datasets, each a regression of y on 10 predictors
sig = np.zeros((25, 10), dtype=bool)
for rep in range(25):
X = np.column_stack([np.ones(n), rng.normal(size=(n, 10))])
y = real_effect * X[:, 1] + rng.normal(size=n)
beta, *_ = np.linalg.lstsq(X, y, rcond=None)
s2 = np.sum((y - X @ beta) ** 2) / (n - 11)
se = np.sqrt(s2 * np.diag(np.linalg.inv(X.T @ X)))
sig[rep] = np.abs(beta / se)[1:] > 1.96
print(f"{np.sum(sig.any(axis=1))} of 25 datasets have at least one "
f"'significant' predictor\nPredictor 1 is significant in "
f"{sig[:, 0].sum()} of 25")
plt.imshow(sig, cmap="Reds", aspect="auto", vmin=0, vmax=1.5,
extent=[0.5, 10.5, 25.5, 0.5])
plt.xlabel("Predictor")
plt.ylabel("Dataset")
plt.show()Key takeaways
- Noisy data produce findings that change with every sample.
- Instability across replications is the signature of random-in, random-out.
- Look for consistency across datasets before trusting any single pattern.
Source
- Andrew Gelman, Random patterns in data yield random conclusions (2019).