Making errors is inevitable
How science behaves
Law or aphorism
Introductory
Learning from them is not.
What it is
The line comes from Gelman’s Chance column “Honesty and Transparency Are Not Enough”, near the end of an argument about the replication crisis. Some unreplicable research involves ethical violations, he writes, and “it is poor behavior for them to refuse to admit they could ever have been wrong—but we can also make mistakes in good faith. Making errors is inevitable; learning from them is not. To learn from errors, we want a system of science that facilitates and provides incentives for such learning; we don’t want an attitude that automatically links error to secrecy or dishonesty.”
Errors will happen no matter what. Learning from them takes deliberate effort. Learning needs an error to be detected, acknowledged and traced to a cause that can be fixed, and each step can fail. A field, lab or person that doesn’t build systems for these steps will keep making the same errors indefinitely.
Why it matters
Individuals who want to learn from mistakes (see Mistakes) can still be blocked by institutions that hide errors. Journals rarely publish corrections, labs don’t log failures, and careers punish admissions. Under those conditions, learning is not automatic, even among well-meaning people. Error-reporting systems, code review, replication and blameless post-mortems are what turn inevitable errors into improvement.
How it works
A toy model of a field. Errors happen at rate \(e_t\). Each one is detected with probability \(d\) and, if detected, reported openly with probability \(q\). Only openly reported errors lead to a fix that lowers the future error rate, which spreads to everyone. Learning per period is about \(e_t \cdot d \cdot q \cdot \ell\). If \(d \cdot q\) is small, the error rate stays where it was, whatever \(\ell\) is.
Simulated example
A field produces 100 analyses a year for 30 years. Vary detection and open reporting, and watch whether the field’s error rate falls.
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, pct} from "../js/stats.js"
viewof detect = Inputs.range([0, 1], {value: 0.5, step: 0.05, label: "Pr(error is detected)"})
viewof report = Inputs.range([0, 1], {value: 0.2, step: 0.05, label: "Pr(detected error is reported openly)"})
viewof seed = Inputs.range([1, 500], {value: 136, step: 1, label: "Random seed"})
fieldLearn = {
const r = rng(seed);
const run = (q, label) => {
let rate = 0.2;
return range(31).map(y => {
const row = {y, label, rate};
let lessons = 0;
for (let i = 0; i < 100; i++) if (r() < rate && r() < detect && r() < q) lessons++;
rate = Math.max(0.01, rate * Math.pow(0.97, lessons));
return row;
});
};
return [...run(report, "Your setting"), ...run(1, "Every detected error reported"), ...run(0, "Errors hidden")];
}
Plot.plot({
ariaLabel: "Making errors is inevitable: simulation chart",
ariaDescription: "Horizontal axis: Year. Vertical axis: Field's error rate. The chart updates with the controls above it, and the summary below the charts states the result in words.",
height: 280,
x: {label: "Year"},
y: {label: "Field's error rate", domain: [0, 0.22], tickFormat: "%", grid: true},
color: {legend: true, domain: ["Your setting", "Every detected error reported", "Errors hidden"], range: ["#2166ac", "#1a9850", "#d6604d"]},
marks: [Plot.line(fieldLearn, {x: "y", y: "rate", stroke: "label", strokeWidth: d => d.label === "Your setting" ? 3 : 1.5})]
})# Making errors is inevitable; learning from them is not.
1detect <- 0.5 # probability an error is detected
report <- 0.2 # probability a detected error is reported openly
2set.seed(136)
3run <- function(q) { # error rate over 30 years, 100 analyses a year
rate <- 0.2
path <- rate
for (y in 1:30) {
4 lessons <- sum(runif(100) < rate & runif(100) < detect &
runif(100) < q)
5 rate <- max(0.01, rate * 0.97^lessons) # each shared lesson helps
path <- c(path, rate)
}
path
}
paths <- cbind(yours = run(report), all_reported = run(1), hidden = run(0))
cat("Error rate after 30 years (%):\n")
print(round(100 * paths[31, ], 1))
6matplot(0:30, paths,
type = "l", lty = 1, lwd = 2,
col = c("#2166ac", "#1a9850", "#d6604d"), ylim = c(0, 0.22),
xlab = "Year", ylab = "Share of analyses with an error"
)
legend("topright", c(
"Your setting", "Every detected error reported",
"Errors hidden"
),
col = c("#2166ac", "#1a9850", "#d6604d"), lwd = 2, bty = "n"
)- 1
- The page’s controls: the chance an error is detected, and the chance a detected error is reported openly.
- 2
- Fixes the random numbers so the run is reproducible.
- 3
- Thirty years of 100 analyses, under a given probability of open reporting.
- 4
- A lesson is learned only when an error happens, is detected and is shared.
- 5
- Each shared lesson lowers the field’s error rate a little.
- 6
- The error rate over time under your setting, with full reporting, and with errors hidden. Errors happen in all three; learning happens in two.
# Making errors is inevitable; learning from them is not.
import numpy as np
import matplotlib.pyplot as plt
detect = 0.5 # probability an error is detected
report = 0.2 # probability a detected error is reported openly
rng = np.random.default_rng(136)
def run(q): # error rate over 30 years, 100 analyses a year
rate, path = 0.2, [0.2]
for _ in range(30):
u = rng.uniform(size=(3, 100))
lessons = np.sum((u[0] < rate) & (u[1] < detect) & (u[2] < q))
rate = max(0.01, rate * 0.97 ** lessons) # each shared lesson helps
path.append(rate)
return path
paths = {"Your setting": run(report), "Every detected error reported": run(1),
"Errors hidden": run(0)}
for (k, p), c in zip(paths.items(), ["#2166ac", "#1a9850", "#d6604d"]):
print(f"{k}: {100 * p[-1]:.1f}% after 30 years")
plt.plot(p, color=c, linewidth=2, label=k)
plt.ylim(0, 0.22)
plt.xlabel("Year")
plt.ylabel("Share of analyses with an error")
plt.legend()
plt.show()Key takeaways
- Errors are certain. Learning from them needs detection, acknowledgement and diagnosis.
- Institutions decide whether errors become lessons or get buried.
- Build systems such as reviews, logs and open corrections that make learning routine.
Source
- Andrew Gelman, “Honesty and transparency are not enough”, Chance 30(1), 37–39 (2017), doi:10.1080/09332480.2017.1302720.