What this is for: How many subjects per group to detect a chosen difference in means or proportions at your alpha and power, with dropout inflation.
The formula: n per group = 2 × ((z(α/2) + z(power)) × SD ÷ difference)² (two means)
How to use:
- For a continuous outcome, use the Two Means section: enter the smallest difference worth detecting and the SD from pilot data or the literature, then set alpha and power.
- Read n per group (rounded up) and total N; enter an expected dropout % to get the inflated n per group, or enter an available n per group to get the smallest difference it can detect.
- For a binary outcome, use the Two Proportions section: enter p1 and p2 as decimals (0.30 = 30%), then set alpha and power.
- Read n per group (rounded up) and total N for the proportions calculation.
Two Means — sample size for a two-sample comparison
Normal-approximation formula: n per group = 2 × ((za + zb) × SD / difference)². Enter the smallest difference worth detecting and the SD from pilot data or the literature.
B. Smallest detectable difference at fixed n
Two Proportions — sample size
Standard two-sided normal-approximation formula with the pooled variance under H0 for the alpha term. Enter proportions as decimals (0.30 = 30%).
Download the Sample Size & Power workbook (.xlsx)