The idea
Hypothesis testing is proof by statistical contradiction. Assume the boring world — the null hypothesis (no effect, no difference) — and ask how surprising your data would be in that world. Surprising enough, and you reject the boring world in favor of the alternative .
The measure of surprise is the p-value:
Every word carries weight. Given : the calculation lives entirely in the null world; it says nothing directly about whether is true. At least as extreme: it is a tail probability, not the probability of your exact data. The standard recipe:
-
State and , and pick (the false positive rate you will tolerate — 0.05 by convention, not by law) before looking.
-
Compute a test statistic whose distribution under is known — usually via the CLT. For two proportions:
-
Convert to a p-value; reject if .
The error vocabulary: Type I () — reject a true null; Type II () — miss a real effect; power — the probability of catching a real effect of a given size.
The traps — this is what interviews actually test:
- is not . Reversing the conditional needs a prior (Bayes). In a world where most tested ideas are duds, most results can still be false positives.
- is not evidence of no effect — it may just be low power. Report the confidence interval; "CI spans zero and everything we care about" means "inconclusive", not "null confirmed".
- is not the probability the effect is real.
- Significance is not importance: with in the millions, trivial effects become significant; with in the dozens, important effects do not.
- The guarantee holds only for the procedure as pre-registered: one look, one metric, one comparison. Peeking, metric shopping, and subgroup mining silently multiply .
Worked example
A/B test on conversion. Control: 500/5,000 = 10%. Treatment: 550/5,000 = 11%.
Pooled rate: .
Two-sided : fail to reject. The right conclusion is not "the treatment does nothing" — the 95% CI for the lift is roughly percentage points, which contains both zero and a lift that would be a clear business win. The experiment was underpowered for a 1-point effect (it had roughly 37% power); it needed about 15,000 users per arm to detect that lift reliably at 80% power. The honest verdict: inconclusive, and the fix is sample size, not narrative.
Cheat sheet
- p-value: . Small → data implausible under .
- Two-proportion z: pooled , .
- One-sample mean: with df; use when is small, is fine for large .
- Critical values (two-sided): (10%), (5%), (1%).
| Error | Meaning | Rate | Reduce by |
|---|---|---|---|
| Type I | reject true null | lower | |
| Type II | miss real effect | more , bigger effect, less variance, higher |
Trap table:
| Claim | Verdict |
|---|---|
| "p = 0.03 → 3% chance the null is true" | wrong — needs a prior; conditions on |
| "p = 0.06 → no effect" | wrong — possibly just underpowered; check the CI |
| "significant → matters" | wrong — check effect size vs practical threshold |
| "we saw p < 0.05 after checking daily" | invalid — peeking inflates several-fold |
| "alpha = 0.05 → only 5% of our wins are false" | wrong — that is FDR, which depends on prior and power |
- False discovery intuition: 1,000 tests, 10% real effects, power 0.8 → true positives ; false positives ; so 36% of "wins" are false even with everything done correctly.
- Fix , the metric, the test, and the stopping rule before launch; everything after that is the domain of multiple-testing corrections.