Power and sample size for two groups

Find the number of participants per group needed to compare two means or two proportions, or the power you get with a given number.

Your data does not go to our server. This tool runs in your browser; what you type or open never leaves your device.

This calculator needs JavaScript, because it calculates in your browser and sends nothing. Turn JavaScript on to use it. How it is calculated is explained below.

How it is calculated

Enter the difference you want to detect and the power you want; the calculator returns the number per group, rounded up. If you enter a number per group instead, it returns the power you would have.

Plan for drop-outs: divide the result by the share of participants you expect to keep.

  • n per group = 2 × (z₁₋α/₂ + z₁₋β)² / d²
  • n per group = (z₁₋α/₂ + z₁₋β)² × [p₁(1 − p₁) + p₂(1 − p₂)] / (p₁ − p₂)²
  • power = Φ(d × √(n / 2) − z₁₋α/₂)

Worked example: Standardised difference 0.5, power 80 %, 95 % confidence: 63 participants per group.

Sources

These calculators support research; they do not replace the advice of a statistician or a clinician.

Questions

Why do my numbers differ slightly from other software?

This tool uses the normal approximation. Programs that use the t distribution give a result one or two participants higher for small samples.

All free tools

WhatsApp Tell the Editor
Submit manuscript Contact