Sample Size and Power Calculator

Work out how many cases a study needs, the power a planned sample gives, or the smallest effect it can detect: t tests, proportions, ANOVA, regression, and survey margins of error.

What this calculator does

The Sample Size and Power Planner is Module 7 of Analysis Studio. It answers the three planning questions every study has to settle before data collection starts:

  • Given an effect worth detecting, a significance level, and a target power, how many cases does the study need?
  • Given a sample size that budget or fieldwork allows, what power does the study actually have?
  • Given a sample size and a power target, what is the smallest effect the study can reliably detect?

The planner covers one-sample, paired, and two-sample t tests; one and two proportions; one-way ANOVA; correlation; multiple regression, including a test of R squared change; chi-square tests; logistic regression; and survey margins of error with finite population corrections, design effects, and response-rate adjustments. Cluster samples are handled through the standard design effect formula, and stratified allocation can be proportional, Neyman, or cost-optimal. A pilot dataset can supply standard deviations, proportions, or an intraclass correlation, and the module accepts typed planning values with no data file loaded at all.

The planner is a free module. It runs on screen at no cost, with no account. Downloads and Copy Results are part of the subscription.

The method, in plain terms

Power is the probability that a study detects an effect of a stated size, if that effect is really there. Four quantities lock together: the effect size, the significance level (alpha), the sample size, and the power. Fix any three and the fourth is determined. The planner solves for whichever one you leave open, using the same distributions the analysis itself will use: the noncentral t distribution for t tests, the noncentral F for ANOVA and regression tests, and the normal approximation with exact binomial checks where proportions are involved.

For two independent groups of equal size, the working formula behind the t test calculation is:

n per group solves: power = P(reject the null hypothesis when the true standardized difference is d), computed from the noncentral t distribution with 2n − 2 degrees of freedom and noncentrality d × √(n/2).

For a survey proportion, the planning formula is the margin of error turned around:

n = z² × p × (1 − p) ÷ (margin of error)², then adjusted by the design effect, the finite population correction, and the expected response rate.

Worked example one: a two-group comparison

A researcher wants to compare a continuous outcome between two groups and judges a medium standardized difference, Cohen d of 0.5, worth detecting. Alpha is 0.05, two-sided. Target power is 0.80.

The exact solution from the noncentral t distribution is n = 63.77 per group. Sample sizes are whole people, so the plan rounds up:

  • Required per group: 64
  • Required in total: 128
  • Power at 64 per group: 0.8015, just above the target, because rounding up buys a little

The same screen shows the cost of trimming the plan. At 50 per group, power falls to 0.6969. A study fielded at 50 per group misses a true medium effect roughly three times in ten, and the planner makes that trade visible before the money is spent rather than after the results disappoint.

Worked example two: a survey margin of error

A survey needs a margin of error of plus or minus five points at 95 percent confidence, planned at the worst-case proportion of 0.5:

n = 1.96² × 0.5 × 0.5 ÷ 0.05² = 384.16, so 385 completed responses.

  • At 400 completed responses, the margin of error is plus or minus 4.9 points.
  • At 1,000 completed responses, it is plus or minus 3.1 points.
  • If the design carries a design effect of 1.5 from weighting or clustering, the 385 becomes 577 completed responses for the same precision.
  • If the expected response rate is 25 percent, the field sample for 577 completes is 2,308 invitations.

When the planner fits, and when it does not

It fits when:

  • The study design is one of the covered procedures, and the analysis will use the same test the plan assumed.
  • Planning values come from a pilot, from published work, or from a stated smallest effect worth detecting.
  • A survey plan needs design effects, finite population corrections, or response-rate inflation handled in the open rather than in a spreadsheet margin note.

It does not fit when:

  • The analysis is a mixed-effects model, a survival model, or another procedure outside the covered list. Those designs need simulation-based planning, which this module does not claim to do.
  • The effect size is copied from a small pilot with no judgment applied. Small pilots overestimate effects, and a plan built on an inflated effect is underpowered on arrival.
  • The study has a fixed sample and no decision depends on the result. A power calculation after the fact adds nothing.

Run it

Module 7: Sample Size and Power PlannerOpen in Analysis Studio →

No data file is needed. Enter the design, the effect, alpha, and the target power, and read the required sample size, the power curve, and the sensitivity table.

Questions

How many responses do I need for a margin of error of five points? At 95 percent confidence and the worst-case proportion of 0.5, the answer is 385 completed responses. Weighting or clustering raises it: multiply by the design effect. A design effect of 1.5 gives 577.

What power do I have with 50 people per group? For a medium effect (d = 0.5) at alpha 0.05, two-sided, power is about 0.70. The same comparison needs 64 per group to reach the conventional 0.80.

Does the calculator need my data? No. The planner works from planning values you type: an effect size, alpha, and either a target power or a candidate sample size. A pilot file can supply a standard deviation or a proportion if you have one, and the module reads it on your device like every other file.

Why does the answer round up? Because a fractional person cannot be sampled. The exact solution for the worked example is 63.77 per group, and rounding down to 63 would land just under the target power. Planning always rounds up.

What is a design effect? The factor by which a complex design inflates variance compared with a simple random sample of the same size. For cluster samples it is 1 + (m − 1) × ICC, where m is the cluster size and ICC is the intraclass correlation. A design effect of 1.5 means the study needs half again as many cases for the same precision.

More Analysis Studio Modules