Menu
Sign up Sign in

AI HL · 13.4

Hypothesis Testing

13.4.13

The paired-sample t-test

13.4.13

The paired-sample t-test

Target: I can tell from the wording when two samples are paired, and say one advantage of a paired test. (+4 more)

By the end of this section

Key points

When data are paired

  • Data are paired when each value in one sample belongs with one value in the other: the same person measured twice, or two matched subjects. The samples have the same size.
  • Advantage of pairing: it removes the differences between individuals, so the test detects only the change.
  • If the samples are separate groups of different people, use the two-sample test, not the paired test.

Carrying out the test

  • Find one difference for each pair, d = after − before (or sample 1 − sample 2). Keep the same order for every pair and write the order down.
  • Test the list of differences with a one-sample t-test. H0: μ_d = 0. H1: μ_d > 0, μ_d < 0 or μ_d ≠ 0, so that the sign matches the order of subtraction.
  • Choose the tail that matches H1, read the p-value and compare it with the significance level.
  • Reject H0 if p < α. Write the conclusion in context.

Assumption

  • The population of differences is normally distributed. It is the differences, not the original values, that must be normal.
  • Use the pairs to choose the test, but write the hypotheses about μ_d, the population mean difference.

On the calculator

A paired t-test

  • Enter the differences in a list, or make the list as the difference of the two data lists.
  • Choose the one-sample t-test. Enter μ0 = 0 and the list of differences.
  • Choose the tail from H1 and read t and the p-value.

Screenshot and video to come

Explore: t-tests for means

Each dot is one value. Drag the orange marker under a sample to move it, and the teal point at the end of its bracket to change how spread out it is. The curve below is the t distribution: the orange area is the p-value.

Sample means
Estimates of σ
Pooled estimate, sₚ
Degrees of freedom
t
p-value for H₁:

The test assumes the population (for a paired test, the differences) is normally distributed; two samples also need equal variances. The markers move with the mouse, a finger, or the arrow keys once selected (Tab).

Drag a marker to start.

  1. Drag the orange marker until the sample mean equals the value in H₀ (or the two means are equal). What are t and the p-value? Why?
  2. Keep the means where they are and drag a teal point to make the sample less spread out. What happens to t and to the p-value? Why does the spread matter as much as the difference?
  3. Choose H₁ in the other direction from the sample. Why does the p-value become large?
  4. In Paired, each dot is one person's change. Why is testing these differences better than treating the before and after values as two samples?

Worked examples

Problems like the ones in class. Pick one, try it, then open the working.
Why the data are paired, and the differences

A coach times six sprinters over 100 m before and after a training programme. Times in seconds. Before: 11.8, 12.4, 11.5, 12.9, 12.1, 12.6. After: 11.6, 12.3, 11.5, 12.5, 12.0, 12.3. She wants to test whether the programme reduces the mean time. Form the differences, state the hypotheses and state one advantage of a paired test over an unpaired test.

Working
  1. Pairs

    The same six sprinters are timed twice

    Each 'before' time belongs with one 'after' time. These are paired data, not two independent samples.

  2. Differences

    d = after − before: −0.2, −0.1, 0, −0.4, −0.1, −0.3

    Form one new list. Choose the order once and keep it for every pair.

  3. Hypotheses

    μ_d is the population mean change in time. H0: μ_d = 0, H1: μ_d < 0

    No change under H0. The programme reduces the time, so d is negative: a lower tail.

  4. Advantage

    A paired test removes the differences between sprinters, so it detects only the change caused by the programme.

    Some sprinters are faster than others. Pairing stops that spread from hiding the effect.

Video walkthrough coming
A paired test, lower tail

A physiotherapist tests whether a stretching routine reduces the time, in minutes, that 8 runners take to run 1 km. Before: 5.42, 5.15, 6.01, 5.78, 5.33, 5.9, 5.6, 5.25. After: 5.31, 5.12, 5.85, 5.8, 5.21, 5.72, 5.49, 5.2. Assume that the differences are normally distributed. Test, at the 5% significance level, whether the routine reduces the mean time.

Working
  1. Differences

    d = after − before: −0.11, −0.03, −0.16, 0.02, −0.12, −0.18, −0.11, −0.05

    Enter these in a list.

  2. Hypotheses

    μ_d is the population mean change in time. H0: μ_d = 0, H1: μ_d < 0

    The routine reduces the time, so the mean difference is below 0.

  3. From the calculator

    t-test on the list d, μ0 = 0, μ < μ0: t = −3.87, p = 0.00306

    A paired test is a one-sample t-test on the differences.

  4. Conclusion

    0.00306 < 0.05, so reject H0. There is sufficient evidence, at the 5% significance level, that the stretching routine reduces the mean time to run 1 km.

    Answer in context.

Video walkthrough coming
A paired test, upper tail

A shop tests new packaging in 7 stores. The weekly sales, in units, in each store were recorded before and after the change. Before: 212, 185, 240, 198, 225, 170, 205. After: 221, 190, 243, 209, 224, 181, 214. Assume that the differences are normally distributed. Test, at the 5% significance level, whether the new packaging increases mean weekly sales.

Working
  1. Differences

    d = after − before: 9, 5, 3, 11, −1, 11, 9

    A rise in sales gives a positive d.

  2. Hypotheses

    μ_d is the population mean change in weekly sales. H0: μ_d = 0, H1: μ_d > 0

    An increase is an upper tail.

  3. From the calculator

    t-test on the list d, μ0 = 0, μ > μ0: t = 3.92, p = 0.00392

    Pick the tail that matches H1.

  4. Conclusion

    0.00392 < 0.05, so reject H0. There is sufficient evidence, at the 5% significance level, that the new packaging increases mean weekly sales.

    Answer in context.

Video walkthrough coming
The assumption

In the shop example above, state the distributional assumption needed for the paired t-test to be valid.

Working
  1. What is tested

    A one-sample t-test on d

    The differences are the single sample.

  2. Assumption

    The population of differences is normally distributed.

    It is the differences that must be normal. The before and after values need not be.

Video walkthrough coming