Step 17: One-Sample t Procedures and Paired Data
- When you estimate a population mean \(\mu\) you almost never know the population standard deviation \(\sigma\), so you use the sample standard deviation \(s\) and a t distribution instead of the normal (z) distribution.
- A one-sample t-interval is \(\bar{x} \pm t^* \dfrac{s}{\sqrt{n}}\), and the t-test statistic is \(t = \dfrac{\bar{x} – \mu_0}{s/\sqrt{n}}\), both with degrees of freedom \(df = n – 1\).
- For paired data (two measurements on the same person or matched pair), work out the differences first, then run a one-sample t procedure on the mean difference \(\mu_d\).
- Exam marks come from checking Random, 10% and Normal/Large sample, giving \(df\), and concluding in context about the population mean.
Why t instead of z?
Suppose a café wants to know the average time customers wait for a coffee. It times 16 customers and finds a sample mean of 4.2 minutes. To build a confidence interval, you would like the standard deviation of \(\bar{x}\), which is \(\sigma/\sqrt{n}\). But nobody knows \(\sigma\), the standard deviation of waiting times for all customers. So you use the sample standard deviation \(s\) instead, giving the standard error \(s/\sqrt{n}\).
That swap has a cost. The value of \(s\) changes from sample to sample, so it adds extra uncertainty. If you still used z, your intervals would be too narrow and your tests would reject too often. The fix, discovered by William Gosset while he worked for the Guinness brewery in Dublin, is to use a slightly wider distribution called the t distribution.
The t distributions and degrees of freedom
There is not one t distribution but a whole family. Each one is described by its degrees of freedom. For a one-sample t procedure:
All t distributions share these features:
- They are symmetric, single-peaked and centred at 0, like the standard normal curve.
- They have heavier tails than the normal curve, so more of the area lies far from the centre. This allows for the extra uncertainty from using \(s\).
- As \(df\) increases, the t curve gets closer and closer to the standard normal. With very large \(df\) they are almost identical.
Because of the heavier tails, the critical value \(t^*\) is bigger than \(z^*\) for the same confidence level. For 95% confidence, \(z^* = 1.960\), but with \(df = 15\), \(t^* = 2.131\), and with \(df = 24\), \(t^* = 2.064\). You read \(t^*\) from a t table or calculator using \(df\) and the confidence level.
Conditions for t procedures
Before you calculate anything, you must check three conditions. These are the same for intervals and tests.
- Random: the data come from a random sample or a randomised experiment.
- 10%: when sampling without replacement, \(n \le 10\%\) of the population. This keeps the observations close to independent.
- Normal/Large sample: the population is approximately normal, or \(n \ge 30\) (the central limit theorem then makes \(\bar{x}\) approximately normal). If \(n < 30\) and you do not know the population shape, make a dotplot, boxplot or histogram of the sample and check that it shows no strong skewness and no outliers.
The one-sample t-interval
For example, a random sample of 20 sixth-form students at a large college records how many hours they slept last night. The sample mean is \(\bar{x} = 6.8\) hours and the standard deviation is \(s = 1.2\) hours. A dotplot shows no strong skew or outliers. Build and interpret a 95% confidence interval for the mean sleep time of all sixth-form students at the college.
If someone claimed that these students average 8 hours of sleep, that claim is not plausible: 8 lies well outside the interval.
The one-sample t-test
A significance test checks a claim about \(\mu\). The null hypothesis states a value \(\mu_0\); the test statistic measures how many standard errors \(\bar{x}\) is from \(\mu_0\).
For example, a coffee chain says its large cups contain 250 ml. A trading standards officer suspects they contain less. She buys a random sample of 16 large coffees from the chain’s shops and finds \(\bar{x} = 244\) ml and \(s = 10\) ml. A dotplot shows no strong skew or outliers. Test the claim at \(\alpha = 0.05\).
If the cups really averaged 250 ml, a sample mean as low as 244 ml would happen only about 1.5% of the time by chance. That is rare enough to doubt the claim.
Paired data: analyse the differences
Sometimes you have two measurements on the same individual: a score before and after a course, the reaction time with the left hand and the right hand, or the price of the same items in two supermarkets. These are paired data. The two lists are not independent, because a strong student will tend to score well both times.
The trick is simple. Subtract to get one difference per pair, then forget the original two lists. You now have a single sample of differences, and you use a one-sample t procedure on their mean.
For example, 8 randomly selected students take a mock test, attend a revision workshop and then take a similar test. Scores (out of 100) are:
| Student | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
|---|---|---|---|---|---|---|---|---|
| Before | 62 | 70 | 55 | 68 | 74 | 59 | 66 | 71 |
| After | 67 | 72 | 61 | 66 | 80 | 64 | 70 | 75 |
| \(d\) = After − Before | 5 | 2 | 6 | −2 | 6 | 5 | 4 | 4 |
At \(\alpha = 0.05\), is there convincing evidence that the workshop raises scores on average?
Be careful about cause: there was no control group, so the rise could partly come from practice at taking the test. A better design would compare with students who did not attend the workshop.
Interpreting results in context
A good conclusion always talks about the population parameter in words (the true mean, not the sample mean), uses the language of evidence, and stays within what the design allows.
- Say “we have convincing evidence that the true mean…” or “we do not have convincing evidence that…”. Never “we proved” or “we accept \(H_0\)”.
- For an interval, say “we are 95% confident that the interval from … to … captures the true mean…”.
- Generalise to a population only if the data came from a random sample. Claim cause and effect only if treatments were randomly assigned.
Practise: 6 questions
Try each one on paper first, then check the worked answer.
EasyQ1. A random sample has \(n = 12\). State the degrees of freedom and the critical value \(t^*\) for a 95% confidence interval. Show worked answer
For 95% confidence with \(df = 11\), \(t^* = 2.201\).
This is larger than \(z^* = 1.960\) because the t distribution has heavier tails.
EasyQ2. A sample of 16 bus journeys has \(s = 8\) minutes. Find the standard error of \(\bar{x}\). Show worked answer
MediumQ3. A random sample of 10 phone batteries lasts a mean of \(\bar{x} = 52\) hours with \(s = 4\) hours. A dotplot shows no strong skew or outliers. Build a 90% confidence interval for the true mean battery life. Show worked answer
\(SE = 4/\sqrt{10} \approx 1.265\).
Margin of error \(= 1.833 \times 1.265 \approx 2.32\).
Interval: \(52 \pm 2.32\), giving \((49.68,\ 54.32)\) hours.
We are 90% confident that the interval from 49.68 to 54.32 hours captures the true mean life of all batteries of this type.
MediumQ4. A random sample of 15 house prices in a town includes one mansion priced far above all the others, and the boxplot is strongly right-skewed. Is it safe to use a one-sample t-interval? Explain. Show worked answer
MediumQ5. Five people rate a song before and after hearing a remix. The differences (after − before) are 3, 1, 4, 0, 2. Find \(\bar{x}_d\), \(s_d\) and the t statistic for \(H_0: \mu_d = 0\). Show worked answer
Deviations: 1, −1, 2, −2, 0; squares sum to 10; \(s_d = \sqrt{10/4} \approx 1.581\).
\(SE = 1.581/\sqrt{5} \approx 0.707\).
\(t = 2/0.707 \approx 2.83\) with \(df = 4\).
For \(H_a: \mu_d > 0\), the p-value is about 0.024.
ExamQ6. Bags of crisps are labelled 40 g. A random sample of 25 bags has \(\bar{x} = 39.2\) g and \(s = 2.0\) g, and a dotplot shows no strong skew or outliers. Is there convincing evidence at \(\alpha = 0.05\) that the true mean weight is less than 40 g? [6 marks] Show worked answer
Plan [2]: One-sample t-test. Random: random sample. 10%: 25 is less than 10% of all bags. Normal/Large sample: \(n = 25 < 30\), but the dotplot shows no strong skew or outliers.
Do [2]: \(SE = 2.0/\sqrt{25} = 0.4\). \(t = (39.2 – 40)/0.4 = -2.00\), \(df = 24\). p-value \(= P(t_{24} \le -2.00) \approx 0.028\).
Conclude [1]: Because the p-value of 0.028 is less than \(\alpha = 0.05\), we reject \(H_0\). We have convincing evidence that the true mean weight of these bags of crisps is less than 40 g.
Check yourself
1. Why do we use t instead of z for a mean?
2. As the degrees of freedom increase, the t distribution:
3. Twelve patients have blood pressure measured before and after a drug. The correct procedure is:
Your score: 0 out of 3
The short version
- When \(\sigma\) is unknown, use \(SE = s/\sqrt{n}\) and the t distribution with \(df = n – 1\); t has heavier tails than z and approaches it as \(df\) grows.
- Conditions: Random, 10%, and Normal/Large sample (\(n \ge 30\), or no strong skew or outliers in the sample).
- Interval: \(\bar{x} \pm t^* \frac{s}{\sqrt{n}}\). Test: \(t = \frac{\bar{x} – \mu_0}{s/\sqrt{n}}\).
- Paired data: subtract within each pair, then do a one-sample t procedure on \(\mu_d\) with \(n\) = number of pairs.
- Conclude about the true (population) mean in context, using “convincing evidence”, and respect what the design allows.
Further reading on EconTutorials
Older in-depth articles on this topic from our blog:
