Why Use a t Test?
A test of a population mean compares sample evidence with a value specified by the null hypothesis. When the population variance is known, a one-sample z test uses that known variance to standardize the sample mean. In many applications, however, the population variance is not known. It must be estimated from the observations, and that estimation changes the reference distribution used for the test.
A one-sample t test is designed for this setting. Its calculation uses the sample standard deviation, and its reference distribution has degrees of freedom determined by the sample size. The test is exact under a normal-population model; it is not a distribution-free procedure.
Here \(S/\sqrt n\) is the estimated standard error of the sample mean. The denominator \(n-1\) in the calculation of \(S^2\) matters: it gives the usual unbiased sample variance and is also why the t test uses \(n-1\), not \(n\), degrees of freedom. The reason the statistic has a Student t distribution is a separate result; the focus here is how to use that reference distribution in a test.
Set Up the Test Before Calculating
The null hypothesis specifies the mean value being tested, \(\mu_0\). The alternative hypothesis states which departures from that value count as evidence against the null. Choose the alternative from the question being asked, not from the direction of the observed sample mean.
| Question | Alternative | Rejection region at level \(\alpha\) |
|---|---|---|
| Is the mean greater than \(\mu_0\)? | \(H_1:\mu>\mu_0\) | \(T>t_{n-1,1-\alpha}\) |
| Is the mean less than \(\mu_0\)? | \(H_1:\mu<\mu_0\) | \(T<-t_{n-1,1-\alpha}\) |
| Is the mean different from \(\mu_0\)? | \(H_1:\mu\ne\mu_0\) | \(|T|>t_{n-1,1-\alpha/2}\) |
In this table, \(t_{\nu,q}\) is the \(q\)-quantile of a Student t distribution with \(\nu\) degrees of freedom: the probability of being at or below this value is \(q\). For a two-sided test, the total significance level \(\alpha\) is split equally between the two tails. The p-value is the probability, assuming \(H_0\), of a test statistic at least as far in the direction or directions of \(H_1\) as the observed statistic.
Write the null value \(\mu_0\), select the alternative that matches the question, and identify \(\alpha\).
Find \(n\), \(\bar x\), and \(s\), then calculate the estimated standard error \(s/\sqrt n\).
Use \(t=(\bar x-\mu_0)/(s/\sqrt n)\) and \(\nu=n-1\).
Compare with the appropriate critical value or p-value, then state the conclusion in the context of the question.
Worked Tests
Worked Example: An Upper-Tailed Test of Processing Time
A hypothetical operations team records the processing times, in minutes, for a random sample of nine independent cases: 18, 20, 22, 24, 26, 28, 30, 32, and 34. Assume processing times in the population are normally distributed. Test at the 5% significance level whether the population mean exceeds 23 minutes.
Method and hypotheses. The population variance is unknown, so use a one-sample t test. The question asks whether the mean exceeds 23: \(H_0:\mu=23\) versus \(H_1:\mu>23\), with \(\alpha=0.05\).
Calculate the sample statistics. The sum of the nine times is \(234\), so $$ \bar x=\frac{234}{9}=26. $$ The deviations from 26 are \(-8,-6,-4,-2,0,2,4,6,8\). Their squared deviations sum to $$ 64+36+16+4+0+4+16+36+64=240. $$ Thus \(s^2=240/(9-1)=30\), \(s=\sqrt{30}=5.4772\), and the estimated standard error is $$ \frac{s}{\sqrt n}=\frac{\sqrt{30}}{3}=1.8257. $$
Calculate and compare. The degrees of freedom are \(9-1=8\), and $$ t=\frac{26-23}{1.8257}=1.6432. $$ The upper-tail critical value for 8 degrees of freedom at level 0.05 is approximately \(1.860\). Since \(1.6432<1.860\), do not reject \(H_0\). The one-sided p-value is approximately \(0.0690\), also greater than \(0.05\).
Conclusion and trap avoided. This sample does not provide sufficient evidence at the 5% level that the population mean processing time exceeds 23 minutes. The observed mean is above 23, but that alone does not establish statistical significance.
Worked Example: A Two-Sided Test for a Mean Score
A hypothetical quality analyst measures a score on eight independent units, obtaining 41, 42, 43, 44, 44, 45, 46, and 47. Assume a normal population. Test at level \(0.05\) whether the population mean differs from 42.5.
Method and hypotheses. Because departures in either direction matter, use \(H_0:\mu=42.5\) against \(H_1:\mu\ne42.5\). The unknown variance is estimated from the sample, so this is a two-sided one-sample t test.
Calculate the sample statistics. The observations sum to \(352\), giving $$ \bar x=\frac{352}{8}=44. $$ The deviations from 44 are \(-3,-2,-1,0,0,1,2,3\); their squares sum to \(9+4+1+0+0+1+4+9=28\). Therefore \(s^2=28/7=4\), \(s=2\), and $$ \frac{s}{\sqrt n}=\frac{2}{\sqrt 8}=0.7071. $$
Calculate and compare. There are \(8-1=7\) degrees of freedom, and $$ t=\frac{44-42.5}{0.7071}=2.1213. $$ For a two-sided test with \(\alpha=0.05\), the critical values are approximately \(-2.365\) and \(2.365\). Since \(|2.1213|<2.365\), do not reject \(H_0\). The two-sided p-value is approximately \(0.0717\), which is greater than \(0.05\).
Conclusion and trap avoided. The sample does not provide sufficient evidence at the 5% level that the population mean differs from 42.5. Using a one-sided critical value would incorrectly allocate the entire significance level to just one tail, despite the stated two-sided question.
Worked Example: A Lower-Tailed Test for a Mean Measurement
A hypothetical inspection sample contains nine independent measurements, in units, from a normally distributed population: 10, 11, 12, 13, 14, 15, 16, 17, and 18. Test at the 5% level whether the population mean is below 16.
Method and hypotheses. Use \(H_0:\mu=16\) against \(H_1:\mu<16\). This is a lower-tailed t test because the population variance is unknown and the question specifies a decrease.
Calculate the sample statistics. The observations sum to \(126\), so \(\bar x=126/9=14\). The deviations from 14 are \(-4,-3,-2,-1,0,1,2,3,4\), and the squared deviations sum to $$ 16+9+4+1+0+1+4+9+16=60. $$ Thus \(s^2=60/8=7.5\), \(s=\sqrt{7.5}=2.7386\), and \(s/\sqrt9=2.7386/3=0.9129\).
Calculate and compare. The degrees of freedom are 8, and $$ t=\frac{14-16}{0.9129}=-2.1909. $$ The lower-tail critical value at \(\alpha=0.05\) is approximately \(-1.860\). Since \(-2.1909<-1.860\), reject \(H_0\). The one-sided p-value is approximately \(0.0300\), below \(0.05\).
Conclusion and trap avoided. There is evidence at the 5% level that the population mean measurement is below 16 units. Reversing the sign of the statistic or using an upper-tail rejection rule would contradict the direction of the alternative.
Why the Statistic Has This Form
If the population variance \(\sigma^2\) were known, the standard deviation of the sample mean would be \(\sigma/\sqrt n\): independence gives \(\operatorname{Var}(\bar X)=\sigma^2/n\), and taking the square root gives its standard deviation. Under the null value, the discrepancy \(\bar X-\mu_0\) is therefore measured in standard-error units by dividing by \(\sigma/\sqrt n\).
When \(\sigma\) is unknown, the sample standard deviation \(S\) estimates it. Replacing \(\sigma\) in that standardization gives $$ \frac{\bar X-\mu_0}{S/\sqrt n}. $$ The numerator measures the observed distance from the null mean, while the denominator measures the estimated sampling variability of the mean. Because the denominator is estimated rather than known, the reference distribution is Student t rather than the known-variance z reference. Under the stated normal model, its degrees of freedom are \(n-1\). This is the operational justification for the test statistic; it does not establish the distributional result.
Common Mistakes and Scope
- Using \(n\) degrees of freedom. A one-sample t test uses \(n-1\), reflecting the sample-variance calculation around the estimated sample mean.
- Putting the variance in the denominator. The test statistic divides by the estimated standard error \(s/\sqrt n\), not by \(s^2\), \(s\), or \(s^2/n\).
- Choosing a tail after seeing the data. The direction or two-sided form comes from the research question and must be set before interpreting the observed statistic.
- Using a one-tail cutoff for a two-sided test. A two-sided test uses \(t_{n-1,1-\alpha/2}\) in each direction.
- Ignoring the model. The exact one-sample t procedure assumes independent observations from a normal population. With small samples, substantial nonnormality or dependence can make its stated calibration inappropriate.
The distinction from the known-variance z test is the estimated standard error and its t reference distribution. If the population variance really is known, the known-variance procedure applies instead. If the population is not reasonably modeled as normal, especially with a small sample, the exact t-test conclusions should not be claimed without addressing that limitation.
Check Your Understanding
For each problem, identify the appropriate one-sample t procedure, calculate the statistic and degrees of freedom, and make the requested decision.
- A random sample of 25 independent, normally distributed service times has \(\bar x=52\) minutes and \(s=10\) minutes. Test \(H_0:\mu=48\) against \(H_1:\mu>48\) at \(\alpha=0.05\). (Answer: \(t=2.000\), 24 degrees of freedom; reject \(H_0\).)
- A normal-population sample has \(n=16\), \(\bar x=7.4\), and \(s=1.6\). Test whether its mean differs from 8.0 at \(\alpha=0.10\). (Answer: \(t=-1.500\), 15 degrees of freedom; do not reject \(H_0\).)
- A normal-population sample has \(n=10\), \(\bar x=31.2\), and \(s=4.0\). Test \(H_0:\mu=33\) against \(H_1:\mu<33\) at \(\alpha=0.01\). (Answer: \(t\approx-1.423\), 9 degrees of freedom; do not reject \(H_0\).)
- A random sample of 36 independent, normally distributed measurements has \(\bar x=104\) and \(s=12\). Test \(H_0:\mu=100\) against \(H_1:\mu>100\) at \(\alpha=0.01\). (Answer: \(t=2.000\), 35 degrees of freedom; do not reject \(H_0\).)
- A normal-population sample has \(n=12\), \(\bar x=19.5\), and \(s=3\). Test whether the population mean differs from 21 at \(\alpha=0.05\). (Answer: \(t\approx-1.732\), 11 degrees of freedom; do not reject \(H_0\).)