Power and sample size calculator
Set-up
Test
Solve for
Significance level
n = 3,993 · power = 0.800
You need 3,993 (sample size per group) to detect this effect with 80 % power.
Plan an experiment before you run it: choose the test, the smallest effect worth acting on, α and the power you want, and the calculator solves for the sample size. Or fix the sample and solve for the power, or for the smallest effect this design would catch. The curve shows the power at every sample size; the two worlds show why.
The worked steps
Baseline rate p₁
0.34Target rate p₂
0.37Cohen's h = 2 asin √p₂ − 2 asin √p₁
0.0627α
0.05Sample size, unrounded
3992.093Rounded up
3,993Power at that sample size
0.800
Plan power before the data, for the smallest effect worth acting on; never compute it at the effect you observed.
The same in code
- Python (statsmodels)
NormalIndPower().solve_power(proportion_effectsize(0.37, 0.34), alpha=0.05, power=0.8, ratio=1)- Excel
=2*((NORM.S.INV(1-0.05/2)+NORM.S.INV(0.8))/0.0627)^2