Worked examples
- 142 per group, SD 15 mmHg, difference 5 mmHg, α = 0.05: 80.2% power.
- 294 per group, 30% versus 20%, α = 0.05: 80.1% power.
- 100 per group, SD 15, difference 5: 65.4% power, short of the usual 80%.
The formulas
Two means: power = Φ(|Δ|/SE − z₁₋α/₂) + Φ(−|Δ|/SE − z₁₋α/₂), with SE = σ√(1/n₁ + 1/n₂). Two proportions: the same, with the standard error under no difference from the pooled proportion and the standard error under the alternative from p₁ and p₂ (Fleiss, Levin & Paik). Both tails are counted, as in statsmodels.
Questions
- What power should a study have?
- At least 80%, and 90% for a definitive trial. With 80% power a study misses a real effect of the stated size one time in five.
- Can I calculate power after the study is finished?
- You can, but power calculated from the observed effect adds nothing to the p-value. Report the confidence interval instead, which shows which effects the data rule out.
- My study has fixed numbers. What can it detect?
- For means, the calculator shows the smallest difference detectable with 80% power. For example, 100 people per group with an SD of 15 can detect a difference of about 5.9 with 80% power.
Also free: the sample size calculator and the study design chooser.