Tool

Power and sample size calculator

Set-up

Test

Solve for

Baseline rate p₁
Target rate p₂

Target power: 80 %

Significance level

n = 3,993 · power = 0.800

You need 3,993 (sample size per group) to detect this effect with 80 % power.

The two worlds at the planned sample size, and the power curve At a sample size of 3,993, the test statistic's cut-offs are −1.96 and 1.96; if the effect is real, 0.800 of its distribution lies beyond them, which is the power. The power curve rises with the sample size and reaches 0.800 at 3,993. The test statistic at n = 3,993: if H₀ holds, and if the effect is real −1.96 1.96 H₀ true: no effect The effect is real α = 0.05 power = 0.800 Power against the sample size 0.0 0.2 0.4 0.6 0.8 1.002,5005,0007,50010,000Sample size per group (per arm) n = 3,993, power 0.800

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

  1. Baseline rate p₁

    0.34
  2. Target rate p₂

    0.37
  3. Cohen's h = 2 asin √p₂ − 2 asin √p₁

    0.0627
  4. α

    0.05
  5. Sample size, unrounded

    3992.093
  6. Rounded up

    3,993
  7. Power 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
The Excel lines are the normal approximation; the calculator and statsmodels use the exact non-central distributions.
An unhandled error has occurred. Reload 🗙

Reconnecting…

Your connection to Hypothesis Testing Lab dropped, probably a Wi-Fi blip. Hold on while it reconnects.

The connection could not be restored. The page will reload in a few seconds.