Interactive demo · First-year statistics · Hypothesis testing

Power and sample size: two bell curves

A z-test of H0: μ = μ0 rejects when Z = (x̄ − μ0)/(σ/√n) passes the critical value. If H0 is true, Z follows the gold bell curve; if the true mean is d standard deviations away from μ0, Z follows the teal curve, shifted by √n·d. Gold area: α, the false-alarm rate. Teal area: the power. Pink area: β, the chance of missing a real effect. The bottom panel traces the power for every effect size. Nothing is simulated: every number is computed exactly.

Effect size d = (μ − μ0)/σ

0.50

Sample size n

25

Significance level α

Test

Target power

Scoreboard

Try these

Neyman–Pearson: among all tests whose false-alarm rate is α, the one-sided z-test has the highest power at every d > 0, so no test can lift the teal curve in the bottom panel (Theorem 6.1). Not knowing σ costs a little power: the dashed blue t-test curve sits just below.

In the lecture notes