Hypothesis testing: p values, type I & type II errors
Hypothesis testing asks whether an observed difference is likely due to chance. The p value is the probability of a result at least as extreme if the null hypothesis were true. A type I error rejects a true null (false positive); a type II error misses a true difference (false negative).
Overview
- Null hypothesis (H0): no difference or association between groups.
- Alternative hypothesis (H1): a difference exists.
- Alpha: the significance level chosen before the study, usually 0.05.
- p value: the probability of obtaining the observed result (or one more extreme) if H0 is true.
If p is less than alpha, reject H0: the result is "statistically significant". If p is at least alpha, fail to reject H0 (never say "accept" or "prove" H0).
The 2 x 2 table of decisions
| Reality: H0 true (no difference) | Reality: H1 true (difference) | |
|---|---|---|
| Reject H0 | Type I error (alpha): false positive | Correct: power (1 - beta) |
| Fail to reject H0 | Correct (1 - alpha) | Type II error (beta): false negative |
Memory aid: type I = "seeing a difference that is not there" (the boy who cried wolf when there was no wolf); type II = "missing a difference that is there" (the villagers ignored a real wolf).
What p values do and do not mean
- p = 0.03 means: if there were truly no difference, a result this extreme would happen about 3% of the time.
- It does not mean there is a 3% chance the null hypothesis is true or a 97% chance the drug works.
- It says nothing about the size or clinical importance of the effect. Huge trials can show trivial differences with tiny p values.
- A nonsignificant p value in a small study may be a type II error (underpowered), not evidence of no effect.
Multiple comparisons
Testing many outcomes or subgroups increases the chance of a type I error. With 20 independent tests at alpha 0.05, about one "significant" result is expected by chance alone. Fixes: prespecify a single primary outcome, treat subgroup findings as hypothesis-generating, and use corrections such as Bonferroni (divide alpha by the number of tests: 20 tests, each tested at 0.0025).
One-tailed vs two-tailed tests
A two-tailed test looks for a difference in either direction and is standard. A one-tailed test looks in one direction only, making significance easier to reach; it is justified only when a difference in the other direction is impossible or irrelevant.
Worked example
A trial of 80 patients finds a new antihypertensive lowers systolic pressure 3 mm Hg more than placebo, p = 0.21. Conclusion: the difference is not statistically significant; we fail to reject H0. Because the sample was small, the trial may have been underpowered, so a true benefit cannot be excluded (possible type II error). The 95% CI (for example, -2 to 8 mm Hg) would show the range of plausible effects, including zero.
Statistical vs clinical significance
A large trial of 20,000 patients finds a drug lowers HbA1c by 0.05% (p below 0.001). This is statistically significant but clinically meaningless. Conversely, a small pilot study may show a large, clinically important effect that is not significant. Always look at the effect size and CI as well as the p value before changing practice.
🔥 Exam pearls
- Type I error = false positive = rejecting a true H0; probability = alpha.
- Type II error = false negative = failing to reject a false H0; probability = beta.
- Power = 1 - beta.
- p below 0.05 = statistically significant; this is not the same as clinically important.
- Multiple comparisons inflate type I error.
- Small negative trial: think type II error from low power.
