Statistical Calculators › Means: One and Two Groups › One-Sample t-Test Sample Size
← All Calculators

Means: One and Two Groups

One-Sample t-Test Sample Size

Calculate the minimum sample size required for a one-sample t-test to achieve a specified power for detecting a planned mean difference from a fixed reference value. The calculation uses the exact noncentral t distribution, with the integer sample size rounded up to the first value that achieves the requested power.

Study Design

Enter the assumptions used to plan the one-sample test.
For a one-sided calculation, the alternative mean must be above or below the reference mean so that the direction of the test is unambiguous.

Sample Size Result

Exact noncentral-t power calculation; no normal-approximation sample-size formula is substituted.
Enter the study assumptions and click Calculate Sample Size.

Methodology

The one-sample t-test tests whether a population mean differs from a specified reference value when the population standard deviation is unknown. This is applicable to greater-than, less-than, or not-equal alternatives and bases the power calculation on a noncentral t distribution. The same noncentral-t framework is used here.

Test statistic and noncentrality

For a sample of size n, the usual one-sample statistic is

t = (x̄ − μ0) / (s / √n),    df = n − 1

Under the planned alternative mean μ1, the noncentrality parameter is

λ = (μ1 − μ0) √n / σ

The calculator evaluates the rejection probability under this noncentral t distribution. For a two-sided test, both tails beyond the central t critical values are included. For a one-sided test, the appropriate upper or lower tail is used.

How sample size is selected

  1. For each candidate integer n ≥ 2, calculate the central-t critical value using df = n − 1.
  2. Calculate the noncentrality parameter from the planned mean difference and standard deviation.
  3. Calculate exact power from the noncentral t distribution.
  4. Select the first integer n for which the calculated power is at least the requested target.

Assumptions

The underlying observations are assumed to be continuous and approximately normally distributed, with a simple random sample and independent observations. The standard deviation supplied to the calculator is the anticipated population standard deviation used for planning. Note normality and random sampling among the assumptions of the one-sample t-test.

Worked validation example

This worked example uses a SIDS birth-weight example with μ0 = 3300 g, σ = 663 g, α = 0.05, a two-sided alternative, and an alternative mean of 2970 g. This yields N = 34 with achieved power 0.80426; the preceding integer has power below 0.80, so 34 is the first sample size meeting the target. The implementation on this page reproduces those values.

μ0 = 3300  ·  μ1 = 2970  ·  σ = 663  ·  α = 0.05  ·  power = 0.80  ·  two-sided
Expected: N = 34; achieved power = 0.80426    |    N = 33: power = 0.79177

References

Harrison, D.A. & Brady, A.R. (2004). Sample size calculations and power analysis using the noncentral t-distribution. Stata Journal, 4(2), 142–151. The paper derives one-sample t-test power using the noncentral t distribution.

Chow, S.C., Shao, J., Wang, H., & Lokhnygina, Y. (2018). Sample Size Calculations in Clinical Research, 3rd ed. Taylor & Francis/CRC Press.