Why Compare Expected Mean Squares?
In one-way ANOVA, variation is separated into a between-group part and a within-group part. The between-group mean square reflects how far group means are from the grand mean; the within-group mean square reflects variation among observations within their groups. When the populations have a common mean and a common variance, both mean squares have the same expected value: that common variance.
This is a statement about repeated samples, not a claim that the two calculated mean squares must match in any one data set. A particular sample can produce a larger between-group mean square, a larger within-group mean square, or equal values. The expected values describe what each calculation averages to over repetitions of the sampling process under a specified model.
Let \(\bar{Y}_i\) be the sample mean in group \(i\), and let \(\bar{Y}_{..}\) be the weighted grand mean, \(\bar{Y}_{..}=\sum_i n_i\bar{Y}_i/N\). The between-group sum of squares is \(SSB=\sum_i n_i(\bar{Y}_i-\bar{Y}_{..})^2\), and the within-group sum of squares is \(SSW=\sum_i\sum_j(Y_{ij}-\bar{Y}_i)^2\). Their mean squares divide by their respective degrees of freedom:
Here \(k-1\) is the between-group degrees of freedom and \(N-k\) is the within-group degrees of freedom. The expected mean square is the mean of the statistic’s values across repetitions under the model. It is not a prediction that the statistic in a single sample will equal that mean.
Why the Within-Group Mean Square Estimates \(\sigma^2\)
First consider one group containing \(n_i\) observations. Centering each observation at the group mean removes one estimated group location. To see the resulting expected sum of squares, use the identity
Under equal means, each \(Y_{ij}\) has mean \(\mu\) and variance \(\sigma^2\). Also, independence gives \(\operatorname{Var}(\bar{Y}_i)=\sigma^2/n_i\). Taking expectations on both sides therefore gives
Add this result across groups. Since \(\sum_i(n_i-1)=N-k\), the expected within-group sum of squares is \((N-k)\sigma^2\). Dividing by its degrees of freedom yields the expected within-group mean square.
Why the Between-Group Mean Square Has the Same Expectation
The group means vary from sample to sample even if their population means are equal. Under the model, each group mean has variance \(\sigma^2/n_i\). The weighted grand mean is the mean of all \(N\) observations, so its variance is \(\sigma^2/N\).
A useful identity for the between-group sum of squares is \(SSB=\sum_i n_i(\bar{Y}_i-\mu)^2-N(\bar{Y}_{..}-\mu)^2\). It follows by expanding the squares and using \(\sum_i n_i(\bar{Y}_i-\bar{Y}_{..})=0\). Taking expectations under the equal-means model gives the short derivation:
The first term contributes \(\sigma^2\) for each of the \(k\) group means. The grand mean, which is estimated from all the observations, accounts for one of those \(k\) contributions. Thus, the expected between-group sum of squares is \((k-1)\sigma^2\). Dividing by \(k-1\) gives the result:
Worked Examples
Worked Example: Balanced Groups
Suppose a hypothetical design has \(k=4\) groups, each with \(n_i=5\) observations, and the model’s common variance is \(\sigma^2=25\) square units. The group population means are equal, and the observations are independent. Find the expected values of both mean squares.
There are \(N=4(5)=20\) observations. The between-group degrees of freedom are \(k-1=3\), and the within-group degrees of freedom are \(N-k=20-4=16\). Therefore,
For the within-group component,
Both mean squares have expected value \(25\) square units. The equal group sizes make the arithmetic simple, but they are not the reason the expectations agree; the equal-means and common-variance assumptions are central.
Worked Example: Unequal Group Sizes
Consider a hypothetical study with group sizes \(n_1=3\), \(n_2=5\), and \(n_3=8\). Assume independent observations, equal population means, and common variance \(\sigma^2=9\) square units. Verify the expected mean squares.
There are \(k=3\) groups and \(N=3+5+8=16\) observations. For the between-group sum of squares, the group means contribute \(3\sigma^2\) in expectation, while the weighted grand mean contributes \(N(\sigma^2/N)=\sigma^2\). Thus,
For the within-group sum of squares, the degrees of freedom are \((3-1)+(5-1)+(8-1)=2+4+7=13\). Hence,
The group sizes differ, but each expected mean square is still \(9\) square units. In the between-group derivation, the weights \(n_i\) cancel the variances \(\sigma^2/n_i\) of the group means, so equal sample sizes are unnecessary.
Worked Example: Expected Values Are Not Sample Values
Suppose three hypothetical groups each have three observations. For illustration, assume all group populations have mean \(\mu=10\), and their errors are independent with values \(-2\), \(0\), and \(2\) having probabilities \(0.25\), \(0.50\), and \(0.25\), respectively. The error mean is zero and its variance is \(0.25(4)+0.50(0)+0.25(4)=2\). One possible sample is:
| Group | Observations | Group mean |
|---|---|---|
| 1 | 8, 10, 12 | 10 |
| 2 | 10, 12, 10 | 10.667 |
| 3 | 8, 8, 10 | 8.667 |
The grand mean is \((30+32+26)/9=88/9=9.778\). The between-group sum of squares is
The within-group sum of squares is \(8+8/3+8/3=40/3=13.33\). Here \(df_{\text{between}}=3-1=2\) and \(df_{\text{within}}=9-3=6\), so
These observed values are different, even though the model has equal means and common variance \(2\). That is not a contradiction: the result is \(E(MSB)=E(MSW)=2\) over repetitions, not \(MSB=MSW=2\) in every sample.
Why the Equal-Means Condition Matters
When the population means differ, the between-group mean square can reflect both random variation and systematic separation among population means. In fact, if \(\mu_w=\sum_i n_i\mu_i/N\) is the weighted average of the population means, then under the same independence and common-variance assumptions,
The additional term is nonnegative and is zero when all population means are equal. In contrast, \(E(MSW)=\sigma^2\) continues to hold because observations are centered around their own group means. This distinction explains why checking the equal-means model is essential when interpreting the two expected mean squares.
Common Mistakes and Why This Result Matters
- Confusing an expectation with a guaranteed value. Equal expected mean squares do not force the observed \(MSB\) and \(MSW\) to be equal. The worked sample shows one possible difference.
- Assuming balanced groups are required. The derivation uses each group’s size and the weighted grand mean. It applies with unequal group sizes as long as the stated model assumptions hold.
- Forgetting the variance assumption. If groups have different population variances, the contributions to the two expected mean squares need not reduce to the same common \(\sigma^2\).
- Calling a mean square the population variance without qualification. Each mean square has expectation \(\sigma^2\) under the equal-means model. A calculated mean square is still a random sample statistic, not the population variance itself.
The equality of expected mean squares gives a precise benchmark for understanding ANOVA: under equal means and common variance, both sources of variation reflect the same underlying noise level on average. The calculations also show exactly which assumptions make that benchmark valid.
Check Your Understanding
Answer each question using the model assumptions and expectation results above.
- In a one-way design with \(k=5\), \(N=25\), equal population means, and common variance \(\sigma^2=4\), find \(E(SSB)\), \(E(MSB)\), \(E(SSW)\), and \(E(MSW)\).
- Why does the expected between-group sum of squares involve \(k\sigma^2-\sigma^2\), rather than \(k\sigma^2\)?
- Does the equality \(E(MSB)=E(MSW)\) require equal group sizes? Explain briefly.
- A sample produces \(MSB=12\) and \(MSW=8\). Does this alone disprove equal population means? Explain the distinction between observed and expected values.
- Which model assumption is violated if one group has population variance \(3\) and another has population variance \(10\)?