Data analysis

Sample size and power

Pick your study question. The tool picks the method, explains why, and gives you the number plus a sentence for your protocol.

1What do you want to do?

2Choose your study question

Not sure which to pick? Answer two questions

3Enter your assumptions

0.05 is the standard. Lower is stricter.

Chance of finding the effect if it is real. 80% is the usual minimum; 90% is safer.

Alpha: recommended range and why it matters

Recommended: 0.05 for most clinical studies. Use 0.01 when you test many outcomes or a wrong claim would be costly. 0.10 is only for early pilot work.

Why it matters: alpha is the chance you declare an effect that is not real. Going from 0.05 to 0.01 raises the sample size by roughly 50%.

Power: recommended range and why it matters

Recommended: 80% is the accepted minimum. Choose 90% for pivotal trials or when missing a real effect would be costly.

Why it matters: power is the chance you find the effect when it is real. Moving from 80% to 90% raises the sample size by about 34%.

Extra people you enrol to cover losses. Typical: 10 to 20.

%
Recommended range and why it matters

Recommended: 10 to 15% for short studies, 20 to 30% for long follow-up or hard-to-retain patients.

Why it matters: the tool divides by (1 minus dropout). With 20% dropout you multiply by 1.25, not 1.20.

Advanced options (multiple tests, cluster trials)

1 for a single primary outcome. If you test several, alpha is divided by this number (Bonferroni), which raises the sample size.

Leave at 1 unless you randomise whole clinics, wards or villages.

How alike patients in the same cluster are. Clinical studies often use 0.01 to 0.05. The sample size is multiplied by 1 + (cluster size - 1) x ICC.

1 means equal groups. Use 2 for twice as many treatment as control patients. This works for the two-means and non-inferiority designs only. Unequal groups need more patients in total: 2:1 needs about 12% more than 1:1.

Your result

Choose your study question, enter your assumptions and press Calculate. The sample size, a plain-language reading and a sentence for your protocol appear here.

Independent checks run on these calculators

Each case below is 80% power, alpha 0.05. "Simulated power" is the share of simulated studies (20,000 runs; 4,000 for correlation, 2,000 for logistic regression, 10,000 for the cluster rows, 4,000 for the survival rows, 20,000 for the diagnostic rows) that reached significance at the sample size this tool gives. Simulation and reference values came from Python (statsmodels, scipy), not from G*Power.

Design (inputs)This toolCheck
Two means (SD 10, difference 5)64 per groupstatsmodels t-test: 63.8
Paired (SD 8, change 4)34statsmodels paired t-test: 33.4
Two proportions (30% vs 15%)121 per groupstatsmodels arcsine method: 118.6; simulated power 81.1%
Correlation (r 0.3)85Simulated power 80.7%
McNemar (20% vs 10% discordant)234Simulated power 80.9%
Non-inferiority, means (SD 10, margin 4)99 per groupSimulated power 80.2%
Non-inferiority, proportions (80% vs 80%, margin 10 points)252 per groupSimulated power 80.1%
Logistic regression (odds ratio 1.5 per SD, 20% at the mean)299Simulated power 79.4%
Two means with 3 tests (alpha divided by 3)86 per groupSimulated power 80.5%
Two means, 2:1 allocation48 control, 96 treatmentSimulated power 80.2%
Cluster adjustment (10 per cluster, ICC 0.05), 10 clusters per armPredicts 83.6% powerSimulated power 79.0%
Cluster adjustment, 15 clusters per armPredicts 94.9% powerSimulated power 94.0%
Survival with accrual (median 12 months, HR 0.7, accrual 24, follow-up 12)370 patientsSimulated trials, log-rank test: 79.3%
Survival with accrual (median 6 months, HR 0.6, accrual 12, follow-up 6)188 patientsSimulated trials, log-rank test: 79.2%
Simple survival (HR 0.65, 50% of patients with the event)339 patientsSimulated trials, log-rank test: 80.8%
Small samples: two means, effect of 1.0 and 1.5 SDs17 and 8 per groupstatsmodels exact t-test: 16.7 and 8.1
Small samples: paired, effect of 1.0 and 1.5 SDs10 and 6statsmodels exact paired t-test: 9.9 and 5.7
Diagnostic accuracy (sens 90%, spec 85%, prevalence 20%, margin 5 points)692 patientsMean half-width of the sensitivity interval 4.96 points; 52% of studies at or under the margin
Diagnostic accuracy (sens 97%, spec 96%, prevalence 20%, margin 3 points)622 patientsSimple interval covers the true sensitivity 88.2% of the time; Wilson interval 95.5%

Cluster caution: the adjustment is a little optimistic when there are few clusters (about 4 points of power at 10 clusters per arm), so aim for at least 15 clusters per arm. Survival note: the accrual calculator landed about 1 point under 80% in both simulated cases, which is within about 1.3 standard errors of simulation noise. Small-sample note: for groups under about 10 the tool can be one patient short of the exact answer (two means with an effect of 1.5 SDs: exact 8.1, tool 8), so add one. Diagnostic note: the margin is a target for the average interval width, so about half of real studies will be slightly wider, and near 100% accuracy you should analyse with Wilson or exact intervals. Still open: a comparison with G*Power or R output. The proportions result differs slightly from the arcsine reference because the two use different formulas.

Sources used for the formulas
Hsieh FY, Bloch DA, Larsen MD. A simple method of sample size calculation for linear and logistic regression. Stat Med. 1998;17(14):1623-1634. doi:10.1002/(SICI)1097-0258(19980730)17:14<1623::AID-SIM871>3.0.CO;2-S
Schoenfeld DA. Sample-size formula for the proportional-hazards regression model. Biometrics. 1983;39(2):499-503. doi:10.2307/2531021
Buderer NM. Statistical methodology: I. Incorporating the prevalence of disease into the sample size calculation for sensitivity and specificity. Acad Emerg Med. 1996;3(9):895-900. doi:10.1111/j.1553-2712.1996.tb03538.x
The means, proportions, paired and correlation formulas are standard textbook large-sample formulas. Add DOI-checked citations for them before you cite this tool in a manuscript. Results are estimates for planning. Confirm with a statistician for regulatory or high-stakes trials.
Version 1.0, October 2026.
Datathrob. Clinical research made simple.