Tools › Statistics › Surveys and Sampling › Sample Size and Power › Example

Two-sample t test for a standardized difference of 0.5 at α = 0.05 and 80 % power: 64 per group by the exact noncentral t (R's power.t.test root 63.77)

ToolSample Size and Power
SourceR Core Team (2025). R: A Language and Environment for Statistical Computing. R Foundation for Statistical Computing, Vienna (stats package, power.t.test; src/library/stats/R/power.R); NIST/SEMATECH (2012). e-Handbook of Statistical Methods, Section 7.2.2.2 (sample sizes for a mean); Owen, D. B. (1965). "A Special Case of a Bivariate Non-Central t-Distribution." Biometrika, Vol. 52, No. 3/4, pp. 437–446.
LevelUndergraduate

Problem

How many subjects per group does a two-sample t test need to detect a difference of half a standard deviation (δ = 0.5, σ = 1, Cohen's d = 0.5) with 80 % power at a two-sided α of 0.05, and how does the normal-approximation formula compare with the exact noncentral-t answer?

Inputs to Enter

  • Design two means, solve for the sample size, two-sided α = 0.05, target power 0.80, allocation κ = 1
  • Difference δ = 0.5, σ = 1 (equal variances, pooled t), σ estimated (t statistic)
Open the Sample Size and Power tool (loaded with this example)

Answers

  • z_0.975 = 1.960, z_0.80 = 0.8416; normal approximation n_z = (1.960 + 0.8416)² · 2 · 1² / 0.5² = 62.79 per group (NIST 7.2.2.2 form)
  • Exact noncentral t: at n = 64 per group ν = 126, λ = 0.5/√(2/64) = 2.828, t_c = 1.979, power = 0.8015 (0.7952 at 63), so n_1 = n_2 = 64, N = 128
  • R's power.t.test(delta = 0.5, power = 0.8) continuous root n = 63.77 (correct-direction power 0.801459 at 64; the opposite tail adds 9 × 10⁻⁷)
  • Sizes at other targets (per group, α 0.10 / 0.05 / 0.01): power 0.70 → 39 / 51 / 79; 0.80 → 51 / 64 / 96; 0.90 → 70 / 86 / 121; 0.95 → 88 / 105 / 145

Notes

The tool's default inputs are this case; press Submit. The power functions are checked by test_sample_size_power.php (815 checks) against R's documented examples (power.prop.test 0.740 / 76.7 / 0.8026 / 73.37, power.anova.test 0.3535594 / 11.92613 / 15.18834), the NIST e-Handbook examples of 7.2.2.2, 7.2.3.2 and 7.2.4.2, and an independent scipy script (References/Sample-Size-Power/checks/).