Instant PDF download, name-and-email checkout. Complete bundle: every Economics and Statistics book
Statistics guide, Unit 4, step 17 of 22Previous stepNext step

Step 17: One-Sample t Procedures and Paired Data

SyllabusAP Stats 4.2–4.5
In 30 seconds
  • 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.
Video lesson coming soonA short animated lesson for this step will appear here.

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.

Key termStandard error of \(\bar{x}\): \(SE = \dfrac{s}{\sqrt{n}}\), an estimate of the standard deviation of the sampling distribution of \(\bar{x}\), used when \(\sigma\) is unknown.

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:

\[ df = n – 1 \]

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.
DiagramDraw a horizontal axis centred on 0. Sketch the standard normal curve as a tall bell. Now sketch a t curve with \(df = 2\): it has a lower peak and fatter tails that stay above the normal curve further out on both sides. Add a t curve with \(df = 15\) in between the two. As \(df\) grows, the t curve rises in the middle and its tails thin out until it sits almost on top of the normal curve.

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.
Common mistakeWriting “the sample is normal” or “\(n\) is large so the data are normal”. The central limit theorem says the sampling distribution of \(\bar{x}\) is approximately normal when \(n \ge 30\); it says nothing about the data themselves. For small samples, say what you checked: “The dotplot of the sample shows no strong skew or outliers, so it is reasonable to use t procedures.”

The one-sample t-interval

\[ \bar{x} \pm t^* \frac{s}{\sqrt{n}}, \qquad df = n – 1 \]
Worked example

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.

StateEstimate \(\mu\) = the true mean hours of sleep last night for all sixth-form students at the college, with 95% confidence.
PlanOne-sample t-interval for \(\mu\). Random: random sample. 10%: 20 is less than 10% of all sixth-form students at a large college. Normal/Large sample: \(n = 20 < 30\), but the dotplot shows no strong skew or outliers.
Do 1\(df = 20 – 1 = 19,\quad t^* = 2.093\)
Do 2\(SE = \dfrac{1.2}{\sqrt{20}} \approx 0.268\)
Do 3\(6.8 \pm 2.093 \times 0.268 = 6.8 \pm 0.56,\ \text{giving } (6.24,\ 7.36)\)
ConcludeWe are 95% confident that the interval from 6.24 to 7.36 hours captures the true mean hours of sleep last night for 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\).

\[ t = \frac{\bar{x} – \mu_0}{s/\sqrt{n}}, \qquad df = n – 1 \]
Worked example

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\).

State\(H_0: \mu = 250\), \(H_a: \mu < 250\), where \(\mu\) = the true mean volume of all the chain’s large coffees, in ml. \(\alpha = 0.05\).
PlanOne-sample t-test for \(\mu\). Random: random sample. 10%: 16 is less than 10% of all large coffees sold. Normal/Large sample: \(n = 16 < 30\), but the dotplot shows no strong skew or outliers.
Do 1\(SE = \dfrac{10}{\sqrt{16}} = 2.5\)
Do 2\(t = \dfrac{244 – 250}{2.5} = -2.40,\quad df = 15\)
Do 3\(p\text{-value} = P(t_{15} \le -2.40) \approx 0.015\)
ConcludeBecause the p-value of 0.015 is less than \(\alpha = 0.05\), we reject \(H_0\). We have convincing evidence that the true mean volume of the chain’s large coffees is less than 250 ml.

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.

Key termPaired t procedure: a one-sample t interval or test applied to the differences \(d\) within each pair, with parameter \(\mu_d\) (the true mean difference), \(t = \dfrac{\bar{x}_d – 0}{s_d/\sqrt{n}}\) and \(df = n – 1\), where \(n\) is the number of pairs.
Worked example

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:

Student12345678
Before6270556874596671
After6772616680647075
\(d\) = After − Before526−26544

At \(\alpha = 0.05\), is there convincing evidence that the workshop raises scores on average?

State\(H_0: \mu_d = 0\), \(H_a: \mu_d > 0\), where \(\mu_d\) = the true mean improvement (after minus before) for students like these. \(\alpha = 0.05\).
PlanPaired t-test for \(\mu_d\). Random: random selection of students. 10%: 8 is less than 10% of all such students. Normal/Large sample: \(n = 8 < 30\), but a dotplot of the differences shows no strong skew or outliers.
Do 1\(\bar{x}_d = \dfrac{30}{8} = 3.75,\quad s_d \approx 2.659\)
Do 2\(SE = \dfrac{2.659}{\sqrt{8}} \approx 0.940,\quad t = \dfrac{3.75 – 0}{0.940} \approx 3.99,\quad df = 7\)
Do 3\(p\text{-value} = P(t_7 \ge 3.99) \approx 0.003\)
ConcludeBecause the p-value of 0.003 is less than \(\alpha = 0.05\), we reject \(H_0\). We have convincing evidence that the true mean score is higher after the workshop than before, for students like these.

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.

Common mistakeTreating paired data as two independent samples. If the same people are measured twice, or individuals are deliberately matched, use the differences. Another slip: forgetting to say which way you subtracted. Write “\(d\) = after − before” so that a positive \(\mu_d\) means an improvement.

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.
Exam tipFor an AP Statistics FRQ, follow State–Plan–Do–Conclude. State the hypotheses with \(\mu\) or \(\mu_d\) defined in context, including units. Plan: name the procedure (“one-sample t-test” or “paired t-test”) and check Random, 10% and Normal/Large sample; for \(n < 30\), refer to a graph of the data (or of the differences for paired data). Do: show \(t\), \(df\) and the p-value. Conclude: “Because the p-value of 0.015 is less than \(\alpha = 0.05\), we reject \(H_0\). We have convincing evidence that the true mean…”. Cambridge and IB questions use the same t statistic with \(n – 1\) degrees of freedom; show the critical value or p-value you compared with.

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
\(df = 12 – 1 = 11\).
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
\(SE = \dfrac{s}{\sqrt{n}} = \dfrac{8}{\sqrt{16}} = \dfrac{8}{4} = 2\) minutes.
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
\(df = 9\), and for 90% confidence \(t^* = 1.833\).
\(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
No. The sample size is small (\(15 < 30\)), so the central limit theorem cannot be relied on, and the sample shows strong skewness and an outlier. The Normal/Large sample condition is not met, so a t-interval may not be accurate.
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
\(\bar{x}_d = (3 + 1 + 4 + 0 + 2)/5 = 10/5 = 2\).
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
State [1]: \(H_0: \mu = 40\), \(H_a: \mu < 40\), where \(\mu\) = the true mean weight (g) of all bags of these crisps.
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?

Using \(s\) adds uncertainty, so we need the heavier-tailed t distribution.

2. As the degrees of freedom increase, the t distribution:

With more data, \(s\) estimates \(\sigma\) better, so the tails thin out towards the normal curve.

3. Twelve patients have blood pressure measured before and after a drug. The correct procedure is:

Same patients measured twice is paired data: analyse the 12 differences.

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.
Want more questions like these, with worked answers?
The practice book has hundreds more, graded from easy to exam level.
Next: step 18 of 22Comparing Two Groups