Skip to main content

Sample Size and Power Calculator

Work out how many participants you need to estimate a percentage or a mean, or to compare two groups, or the power or precision of the sample you have. Each answer comes with a paragraph for your methods section or ethics form.

Calculator

Plan your sample

Your study
Outcome

One group, a yes-or-no answer: a prevalence survey, or the share of students who do something.

Find
Confidence level
%

From an earlier study or a pilot. If you only know it is between 10% and 90%, use 50.

± points

In percentage points: ±5 around 30% is 25% to 35%.

Optional
N

Only for a small, known population, such as one college's students.

Optional
×

For cluster sampling. A simple random sample is 1.

Optional
%

The share you expect to lose.

Enter the expected percentage and margin of error to see the sample size.

Worked example

A prevalence survey, with anaemia expected in about 30%

  1. 01p = 0.30, d = 0.05, z = 1.96 for 95% confidence
  2. 02n = 1.96² × 0.30 × 0.70 ÷ 0.05² = 322.7, rounded up to 323
  3. 03with 10% non-response: 323 ÷ 0.90 = 358.9, rounded up to 359

Invite 359 students, so that about 323 take part.

How it works

The reasoning behind it

To estimate a percentage or a mean, the question is precision. A sample's estimate lands near the true value but rarely on it, and the margin of error says how near: z standard errors either side. The standard error shrinks with the square root of the sample, so halving the margin takes four times as many people.

To compare two groups, two mistakes have to be kept rare: finding a difference that isn't there (the significance level, α, usually 0.05) and missing one that is (β; power is 1 − β, usually 80%). The sample grows with the square of zα + zβ and shrinks with the square of the effect size, the difference worth detecting divided by the standard deviation. Halving the difference quadruples the sample.

The answer is the number you need to finish with. Round it up, allow for the people who won't respond or will drop out, and say in your methods where the expected percentage or the standard deviation came from: an earlier study, a pilot, or an estimate you can defend.

Questions

Frequently asked

How do I calculate the sample size for a prevalence study?

Use Cochran's formula, n = z²p(1 − p) ÷ d², with p the prevalence you expect and d the margin of error, both as decimals. For an expected 30%, ±5 points and 95% confidence: 1.96² × 0.3 × 0.7 ÷ 0.05² = 322.7, so 323.

What expected percentage should I use if I don't know it?

Take it from an earlier study of a similar population, or run a small pilot. If you can only say it lies between 10% and 90%, use 50%: it gives the largest sample, 385 at ±5 points and 95% confidence. Below 10% or above 90%, 50% is not safe, because the margin there should be smaller.

Where do I get the standard deviation?

From a published study that measured the same thing in similar people, or from a pilot. If you only know the usual range of values, a quarter of it is a rough guide. Say in your methods where the figure came from.

What is statistical power, and why 80%?

Power is the chance that your study detects a difference that really exists. At 80%, one real difference in five would be missed. 80% is the usual minimum; 90% is common in clinical trials and needs about a third more participants.

Why does G*Power give a different answer?

For two means it shouldn't: both use the t-test itself, so an effect size of 0.5 at 80% power and the 0.05 level needs 64 per group in each. The textbook z formula gives 63. For two percentages, G*Power offers several tests. Fisher's exact test needs more than Fleiss's formula gives, so if you will analyse with it, use the continuity-corrected figure shown here.

How do I allow for dropout or non-response?

Divide by the share you expect to keep. For 323 with 10% non-response, 323 ÷ 0.9 = 358.9, so invite 359. Adding 10% instead gives 356, which is too few once 10% of them are lost.