Comparing two means with t and F tests

Ask the tutor about Comparing two means with t and F testsOpen the graphing workbench

Empirical correlation and regression asks whether two measurement sequences move together. The second basic question is different: do the underlying random variables differ in a way that matters? This page checks the standard deviations first, then the means.

Both tests below assume the two series come from normally distributed random variables and , the case a probability-paper check is meant to clear. Write the series as and , with empirical means and empirical standard deviations and .

Square the larger spread

Form the ratio of the larger empirical standard deviation to the smaller one, and square it:

Look up the bold-faced table value with degrees of freedom and .

  • If , the standard deviations are not the same; the difference has a deeper meaning.
  • If , take the standard deviations as essentially the same.

Both statements carry an error probability of : in about such situations, roughly two conclusions will be wrong.

Example. The medicine table below has and , so . For the table gives . Because , treat the two spreads as the same.

Drag and . The blue point sits at on the axis; the gray mark is the critical value .

Drag the two empirical standard deviations Δx and Δy. The blue mark is F = (larger/smaller)². The gray mark is the critical value 3.7 for m₁ = m₂ = 14. Defaults Δx = 5 and Δy = 4 give F = 1.6, left of the critical mark.

A shared spread turns the mean gap into

Now assume, in addition, that the two normal variables share one standard deviation (the F-test just checked that). Form

Choose a small error probability and look up with .

  • If , the means of and differ significantly; the gap is not just random scatter.
  • If , the means do not differ significantly.

An error probability means that in such tests, about conclusions will be wrong. Taking therefore risks being wrong about once in a hundred times.

Example. Fifteen patients on medicine A and fifteen on medicine B give

mean
medicine A
medicine B

(The means are days until recovery.) Substituting into the formula with the positive gap yields . For and , the -table gives . Because , the means differ significantly: medicine A is better than B.

Drag the mean gap and the two spreads. The blue point sits at ; the gray mark is the critical value . Passing that mark to the right is the significant-difference case.

Drag the mean gap |ȳ − x̄| and the two spreads Δx, Δy, with n₁ = n₂ = 15 fixed. The blue mark is the t-statistic. The gray mark is the critical value 2.8 for α = 0.01 and m = 29. Defaults gap = 6, Δx = 5, Δy = 4 give t ≈ 3.6.

Drop normality and the t-test stops

The -test applies only to normally distributed quantities. The Wilcoxon test is much more general: it can check whether two sequences come from variables with different distributions. A fuller account of that test comes later. The numerical and tables themselves belong to a later section.

Spot a mistake in this page?