Calculator · deterministic
Sample size calculator for comparing two proportions
Comparing complication, success or response rates between two groups: per-arm n from p₁ and p₂.
Calculator
No AI, no sign-up — the arithmetic runs in the server-side deterministic solver, validated against G*Power and R pwr.
When to use it
For two independent groups with a binary outcome (event / no event): complication rates, treatment response, recurrence. If you are comparing two tests on the same patients, use the McNemar calculator instead.
Where the inputs come from
- p₁: from your own case mix or from publications with a similar population; cite the source.
- p₂: should reflect the difference worth detecting. Small absolute differences (30% → 25%) demand large samples — try it in the calculator and see.
Worked example
Suppose the expected complication rate is 30% with the control and 15% with the new technique. With two-sided α = 0.05 and 80% power the solver requires 121 per arm, 242 in total; at 20% attrition the recruitment target rises to 303. Halve the difference (30% → 22.5%) and the required sample roughly quadruples — the well-known brutality of proportion studies.
How to write it in the protocol
“For the primary outcome [event], the expected rates were p₁ = [value] and p₂ = [value] [with sources]. A two-proportion test with two-sided α = 0.05 and 80% power required [n] per arm; allowing [x]% attrition, the recruitment target was [N].”
Sources
- Cohen J. Statistical Power Analysis for the Behavioral Sciences, 2nd ed. Lawrence Erlbaum; 1988.
- Faul F, Erdfelder E, Lang A-G, Buchner A. G*Power 3: a flexible statistical power analysis program. Behav Res Methods. 2007;39:175–191.
- Champely S. pwr: Basic Functions for Power Analysis (R package).