Means: One and Two Groups
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.
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.
For a sample of size n, the usual one-sample statistic is
Under the planned alternative mean μ1, the noncentrality parameter is
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.
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.
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.
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.