Back to the on-screen lesson ·

The F test for several means

Two estimates of one variance, their ratio, and a single test at a single level for the hypothesis that several group means are all equal.

Paper packet. Every task here also exists on screen, where it is checked automatically; answers written on paper are not assessed by Nydus. When you are back at a device, enter your answers there.

1. What you will learn

You will turn two sums of squares into two mean squares, form the F statistic, and compare it with the F distribution on the right pair of degrees of freedom. You will also say what the ratio is invariant to, which procedure a given design calls for, and what a significant F does not tell you.

2. From two sums to one test

The last lesson split the variation and counted the degrees of freedom. Those are the raw materials; nothing in them is yet a test. This lesson turns them into one, using the same idea as every test so far — a statistic whose distribution is known when the null is true.

3. Words for this lesson

A mean square is a sum of squares divided by its own degrees of freedom, and is an estimate of a variance. The F statistic is the between-group mean square over the within-group one. The F distribution has two degrees of freedom parameters, the numerator's and the denominator's, in that order. The test is one-sided in the upper tail, because only large ratios argue against equal means.

4. A ratio of two estimates of the same variance

With $k$ groups and $N$ observations, divide each sum of squares by its own degrees of freedom:

$$MSB = \frac{SSB}{k - 1}, \qquad MSW = \frac{SSW}{N - k}, \qquad F = \frac{MSB}{MSW}.$$

Both are estimates of a variance. $MSW$ pools the variance inside the groups and estimates $\sigma^{2}$ whether or not the means differ. $MSB$ estimates $\sigma^{2}$ only if the means are equal; when they are not, it estimates $\sigma^{2}$ plus a term that grows with how far apart they are.

So under $H_0: \mu_1 = \cdots = \mu_k$ the two estimate the same quantity and their ratio hovers near $1$, following the $F_{k-1,\,N-k}$ distribution. When the means differ the numerator is inflated and the ratio climbs. The test is therefore one-sided in the upper tail: a ratio well below one is not evidence of anything except unusually similar group means.

The ratio has no units, because a variance divided by a variance has none. Adding a constant to every observation leaves every deviation alone and changes neither mean square; multiplying every observation by a constant multiplies both by its square and cancels. One table of critical values therefore serves every measurement scale in every subject.

Three assumptions are doing work, and none of them was needed for the decomposition itself: the observations are independent, the groups share a common variance, and the errors are approximately normal. The second is the one to watch, because $MSW$ pools across groups and a group with a much larger spread than the others quietly dominates it.

Another way: picture

Three clouds of dots at three heights. Ask two questions of the picture: how far apart are the cloud centres, and how fat is each cloud? Three tight clouds far apart look convincing; three fat clouds the same distance apart look like nothing at all. F is exactly the ratio of those two impressions, made into a number.

Another way: steps

  1. Divide each sum of squares by its own degrees of freedom.
  2. Put the between-group mean square over the within-group one.
  3. Compare with the F distribution on those two degrees of freedom.
  4. Read the P-value from the upper tail only.

5. A table, completed

Three groups of five, from the last lesson.

SourceSum of squaresDegrees of freedomMean squareF
Between groups1302658.13
Within groups96128
Total22614

Each mean square divides along its own row; the ratio then reads across. The total row has no mean square worth computing — it would be the sample variance of all fifteen observations ignoring the groups, which is not a quantity this test uses. An F of $8.13$ on $(2, 12)$ degrees of freedom has a P-value near $0.006$: the group means differ.

6. Where this goes wrong

Dividing each sum by the wrong degrees of freedom. Each line has its own, and swapping them changes F by a large factor.

Putting the within-group mean square on top. The evidence lives in the upper tail, so an inverted ratio gives a test with no power at all.

Reading a small F as evidence that the means are equal. It is a failure to find evidence that they differ, and a study with wide groups fails whatever the truth.

Reading a significant F as saying which means differ. It says they are not all equal. Which ones is the next lesson.

Ignoring unequal variances. The pooled within-group mean square assumes one common variance, and a single wide group can dominate it.

7. From sums to a verdict

  1. Four groups, $40$ observations: $SSB = 90$ on $3$, $SSW = 360$ on $36$.

    Degrees of freedom from the design.

  2. $MSB = 30$, $MSW = 10$, so $F = 3$.

    Each divides along its own row.

  3. On $(3, 36)$ degrees of freedom the $5\%$ critical value is about $2.87$, so the null of equal means is rejected — just.

    Upper tail only.

8. The same means, wider groups

  1. The same four group means but four times the spread inside each group: $SSW = 1440$.

    The numerator does not move.

  2. $MSW = 40$, so $F = 30/40 = 0.75$.

    Below one.

  3. Nothing is rejected, and nothing should be: the same separation of means is now unremarkable against the noise.

    This is what F is for.

9. Your turn: $SSB = 120$ on $4$ degrees of freedom, $SSW = 300$ on $50$

  1. $MSB = 120/4$ and $MSW = 300/50$.

    Each along its own row.

  2. That is $30$ and $6$.

  3. Your turn: work this step out. Its working is at the end of the packet.

    So $F = 30/6 = 5$, on $(4, 50)$ degrees of freedom.

10. Guided practice

$4$ groups hold $28$ observations. The between-group sum of squares is $18$ on $3$ degrees of freedom, and the within-group sum of squares is $72$ on $24$ degrees of freedom. Complete the three lines below.

Value
Between-group mean square
Within-group mean square
The F statistic

11. Guided practice

The between-group mean square is $12$ and the within-group mean square is $3$. What is the F statistic?

Answer:

12. Practice

$3$ groups hold $24$ observations. The between-group sum of squares is $10$ and the within-group sum of squares is $21$. Give the two mean squares.

Between-group mean square: a. Within-group mean square: b.

13. Practice

$3$ groups of measurements, $30$ observations in all, are to be compared. Put the steps of the analysis into the order they are carried out.

Number the steps in order (write the number in the box):

14. Somewhere new

An analysis of variance has been carried out. Match each change to the data with its effect on the F statistic.

The between-group mean square rises alone, so the ratio risesThe within-group mean square rises alone, so the ratio fallsEvery deviation is untouched, so both mean squares and the ratio are unchangedBoth mean squares are multiplied by $9$, so the ratio is unchanged
The group means are pushed further apart; the spread inside the groups is unchanged
The observations inside each group are made more variable; the group means are unchanged
Add $3$ to every observation
Multiply every observation by $3$

15. Lesson test

Lesson test: one question per skill, one attempt each, no hints. Your answers are checked when you submit.

16. Test question

A study measures the same twenty patients measured before and after a treatment. Which procedure does it call for?

17. What you can do now

You can complete an analysis of variance table through to the F statistic and say which design calls for which procedure. Say in your own words why the evidence against equal means lies in the upper tail only.

Working for the steps left to you

9. Your turn: $SSB = 120$ on $4$ degrees of freedom, $SSW = 300$ on $50$, step 3