Paired and two-sample tests

Test a mean difference with a paired t-test and compare two independent means with a normal test.

More
Reading settings

Read offline with Premium

Save lessons and figures on this device with Premium.

Connect at least once every 30 days to confirm Premium. Topic checks, coaching and sync need a connection.

On this page

Reading settings

Appearance and reading tools for your lessons.

Live preview

Take a moment to read at your own pace. Choose the font and spacing that feel comfortable for you.

Pause after each idea, then explain it in your own words before moving on.

Narrower lines take effect when the screen has room.

Colour theme
Reading font
Line spacing
Reading width
Section links
Worked examples

Open example banners when a lesson starts. Hints and solutions stay closed until you open them.

Checking Premium access…

Explore Premium
Revision Mode

Hide questions, activities and worked examples to read the notes. Turn off to show the full lesson.

Checking Premium access…

Explore Premium

Enlarged diagram

Comparing two groups is one of the most common uses of statistics: before and after a treatment, method A against method B, one school against another. The right test depends on the design. If each observation in one sample is matched with one in the other, the differences form a single sample; if the samples are independent, the test compares two means. This lesson carries out a paired t-test and a two-sample normal test, justifies each from the design and the sample sizes, and shows what goes wrong when the design is misread.

Paired data become one sample

When each observation in one sample is matched with one in the other, such as the same person before and after, the differences d = x after -x before carry the information. Pairing removes the variation between people. Test H₀:μd = 0 with a one-sample t-test on the differences, assuming they come from a normal population:

t = (d bar -0)/(sd/square root of n), with n-1 degrees of freedom.

Worked example 1

Does a training plan raise scores?

Six athletes were scored before and after a training plan. The improvements (after minus before) were 3, 5, -1, 4, 2, 5. Assuming the improvements are normally distributed, test at the 5% level whether the plan increases the mean score.

Show full solutionHide solution
  1. Hypotheses and statistics

    Method

    H₀:μd = 0 against H₁:μd > 0, a one-tailed paired t-test.

    Reason

    The same athletes were measured twice, so the pairs are matched.

    Working

    Answer

    d bar = 3 and sd² = 26/5 = 5.2, so sd ≈ 2.280 and

    t = 3/(2.280/square root of 6) ≈ 3.223.
  2. Decide

    Method

    The one-tailed 5% critical value of t₅ is 2.015.

    Reason

    3.223 > 2.015 (equivalently, p ≈ 0.012).

    Working

    Answer

    Reject H₀: there is evidence at the 5% level that the training plan increases the mean score.

Independent samples use a difference of means

For independent samples from two populations, test H₀:μ₁ = μ₂ with

z = (x bar ₁-x bar ₂)/(square root of (σ₁²/n₁ + σ₂²/n₂)),

which is standard normal when both populations are normal with known variances. For large samples from any populations, the central limit theorem justifies the same test with the sample variances s₁², s₂² in place of σ₁², σ₂².

Check your understanding 1

Two classes, one test

Independent random samples of students from two schools sat the same test. School A: n₁ = 50, x bar ₁ = 72.4, s₁ = 8. School B: n₂ = 60, x bar ₂ = 68.9, s₂ = 10. Test at the 5% level whether the mean scores differ.

Show answerHide answer

H₀:μA = μB, H₁:μA ≠ μB. Both samples are large, so by the central limit theorem the difference of sample means is approximately normal and the sample variances can be used.

z = (72.4-68.9)/(square root of (64/50 + 100/60)) ≈ 3.5/1.717 ≈ 2.039.

2.039 > 1.960 (two-tailed p ≈ 0.041), so reject H₀: there is evidence at the 5% level that the mean scores of the two schools differ.

Spot the mistake 1

The wrong test for the design

About 5 min

Ten patients each had their blood pressure measured before and after a new drug. A student treats the before and after readings as two independent samples. Explain why this is the wrong design, and what effect it can have.

Write your answer, then compare it with the solution

Show full solutionHide solution
  1. Identify the pairing

    Method

    Each patient gives one before and one after reading, so the readings are matched.

    Reason

    The two samples are not independent: a patient with high blood pressure before is likely to be high after.

    Working

    Answer

    Use a paired t-test on the ten differences. Treating them as independent mixes the large differences between patients into the variance, which can hide a real effect of the drug.

Common mistakes

  • Using a two-sample test on paired data, which mixes the variation between individuals into the standard error.
  • Taking the degrees of freedom of a paired test as 2n-2; there are n differences, so n-1 degrees of freedom.
  • Defining differences one way (after minus before) and stating H₁ for the other direction.
  • Using the two-sample normal test with small samples and unknown variances without a stated justification.
  • Concluding that the treatment caused the change when the design does not control for other factors.

Before you move on

Check your understanding 2

Reading speed before and after a course

Eight students each read a passage before and after a speed-reading course. The increases in reading speed, in hundreds of words per minute, are

1.2, -0.4, 2.1, 0.8, 1.5, 0.3, 1.0, 0.9.

Assuming the increases are normally distributed, test at the 5% level whether the course increases mean reading speed. The one-tailed 5% critical value of t₇ is 1.895.

Conclusion at the 5% level

Show answerHide answer

H₀:μd = 0 and H₁:μd > 0, where μd is the population mean increase. For the differences, d bar = 0.925 and sd ≈ 0.75166, so

t = 0.925/(0.75166/square root of 8) ≈ 3.48.

Since 3.48 > 1.895 (p ≈ 0.005), reject H₀. There is sufficient evidence at the 5% level that the course increases mean reading speed, assuming the increases are normally distributed.

Questions

Open the discussion

Syllabus and review details

Last reviewed:

Back to top