9477 / 2027

Lesson 7 of 9 / Practical and data skills

Compare two sample means with a t-test

Is a difference between two means large relative to the variation?

I can use the supplied unpaired t-test equation and table to evaluate a difference between means.

About 8 min

Make a guess. You are not marked.

Two seedling groups differ in mean length by 3 mm. Is that a meaningful difference?

  1. A difference in means is meaningful.
  2. 3 mm is too small to matter.
  3. It depends on the spread and sample sizes.
Show the answer

It depends on the spread and sample sizes.

A t-test compares the difference in means with the variation within groups.

The key idea

An unpaired t-test compares a difference between means with the variation and sizes of two independent samples.

Work with the evidence

Compare the gap with the variation

AB024681012Length / cm

Magnitude of t = 4.00 / 1 = 4.00; degrees of freedom = 8

Mean A = 5 cm; mean B = 9 cm. Both sample variances are 2.5 cm2 and n = 5 for each group. The t magnitude exceeds the two-sided 5% critical value 2.306: reject the no-difference null under the test assumptions.

The samples are illustrative independent observations. Their spread and sizes stay fixed while the second mean changes. A test decision alone does not establish treatment causation.

Explanation

Use an unpaired t-test for a suitable numerical measurement from two independent samples, such as lengths of different seedlings grown under two treatments. The null hypothesis states no difference between the underlying population means. Measuring the same individuals before and after a treatment gives paired data and does not match this unpaired design.

The method used here assumes independent observations, approximately normal underlying distributions and similar population variances. For the equation supplied in the syllabus, calculate the difference between sample means and divide by the square root of (s1 squared / n1 + s2 squared / n2). Use the magnitude of t when comparing a difference in either direction with a two-sided table.

Suppose the first five lengths are 3, 4, 5, 6 and 7 cm and the second five are 7, 8, 9, 10 and 11 cm. The means are 5 and 9 cm, and both sample standard deviations are about 1.58 cm. The denominator is square root of (2.5/5 + 2.5/5) = 1 cm, so the magnitude of t is 4.

For this syllabus method, degrees of freedom are n1 + n2 - 2, giving 8. A two-sided 5% critical value is about 2.306. Since 4 is greater than 2.306, reject the no-difference null hypothesis at this level. The observed difference is statistically significant under the test assumptions.

Significance does not prove that the treatment caused the difference. Random allocation, suitable controls and representative sampling matter to that inference. Nor does significance state whether the difference is biologically large or useful. Report the direction and size of the difference alongside the test decision.

Step by step
  1. 1

    Match the test to the design

    Check numerical data, independent samples and the stated distribution/variance assumptions.

  2. 2

    Substitute into the supplied equation

    Use the two means, sample standard deviations and sample sizes; compare the magnitude of t.

  3. 3

    Read the table and conclude

    Use n1 + n2 - 2 and the chosen significance level, then describe the difference and its limits.

Worked example

Work through the evidence

Two independent samples each contain 5 seedlings. Their means are 5.0 and 5.6 cm and each sample variance is 2.5 cm2. Use a two-sided 5% critical value of 2.306.

One way to explain it

The denominator is square root of (2.5/5 + 2.5/5) = 1 cm. The magnitude of t is 0.6/1 = 0.60, with 8 degrees of freedom. Since 0.60 is below 2.306, there is insufficient evidence of different population means at 5%. This does not establish that the means are identical.

Why this answer works
  • Use the variances as s squared in the supplied equation.
  • Choose the correct degrees of freedom.
  • A small observed difference can remain inconclusive.

Watch out for this

A student says: "If one sample mean is higher, the difference must be statistically significant." What is wrong with this?

Show the answer

The decision depends on the difference relative to variation and sample size, assessed against the relevant critical value. Unequal sample means alone are not enough.

Check your understanding

Which situation matches an unpaired t-test?

  1. Lengths of independently sampled seedlings from two treatment groups
  2. Height of each seedling before and after treatment
  3. Counts of purple and white offspring against a predicted ratio
Show the answer

Lengths of independently sampled seedlings from two treatment groups

provided the other test assumptions are reasonable. Each group contains different independent individuals.

Quick recall

Card 1 of 3. Answer in your head, then check.

Is a difference between two means large relative to the variation?

You can return to this lesson any time.