Dissertation Statistics Help

Sample size and power calculator

Plan the sample you need before you collect a single response, using the exact distributions a power analysis actually rests on.

A sample size calculator tells you how many participants a study needs to detect an effect of a given size with a stated statistical power, or, run in reverse, the power a planned sample already gives you. This tool solves both directions for a t-test, one-way ANOVA, correlation, linear regression, two proportions, and the chi-square test, computing power from the exact noncentral t, F, and chi-square distributions rather than a normal approximation, so the numbers match G*Power and R.

Required sample size

64 per group

128 total. Exact requirement 63.77 per group.

Per-group n (rounded up)64
Total N128
Exact (continuous) n63.77
Power achieved at this n0.8015

How the sample size is found

Power is the probability that a test rejects the null hypothesis when a real effect of the stated size exists. For a two-sample t-test the test statistic follows a noncentral t distribution whose noncentrality parameter grows with the sample size and the effect:

ncp = d × √(n / 2)

Power is the area of that noncentral distribution beyond the critical value. To solve for the sample size, the calculator finds the smallest n whose power reaches your target by root-finding on the exact power function, then rounds up to a whole count. Both the exact (continuous) requirement and the rounded count are reported, because rounding up always gives slightly more power than you asked for.

ANOVA, regression, and chi-square use the noncentral F and noncentral chi-square distributions in the same way; correlation uses the bias-corrected Fisher z transformation, matching R's pwr package. Effect sizes follow Cohen's conventions (small, medium, large), but an estimate from prior research or a pilot is always preferable to a rule of thumb.

How power, effect size, and alpha drive sample size

Sample size is never a free choice; it is the output of three decisions you make first. Statistical power, the probability of detecting an effect that is genuinely there, is conventionally set at .80, meaning you accept a one-in-five chance of missing a real effect. The significance level, alpha, usually .05, fixes the false-positive risk. The third input, the effect size you expect, is the one researchers underestimate most, and it has the largest leverage of all: halving the effect you want to detect roughly quadruples the participants you need.

These four quantities, power, alpha, effect size, and sample size, are locked together, so fixing any three determines the fourth. That is why a credible power analysis justifies its effect size from prior literature or a pilot study rather than reaching for a generic “medium” benchmark. Our explainer on what statistical power means unpacks the trade-off, and our effect size estimator helps you pin down a defensible value before you plug it in above.

Sample size for surveys vs experiments

The right approach depends on what you are estimating. A descriptive survey that reports a prevalence or a mean is sized for precision: you choose a margin of error and a confidence level, and the sample size follows from how tight you need the confidence interval to be. A common target, a 5% margin at 95% confidence for a proportion in a large population, lands near 385 respondents, and finite-population corrections shrink that when the population itself is small.

An experiment or comparative study is sized differently, for power to detect a difference between groups rather than precision around a single number. Here the inputs are the effect size, alpha, and power described above, and the output is participants per group, not a single total. Mixing the two logics is a frequent error: sizing an experiment with a survey margin-of-error rule, or vice versa, produces a number that will not survive review. Decide first whether your aim is to estimate or to compare, a distinction our note on describing a sample versus inferring to a population makes concrete.

Adjusting sample size for expected dropout

The figure a power analysis returns is the number you need with complete data, which is rarely the number you should aim to recruit. Participants withdraw, miss follow-up sessions, or return unusable responses, so a target set at the bare power requirement will finish underpowered. The fix is to inflate the recruited sample by the proportion you expect to lose. If the analysis calls for 128 participants and you anticipate 20% attrition, divide by 0.80 to get 160, the number you actually enrol.

The inflation formula is straightforward:

n_recruit = n_required / (1 - dropout_rate)

Base the dropout rate on the real attrition reported by similar studies in your field, not optimism, because long or burdensome protocols lose more people. Longitudinal designs with several waves compound the loss, so the adjustment grows at each time point. Bear in mind that high attrition does more than shrink power; if it is not random it biases the result, which is why our guide to handling missing data matters as much as the recruitment target itself.

Determining sample size for your dissertation

For a dissertation, the sample size section is examined as closely as the results, because it shows your study could detect what it claims to look for. Work in order: state each research question and the analysis that answers it, choose the effect size you would consider meaningful and justify it from the literature, set power at .80 or higher and alpha at .05, then run the calculation for the most demanding test in your plan. Sizing for that test ensures every simpler analysis is adequately powered too.

Write the result up so a reader can reproduce it: name the software or method, list every input, and report the minimum sample alongside the dropout-adjusted recruitment target. A committee will ask why you expect that effect size and how you arrived at the number, so the justification matters more than the figure. The deeper walkthrough in our guide to a power analysis for your sample size gives a template, and our masters thesis statistics support can draft the section with you if the methods chapter is the bottleneck.

Frequently asked questions

What is the formula for the sample size?

There is no single formula, because the required sample size depends on the test. For a two-sample t-test it is driven by the effect size, the significance level, and the power you want, and is found by solving the noncentral t power function for the smallest n that reaches your target power. This calculator solves that equation for you across seven common tests.

How do you calculate sample size for two groups?

Enter the expected standardised effect size (Cohen's d), your significance level (usually 0.05), and your target power (usually 0.80), then read off the number of participants per group. The tool returns both the exact requirement and the whole-number count, which is always rounded up so the realised power meets or exceeds your target.

How many samples do I need for a t-test?

It depends entirely on the effect size you expect. To detect a medium effect (d = 0.5) at 5% significance with 80% power, an independent t-test needs about 64 participants per group, while a small effect (d = 0.2) needs roughly 394 per group. Enter your own effect size above to get the exact figure for your study.

When should I use a one-sample or two-sample t-test?

Use a one-sample t-test when you compare a single group's mean against a fixed reference value, and a two-sample t-test when you compare the means of two independent groups. A paired t-test is the right choice when the same participants are measured twice. This calculator covers both the two independent-group and the paired designs.