Hypothesis test
The coefficient of determination, R2, summarises the proportion of variation in the data that can be explained by differences between the groups. It does not however indicate whether this is bigger than could be expected by chance. Formally, we want to test whether the group means are the same:
H0 : µi = µj for all i and j
HA: µi ≠ µj for at least some i, j
This hypothesis test also depends on the sums of squares but uses them in a different way.
The hypothesis test cannot be fully explained here. You should use computer software to evaluate the p-value for the test, but we will briefly describe some of the steps.
Mean sums of squares
The first step in evaluating the p-value for the test is to divide each of the three sums of squares by a value called its degrees of freedom to obtain a mean sum of squares.
![]() |
The mean total sum of squares is the sample variance of the response (ignoring groups). |
![]() |
The mean within-group sum of squares is the pooled estimate of the variance within groups. |
![]() |
The mean between-group sum of squares is harder to directly interpret. |
We explained earlier that the total sum of squares equals the sum of the within-group and between-group sums of squares. Note that the same relationship also holds for the degrees of freedom (the denominators of the above definitions) — the total degrees of freedom are the sum of the within-group and between-group degrees of freedom.
F ratio and p-value
The test statistic is the ratio of the between- and within-group mean sums of square. It is called an F-ratio.
This test statistic compares between- and within-group variation:
Large values of F suggest that H0 does not hold — that the group means are not the same.
The p-value for the test gives the probability of such a high F ratio if H0 is true (all group means are the same). It is based on a standard distribution called an F distribution and is interpreted in the same way as other p-values.
The closer the p-value to zero, the stronger the evidence that H0 does not hold.
Analysis of variance table
The calculations are usually presented in a table called an analysis of variance table. (This is often abbreviated to an anova table.)
Illustration of calculations
The dot plots on the left below show 3 numerical measurements from each of 4 groups.
The slider adjusts the relative size of the between-group and within-group sums of squares. Observe how this affects the p-value for the test.
Use the pop-up menu to increase the sample size and observe that a smaller amount of explained variation is needed to obtain a small p-value (and hence strong evidence that the underlying group means are different).