Sample size calculator
Work out how many people a study needs to find an effect of the size you expect, or the power a number of people gives. For a t-test between two groups, the same people measured twice, or one group against a set value.
The calculator runs in your browser. It works out power from the noncentral t distribution, as R's pwr package does.
Work out a sample size
64 people in each group, 128 in all, for 80% power. With 64 in each group, power is 80.1%.
People in each group for common effect sizes
| d | Cohen's name | 80% power | 90% power |
|---|---|---|---|
| 0.2 | Small | 394 | 527 |
| 0.3 | 176 | 235 | |
| 0.5 | Medium | 64 | 86 |
| 0.8 | Large | 26 | 34 |
Two groups, a two-sided test, α = 0.05. For the same people twice, or one group, d = 0.5 needs 34 people for 80% power.
What each setting means
| Setting | What it is | Usual choice |
|---|---|---|
| Effect size (Cohen's d) | The difference you expect, in standard deviations: the difference between the means divided by the SD. For the same people twice, it is dz: the mean of the differences divided by their SD, which is not a two-group d. | From earlier studies or a meta-analysis, or the smallest difference that would matter |
| Significance level (α) | The chance of finding an effect when there is none. | 0.05 |
| Power | The chance of finding the effect if it is real. One minus the power is the chance of missing it. | 80% or 90% |
| Test | Two-sided finds a difference either way. One-sided looks only in the direction you set before the data come in. | Two-sided |
Allow for people who leave
Divide by the share you expect to finish. For d = 0.5 at 80% power, with 10% expected to leave: 64 ÷ 0.9 = 71.1, so recruit 72 in each group.
How the calculator works
Power is the chance that the t statistic passes the test's critical value when the effect is real. That chance comes from the noncentral t distribution, with these degrees of freedom and noncentrality for n people in each group, or n people:
| Design | Degrees of freedom | Noncentrality |
|---|---|---|
| Two groups | 2n − 2 | d × √(n ÷ 2) |
| The same people twice, or one group | n − 1 | d × √n |
The calculator gives the smallest whole number of people whose power reaches the one you chose. For d = 0.5 at 80% power, R's pwr.t.test gives 63.77 people in each group, which rounds up to the calculator's 64.
Sample sizes in ConductExperience
- A link's Most people, up to 10,000, stops it taking people after that many, so it can close at the number you work out here.
- A group's Limit is the most people it takes. Balanced assignment keeps the groups in proportion to their weights as people join, so groups of equal weight stay within one person of each other.
- Results gives each number, slider and line scale question, and each score, its n, mean and SD, and filters by group: the figures for the next study's effect size.
Limits
- t-tests only. It does not work out sample sizes for proportions, analysis of variance, regression or correlations.
- Two groups of the same size.
- It assumes scores that are roughly normal, with the same SD in each group.
- The answer is only as good as the effect size you type. A smaller true effect needs more people.
Source
Cohen, J. (1988). Statistical power analysis for the behavioral sciences (2nd ed.). Lawrence Erlbaum Associates.
Related
Effect size calculator
Cohen's d and Hedges' g with their intervals, from two groups' means and SDs.
Random assignment generator
Assign people to groups at random, balanced or simple random.
Between and within subjects
When to compare groups of people, and when each person does every condition.
Study builder
Groups, sections and parts in fixed, shuffled or counterbalanced orders.
Planning a study?
Start one now, or tell us what you want to measure.