Math Core

Lesson 7.4 · Inference for Means

Paired data

Does a typing course actually make people faster? One approach is to measure each person's speed before and after the course. Because each "before" value is linked to one specific "after" value, the data come in pairs, and the smart move is to analyze the differences. This lesson shows why that works so well and how it turns a two-measurement problem into the one-sample tt procedures you already know.

What makes data paired

Definition

Paired data

Data are paired when each observation in one group is naturally matched with exactly one observation in the other group. Common sources of pairing:

  • the same individual measured twice (before and after, left hand and right hand, two treatments in random order);
  • matched pairs of different individuals who are similar in important ways (twins, siblings, subjects matched by age and fitness), with one of each pair getting each treatment.

The test for pairing is simple: could you draw a line connecting each value in one list to one specific value in the other list, for a reason built into the study design? If yes, the data are paired. If the two groups were chosen or assigned separately, the data are two independent samples (next lesson).

Why analyze differences?

People differ a lot from one another. Some typists are fast and some are slow, and that person-to-person variation is much bigger than the improvement a course might produce. If you compared the whole "before" group to the whole "after" group, that large variation would drown out the effect.

When you subtract within each pair, each person serves as their own control. A fast typist's high speed shows up in both measurements and cancels out. What's left is the change, which is exactly what you care about.

Paired t procedures

For paired data, compute the difference dd for each pair (always in the same order), and then use one-sample tt procedures on the differences.

  • Parameter: μdiff\mu_{\text{diff}}, the true mean difference.
  • Interval: xˉdiff±t∗sdiffn\bar{x}_{\text{diff}} \pm t^* \dfrac{s_{\text{diff}}}{\sqrt{n}}.
  • Test statistic: t=xˉdiff−0sdiff/nt = \dfrac{\bar{x}_{\text{diff}} - 0}{s_{\text{diff}} / \sqrt{n}}, usually testing H0:μdiff=0H_0: \mu_{\text{diff}} = 0.

Here nn is the number of pairs, and df=n−1df = n - 1.

Conditions for paired data

The conditions are the one-sample conditions, applied to the differences.

  • Random: the pairs are a random sample, or the treatments were randomly assigned within each pair (for example, a random order for the two treatments).
  • 10%: when sampling without replacement, the number of pairs is at most 10% of the population.
  • Normal/Large Sample: the population of differences is approximately normal, or the number of pairs is at least 30. With fewer than 30 pairs, graph the differences and check for strong skewness and outliers.

Common mistake

Check normality on the differences, not on the "before" and "after" lists separately. Two skewed lists can have perfectly well-behaved differences, and the differences are the only data the procedure uses.

A complete paired test

Worked example: Does the typing course help?

Eight randomly selected employees took a typing course. Their speeds in words per minute:

Employee12345678
Before4251384755404944
After4653434760455049
Difference (after − before)42505515

Do the data give convincing evidence at α=0.05\alpha = 0.05 that the course increases mean typing speed?

State. H0:μdiff=0H_0: \mu_{\text{diff}} = 0 and Ha:μdiff>0H_a: \mu_{\text{diff}} > 0, where μdiff\mu_{\text{diff}} is the true mean increase in typing speed (after − before, in wpm) for employees who take the course.

Plan. Paired tt test.

  • Random: the employees were randomly selected.
  • 10%: 88 is less than 10% of all employees at the company.
  • Normal/Large Sample: there are only 88 pairs, so graph the differences.
012345✕✕✕✕✕✕✕✕
Differences in typing speed (wpm)

The dotplot is somewhat left-skewed but has no outliers, so the paired tt test is reasonable.

Do. For the differences, xˉdiff=3.375\bar{x}_{\text{diff}} = 3.375 and sdiff≈2.066s_{\text{diff}} \approx 2.066.

SE=2.0668≈0.7304,t=3.375−00.7304≈4.62,df=7.SE = \frac{2.066}{\sqrt{8}} \approx 0.7304, \qquad t = \frac{3.375 - 0}{0.7304} \approx 4.62, \qquad df = 7.

P-value =P(t>4.62)≈0.0012= P(t > 4.62) \approx 0.0012.

Conclude. Because 0.0012<0.050.0012 < 0.05, we reject H0H_0. There is convincing evidence that the course increases mean typing speed for employees like these.

Here is the tt-table excerpt you'll need.

dfdftail 0.05tail 0.025tail 0.01tail 0.005
confidence90%95%98%99%
52.0152.5713.3654.032
71.8952.3652.9983.499
141.7612.1452.6242.977

Worked example: Estimating the size of the effect

Construct a 95% confidence interval for the mean increase in typing speed from the previous example.

Solution. With df=7df = 7, t∗=2.365t^* = 2.365.

3.375±2.365(0.7304)≈3.375±1.727=(1.65, 5.10).3.375 \pm 2.365(0.7304) \approx 3.375 \pm 1.727 = (1.65,\ 5.10).

We are 95% confident that the interval from about 1.61.6 to 5.15.1 words per minute captures the true mean increase in typing speed for employees who take the course. The interval lies entirely above 00, which is consistent with the test.

Notice what would happen if you ignored the pairing. The "before" speeds have a standard deviation of about 5.85.8 wpm, far larger than the differences' 2.072.07. A two-sample analysis would use that big person-to-person variation and could easily miss the improvement.

Tip

Say the order of subtraction out loud, and define μdiff\mu_{\text{diff}} with it: "after − before." Then check that the sign of HaH_a matches. If the course helps, after − before should be positive, so Ha:μdiff>0H_a: \mu_{\text{diff}} > 0.

Practice

Practice 1

Which study produces paired data?

Practice 2

Six randomly chosen students solved a logic puzzle before and after a week of practice. Their times in minutes:

StudentABCDEF
Before12.110.413.89.911.512.6
After11.310.612.59.111.011.8

Find the mean difference xˉdiff\bar{x}_{\text{diff}} (before − after), to 3 decimal places.

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 3

In a paired study of 1515 patients, the mean drop in systolic blood pressure after a new diet was xˉdiff=2.4\bar{x}_{\text{diff}} = 2.4 mmHg with sdiff=3.1s_{\text{diff}} = 3.1 mmHg. Find the tt statistic for H0:μdiff=0H_0: \mu_{\text{diff}} = 0, to 2 decimal places.

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 4

For the blood pressure study in the previous problem, Ha:μdiff>0H_a: \mu_{\text{diff}} > 0 and t≈3.00t \approx 3.00. Find the P-value to 4 decimal places.

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 5

Using the same study (n=15n = 15 pairs, xˉdiff=2.4\bar{x}_{\text{diff}} = 2.4, sdiff=3.1s_{\text{diff}} = 3.1), construct a 95% confidence interval for the true mean drop in blood pressure. Enter the endpoints to 2 decimal places, separated by a comma.

Separate answers with commas, e.g. 2, -5

Practice 6

The P-value for the blood pressure study is about 0.00480.0048. Which is the best conclusion at α=0.05\alpha = 0.05?

Practice 7

A student analyzes the typing-course data from this lesson by treating "before" and "after" as two independent samples. Why is that a poor choice?

Practice 8

A researcher has paired data from 1212 subjects. Which graph should she examine to check the Normal/Large Sample condition for a paired tt test?