molecalculator

Moles & Molar Mass

Power Analysis Calculator: Sample Size Explained

Calculator No. 01-10039 · Updated · Formula and assumptions shown below

Sample size per group 63
Effect size (Cohen's d)
0.5
Set in the form below
Significance level (alpha)
0.05
Set in the form below
Desired power (1 - beta)
0.8
Set in the form below
You enter
Effect size (Cohen's d), Significance level (alpha), Desired power (1 - beta)
You get
Sample size per group
Rounding
0 dp

For study and lab planning. The result follows from the numbers you enter and the formula shown. Check it against your method before you weigh, mix or dilute anything, follow the safety data sheet and your supervisor, and do not use it for clinical, dosing or medication work.

A power analysis calculator determines the minimum sample size needed to detect an effect of a given size with a specified level of confidence and statistical power. You enter the expected effect size, the significance level (alpha), and the desired power (typically 0.80), and it returns the number of participants or observations required per group. This article explains the underlying math, how to choose inputs, common pitfalls, and answers frequently asked questions.

Formula

For a two-sample t-test (equal group sizes), the required sample size per group is:

n = ( (z1-α/2 + z1-β)2 × 2 ) / d2

Where:

  • n = sample size per group
  • z1-α/2 = the z-score corresponding to the chosen significance level (e.g., 1.96 for α = 0.05, two-tailed)
  • z1-β = the z-score corresponding to the desired power (e.g., 0.84 for 80% power)
  • d = Cohen’s d effect size (the expected difference in means divided by the pooled standard deviation)

The formula assumes a two-tailed test, equal group sizes, and normally distributed data with equal variances. It is the standard approximation used in most power calculators.

Worked Example

Suppose you are planning a study to compare two teaching methods, expecting a moderate effect size (d = 0.5). You set α = 0.05 and want 80% power.

  1. Find the z-scores: z0.975 = 1.9600, z0.80 = 0.8416.
  2. Add them: 1.9600 + 0.8416 = 2.8016.
  3. Square the sum: 2.80162 = 7.8490.
  4. Multiply by 2: 7.8490 × 2 = 15.698.
  5. Divide by d2 = 0.25: 15.698 / 0.25 = 62.79.

Rounding up, you need 63 participants per group (126 total). The calculator above gives the same result: 62.79, which you round up to 63.

Assumptions

  • Two independent groups, equal sample sizes.
  • Two-tailed test (most common).
  • Normally distributed outcome with equal variances.
  • The effect size is known or estimated from prior research or a pilot study.
  • The significance level and power are set before data collection.

How to Choose Your Inputs

Selecting the right inputs is the most important part of using a power analysis. Here are practical guidelines:

  • Effect size (d): Use a value from previous literature, a pilot study, or the smallest effect you consider scientifically meaningful. Cohen suggested benchmarks: 0.2 = small, 0.5 = medium, 0.8 = large, but these are arbitrary and should not replace domain-specific knowledge.
  • Alpha (α): The standard is 0.05, meaning a 5% chance of a false positive (Type I error). Stricter fields (e.g., genomics) use 0.01 or even 5×10-8.
  • Power (1-β): Conventionally 0.80, meaning an 80% chance of detecting a true effect. Higher power (0.90 or 0.95) is advisable when the cost of missing an effect is high.

Remember that the formula returns the sample size per group. If you plan unequal groups, the calculation changes and typically requires a larger total sample size.

Common Mistakes and Misconceptions

Several errors can lead to an incorrect sample size calculation:

  • Using a one-tailed formula when you need two-tailed: One-tailed tests require smaller samples, but they are only appropriate when you can confidently predict the direction of the effect. Most studies should use two-tailed.
  • Confusing effect size with raw difference: Cohen’s d is the difference in means divided by the standard deviation, not the raw difference. A small raw difference can be a large effect if variability is low.
  • Ignoring attrition: If you expect 20% dropout, inflate your sample size accordingly. For example, if you need 63 completers, recruit 63 / 0.8 ≈ 79.
  • Rounding down: Always round the sample size up to the next whole number. A sample of 62.1 requires 63 participants.
  • Assuming the calculator accounts for all complexities: This simple formula does not handle unequal variances, clustered data, or multiple comparisons. Use specialized software for those cases.

Alternatives and Extensions

The formula above is for the simplest case: a two-sample t-test. Real studies often need different approaches:

  • ANOVA: Use f-squared effect size and noncentral F distribution. Software like G*Power or R’s pwr package handles this.
  • Regression: Power depends on the number of predictors and the R-squared increase.
  • Proportions: For binary outcomes, use a different formula based on the normal approximation to the binomial.
  • Paired t-test: The formula uses the standard deviation of the differences, not the raw SD, and typically requires fewer participants.
  • Bayesian or simulation-based: For complex designs, Monte Carlo simulations can provide more accurate power estimates.

Free software like G*Power, R, and online calculators (including this one) are widely used. Always document your assumptions so others can reproduce your calculation.

Frequently Asked Questions

What is a good power level?

80% is the conventional minimum, meaning you accept a 20% chance of missing a true effect. Some journals or funders require 90% or higher, especially for clinical trials where a missed effect could be harmful. Higher power generally requires a larger sample, so balance statistical rigor with practical constraints.

What if I don’t know the effect size?

You must estimate it from prior studies, a pilot study, or by specifying the smallest effect you care to detect (the minimal clinically important difference). If no information exists, you can use Cohen’s benchmarks (0.2, 0.5, 0.8) but be aware they are arbitrary and may not reflect your field’s reality.

Why does my sample size change so much with effect size?

Because the formula divides by d², the sample size is inversely proportional to the square of the effect size. Halving the effect size quadruples the required sample. This is why detecting small effects is expensive and often impractical.

Can I use this calculator for a one-sample test?

No, the formula is for two independent groups. For a one-sample t-test, the formula is n = (z1-α/2 + z1-β)² / d², without the factor of 2. For paired tests, the effect size is based on the standard deviation of differences.

How do I account for unequal group sizes?

If you plan a 2:1 ratio, the total sample size increases. For a ratio r (e.g., r = 2 means group 2 is twice group 1), the required n per group in group 1 is approximately (1 + 1/r) × nequal / 2, and group 2 is r times that. Specialized software handles this precisely.

Is a larger sample always better?

Not necessarily. Beyond the point of adequate power, extra participants waste resources and can create ethical concerns (e.g., exposing more subjects to a potentially inferior treatment). Also, extremely large samples can detect trivial effects that are statistically significant but practically meaningless. Power analysis helps you find the minimum needed, not the maximum.

Related

Formula used
in es | Effect size (Cohen's d) | - | 0.5 | 0.01 | 10
in a | Significance level (alpha) | - | 0.05 | 0.001 | 0.5
in pw | Desired power (1 - beta) | - | 0.80 | 0.5 | 0.99
out n | Sample size per group | - | ( (1.95996398454005 + 0.841621233572914)^2 * 2 ) / (es^2) | 0

Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work

Method: the standard formula for this calculation with the constants and conversion factors written on the page, rounded as each result states. See method and constants, the disclaimer or report an error.

More in this section

The whole Moles & Molar Mass section →