Why Sample Size for a One-Sample t Test Requires a Search
When the population variance is unknown, a one-sample t test estimates variability from the observations. That makes its rejection threshold depend on the sample size through the degrees of freedom. Under a specified alternative, the test statistic also follows a noncentral t distribution, whose noncentrality parameter depends on the sample size. Consequently, planning usually means evaluating power at successive integer sample sizes, not inserting a normal critical value into a closed-form formula.
The design begins with a significance level, a target power, a test direction, and a planning alternative. It also needs a planning value for the population standard deviation. This value is an assumption for calculating power; it is not treated as known when the actual t test is performed.
The direction of the alternative determines the rejection region. For an upper-tailed test, \(H_1:\mu>\mu_0\), reject when \(T>t_{1-\alpha,n-1}\). For a lower-tailed test, reject when \(T<t_{\alpha,n-1}\). For a two-sided test, \(H_1:\mu\ne\mu_0\), reject when \(|T|>t_{1-\alpha/2,n-1}\). Here \(t_{q,\nu}\) is the \(q\)-quantile of the central t distribution with \(\nu\) degrees of freedom.
Write \(F_{\nu,\lambda}(t)\) for the cumulative distribution function of a noncentral t random variable with \(\nu\) degrees of freedom and noncentrality \(\lambda\). The power is the probability, under the planning alternative, that the statistic lands in the rejection region.
The two-sided expression adds the probabilities in both rejection tails. The lower-tail term should not be dropped just because the planned effect is in the upper direction: a two-sided test rejects for sufficiently extreme statistics in either direction.
Why the Noncentral t Parameter Has This Form
The key relationship follows directly from the model. Under the planning alternative, \(\bar X\) has mean \(\mu_1\) and variance \(\sigma^2/n\). Thus \((\bar X-\mu_0)/(\sigma/\sqrt n)\) is normal with variance one and mean \((\mu_1-\mu_0)\sqrt n/\sigma\). For a normal sample, this standardized mean is independent of \((n-1)S^2/\sigma^2\), which has a chi-square distribution with \(n-1\) degrees of freedom. Dividing the shifted normal quantity by the square root of that independent chi-square quantity divided by its degrees of freedom gives a noncentral t statistic. This establishes both its degrees of freedom and its noncentrality parameter.
The magnitude of \(\lambda\) grows with \(\sqrt n\), provided the planning effect and \(\sigma\) stay fixed. A larger sample therefore tends to move the statistic farther into the rejection region. But the critical value changes with \(n\) too, so power is evaluated using the noncentral t distribution for each candidate size.
A Practical Search Procedure
State \(\mu_0\), the alternative direction, \(\alpha\), the desired power, and the planning values \(\mu_1\) and \(\sigma\). These choices define the effect to be detected.
For each integer \(n\), calculate \(n-1\), \(\lambda=(\mu_1-\mu_0)\sqrt n/\sigma\), the appropriate central t critical value, and the corresponding noncentral t power.
Evaluate candidate sizes in increasing order, using a noncentral t calculator or statistical software. The selected size is the smallest integer whose calculated power is at least the target.
Check the selected size and the immediately preceding size. The selected size must meet the target, and the preceding size must fail it. A rounded display alone should not decide a borderline comparison.
For a fixed alternative and this normal model, power is generally increasing as \(n\) increases, but the design decision should still be based on the computed values at the integer candidates. In particular, do not round an estimated size down, and do not declare a borderline size adequate from a power value rounded to two decimals before checking the unrounded result.
Worked Example: Minimum Size for a Two-Sided Test
A hypothetical materials laboratory wants to test whether the mean breaking load differs from \(50\) units. Assume independent observations from a normal population with planning standard deviation \(\sigma=10\) units. The design alternative is \(\mu_1=56\), the significance level is \(\alpha=0.05\), and the target power is \(0.80\). Find the smallest sample size using a two-sided one-sample t test.
Method and effect size. The hypotheses are \(H_0:\mu=50\) and \(H_1:\mu\ne50\). The planned difference is \(56-50=6\) units, so the standardized effect is \(6/10=0.6\). For each candidate \(n\), the noncentrality parameter is \(0.6\sqrt n\), and the critical value is \(t_{0.975,n-1}\).
At \(n=23\), the degrees of freedom are \(22\), and \(\lambda=0.6\sqrt{23}=2.879\) to three decimals. The critical value is \(t_{0.975,22}\approx2.074\). Evaluating both tails of the noncentral t distribution gives power of approximately \(0.79\), below the \(0.80\) target.
At \(n=24\), the degrees of freedom are \(23\), and \(\lambda=0.6\sqrt{24}=2.939\) to three decimals. The critical value is \(t_{0.975,23}\approx2.069\). The two-sided power is approximately \(0.803\), which is at least \(0.80\).
The first candidate that meets the target is therefore \(n=24\). The adjacent-size check confirms that \(n=23\) fails and \(n=24\) succeeds, so the minimum sample size is 24 observations. The powers shown are numerical noncentral t evaluations; the noncentral t distribution does not generally yield a simple closed-form tail calculation.
Common mistake avoided: Do not call \(n=24\) inadequate because its power rounds to \(0.80\) at two decimals, or mistakenly report it below target. Its unrounded power is about \(0.803\), so it meets the requirement.
Worked Example: A More Stringent Two-Sided Design
A hypothetical calibration team will test whether a sensor’s mean drift differs from \(0\) millivolts. Assume a normal population with planning standard deviation \(\sigma=5\) millivolts, and plan for an alternative mean of \(\mu_1=4\) millivolts. Find the minimum sample size for a two-sided test with \(\alpha=0.01\) and target power \(0.90\).
Method and noncentrality. The standardized effect is \((4-0)/5=0.8\). At size \(n\), use \(\lambda=0.8\sqrt n\), degrees of freedom \(n-1\), and critical value \(t_{0.995,n-1}\). Because the test is two-sided, add the noncentral t probabilities below the negative critical value and above the positive critical value.
For \(n=26\), the degrees of freedom are \(25\), \(\lambda=0.8\sqrt{26}=4.079\) to three decimals, and \(t_{0.995,25}\approx2.787\). The two-tail noncentral t power is approximately \(0.89\), below \(0.90\).
For \(n=27\), the degrees of freedom are \(26\), \(\lambda=0.8\sqrt{27}=4.157\) to three decimals, and \(t_{0.995,26}\approx2.779\). The two-tail power is approximately \(0.905\), which exceeds \(0.90\). Checking the candidate sizes in increasing order shows that \(n=27\) is the first to reach the target. The required minimum is 27 observations.
Common mistake avoided: The candidate at \(n=27\) is not a failure just because the power is near the target. Its power is about \(0.905\), so it meets the \(0.90\) requirement. Also, \(\lambda=0.8\sqrt{27}\) rounds to \(4.157\), not \(4.158\).
Worked Example: Minimum Size for an Upper-Tailed Test
A hypothetical process engineer will test whether the mean output exceeds a benchmark of \(100\) units. Assume independent observations from a normal population with planning standard deviation \(\sigma=8\) units. The design alternative is \(\mu_1=104\), with \(\alpha=0.05\) and target power \(0.80\). Find the smallest sample size for the upper-tailed t test.
Method and noncentrality. The planned difference is \(104-100=4\), giving standardized effect \(4/8=0.5\). The statistic’s noncentrality is \(0.5\sqrt n\). For this upper-tailed test, the critical value is \(t_{0.95,n-1}\), and power is the area above it under the corresponding noncentral t distribution.
At \(n=26\), the degrees of freedom are \(25\), \(\lambda=0.5\sqrt{26}=2.550\) to three decimals, and \(t_{0.95,25}\approx1.708\). The upper-tail noncentral t power is below \(0.80\) (approximately \(0.79\)).
At \(n=27\), the degrees of freedom are \(26\), \(\lambda=0.5\sqrt{27}=2.598\) to three decimals, and \(t_{0.95,26}\approx1.706\). The upper-tail power is approximately \(0.811\), which meets the target. Thus the minimum is 27 observations.
Common mistake avoided: This is a one-sided design, so its critical value is \(t_{0.95,n-1}\), not \(t_{0.975,n-1}\). Using the two-sided critical value would answer a different design question and generally give a different power.
Interpreting the Result and Its Assumptions
A planned sample size is conditional on the inputs. If the true effect is smaller than the planned difference, or the true population standard deviation is larger than the planning value, actual power can be lower than the design target. It is useful to assess how plausible the assumed \(\sigma\) and effect are before treating a calculated size as definitive.
The exact noncentral t calculation relies on independent observations from a normal population. The test can be reasonably robust to some departures from normality in sufficiently large samples, but that does not make the exact noncentral t power calculation exact for an arbitrary population. Strong skewness, heavy tails, dependence, or a sampling design unlike the assumed independent sample may require a different planning model.
The calculated \(n\) is the number of usable observations needed for the test. If some observations may be unusable, the enrollment target must be larger. For example, if a design requires \(24\) complete observations and the anticipated unusable fraction is \(10\%\), the enrollment target is \(\lceil24/(1-0.10)\rceil=\lceil26.667\rceil=27\). This adjustment changes the number approached or enrolled, not the noncentral t calculation for the \(24\) complete observations.
Common Exam Traps
- Using the wrong degrees of freedom. A one-sample t test with \(n\) observations has \(n-1\) degrees of freedom, not \(n\).
- Using the wrong standard deviation in the noncentrality. The planning parameter uses the assumed population \(\sigma\), not the random sample standard deviation \(S\).
- Mixing one-sided and two-sided critical values. A two-sided level-\(\alpha\) test places \(\alpha/2\) in each tail; a one-sided test places all of \(\alpha\) in one tail.
- Stopping at a rounded power value. Compare the unrounded numerical power to the target when the result is close.
- Rounding the sample size down. Sample size is an integer, and the chosen value must itself meet the target; verify that the immediately smaller candidate does not.
Check Your Understanding
For each problem, use the stated model and design information. Where numerical noncentral t power values are supplied, treat them as evaluations for the specified candidate sizes.
- A hypothetical inspection study tests \(H_0:\mu=30\) against \(H_1:\mu\ne30\). The population is modeled as normal with planning standard deviation \(6\), and the design alternative is \(\mu_1=33\). For \(n=16\), state the degrees of freedom and noncentrality parameter. (Answer: \(15\) degrees of freedom and \(\lambda=(33-30)\sqrt{16}/6=2.000\).)
- A hypothetical upper-tailed test has \(\alpha=0.05\), planning effect \(\mu_1-\mu_0=2\), and \(\sigma=4\). A numerical evaluation gives power \(0.784\) at \(n=20\) and \(0.812\) at \(n=21\), with all smaller candidate sizes below \(0.784\). What is the minimum size for a target power of \(0.80\)? (Answer: \(n=21\).)
- A hypothetical two-sided test uses \(\alpha=0.10\), with normal-population planning values \(\mu_1-\mu_0=5\) and \(\sigma=10\). At \(n=25\), identify the critical-value quantile and calculate \(\lambda\). (Answer: use \(t_{0.95,24}\), since \(\alpha/2=0.05\), and \(\lambda=0.5\sqrt{25}=2.500\).)
- A hypothetical one-sample t design needs \(32\) complete observations. If \(12\%\) of enrolled participants are expected to provide unusable data, how many should be enrolled? (Answer: \(\lceil32/(1-0.12)\rceil=\lceil36.364\rceil=37\) participants.)
- A hypothetical two-sided normal-population design has target power \(0.90\) at \(\alpha=0.05\). Noncentral t evaluation gives power \(0.897\) at \(n=40\) and \(0.903\) at \(n=41\), and all smaller sizes have power below \(0.897\). Which size should be selected, and why is rounding power to two decimals unsafe here? (Answer: select \(n=41\); \(n=40\) is below \(0.90\), even though both powers round to \(0.90\) at two decimals.)