Back to the on-screen lesson ·
An exact split of the total variation of several groups into a between-group part and a within-group part, with the degrees of freedom divided the same way.
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.
You will split a total sum of squares into its between-group and within-group parts, build the between-group sum from the group means weighted by group size, count the degrees of freedom each line of the table carries, and say why the decomposition needs no assumptions at all.
Unit three compared two groups. Three or more cannot be handled by repeating that comparison, for a reason the last lesson of this unit makes precise. The route instead is to split the variation in the whole data set into two pieces, using the same decomposition idea that split a regression's variation two lessons ago.
The grand mean is the mean of all the observations together. The between-group sum of squares measures how far the group means sit from the grand mean, weighted by group size. The within-group sum of squares measures how far the observations sit from their own group means. Degrees of freedom count what is left after the means have been paid for.
Write $y_{ij}$ for observation $i$ of group $j$, $\bar y_j$ for the $j$th group mean and $\bar y$ for the grand mean, with $k$ groups and $N$ observations in all. Every deviation from the grand mean splits:
$$y_{ij} - \bar y = (y_{ij} - \bar y_j) + (\bar y_j - \bar y),$$
and squaring and summing kills the cross term — because within each group the deviations from that group's own mean add to zero. What is left is
$$\underbrace{\sum_j \sum_i (y_{ij} - \bar y)^2}_{SST} = \underbrace{\sum_j n_j(\bar y_j - \bar y)^2}_{SSB} + \underbrace{\sum_j \sum_i (y_{ij} - \bar y_j)^2}_{SSW}.$$
This is an identity, true of any numbers whatever: no equal group sizes, no normality, no null hypothesis. Every unit of variation is either between the groups or inside them, and there is nowhere else for it to be.
The degrees of freedom split the same way. Between groups there are $k - 1$, one lost to the grand mean. Within groups there are $N - k$, one lost per group mean. They add to $N - 1$, the total.
The weighting by $n_j$ in the between-group sum is worth pausing on. It is what makes $SSB$ a measure of variation in the data rather than of scatter among $k$ numbers: a large group sitting far from the grand mean contributes in proportion to its size.
Another way: picture
Three clouds of dots at three different heights, with a horizontal line through the grand mean. Two rulers measure everything: one from each cloud's own centre to the grand mean line, one from each dot to its own cloud's centre. Squaring and adding both sets accounts for every dot's distance from the line, exactly.
Another way: steps
Three groups of five, with means $10$, $12$ and $17$ and a grand mean of $13$.
| Source | Sum of squares | Degrees of freedom |
|---|---|---|
| Between groups | 130 | 2 |
| Within groups | 96 | 12 |
| Total | 226 | 14 |
The between figure is $5 \times (9 + 1 + 16) = 130$: each group mean's squared distance from $13$, weighted by the five observations in the group. Both columns add down, and the total degrees of freedom are $15 - 1 = 14$, as they must be for fifteen observations about one grand mean.
Forgetting to weight by group size. The between-group sum is about the data, not about $k$ numbers. Dropping $n_j$ makes a group of one count as much as a group of a hundred.
Believing the identity needs assumptions. It is algebra. The assumptions arrive at the next step, when the sums become a test.
Counting the between-group degrees of freedom as $k$. One is lost to the grand mean, exactly as one is lost in a sample variance.
Measuring the within-group deviations from the grand mean. They are measured from each group's own mean. Using the grand mean instead computes the total and calls it the within-group part.
Four groups, $40$ observations, total sum of squares $500$, between-group $140$.
Two of the three sums given.
Within-group is $500 - 140 = 360$.
The identity.
Degrees of freedom: $3$ between, $36$ within, $39$ in total.
$k - 1$ and $N - k$.
Two groups, means $10$ and $20$, grand mean $19$; sizes $2$ and $18$.
The grand mean sits near the large group.
Between-group: $2 \times 81 + 18 \times 1 = 180$.
Weighted by size.
Unweighted it would be $81 + 1 = 82$, less than half, and would not be a sum of squares of anything in the data.
The weights are not a refinement.
The total sum of squares is $200 + 700$.
The identity.
That is $900$.
The degrees of freedom are $4$ between, $40$ within and $44$ in total.
Several groups of measurements have total sum of squares $43$, of which $26$ is the between-group part. What is the within-group part?
Answer:
$4$ groups hold $40$ observations in total. The between-group sum of squares is $12$ and the within-group sum of squares is $144$. Complete the sums of squares and the degrees of freedom.
| Sum of squares | Degrees of freedom | |
|---|---|---|
| Between groups | ||
| Within groups | ||
| Total |
$3$ groups hold $30$ observations, with a total sum of squares of $170$ of which $23$ lies between the groups. Give the within-group sum of squares and its degrees of freedom.
Within-group sum of squares: z. Degrees of freedom: d.
$5$ groups hold $50$ observations in total. Match each quantity to its value.
| $5$ | $4$ | $45$ | $49$ | |
|---|---|---|---|---|
| The number of groups | ||||
| Between-group degrees of freedom | ||||
| Within-group degrees of freedom | ||||
| Total degrees of freedom |
Three groups of $7$ observations each have means $46$, $52$ and $58$, so the grand mean is $52$. The within-group sum of squares is $67$. Give the between-group sum of squares, and the total.
| Value | |
|---|---|
| Between-group sum of squares | |
| Total sum of squares |
Lesson test: one question per skill, one attempt each, no hints. Your answers are checked when you submit.
For the $3$ groups and $30$ observations above, the total sum of squares equals the between-group part plus the within-group part. Under what conditions does that hold?
You can complete the sums of squares and the degrees of freedom of an analysis of variance table, and build the between-group sum from the group means. Say in your own words why the split is exact rather than approximate.
9. Your turn: five groups, $45$ observations, between-group sum $200$, within-group sum $700$, step 3