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.

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.