Why Expected Mean Squares Matter
A one-way ANOVA separates variation within groups from variation among group means. The corresponding mean squares are random quantities: their values would change if the study were repeated. Their expectations explain what each mean square measures under the model. In particular, the expected within-group mean square reflects the common error variance, while differences among fixed group means add a nonnegative component to the expected between-group mean square.
This distinction is useful when interpreting ANOVA calculations: a large observed between-group mean square may arise from ordinary sampling variation, from genuinely different group means, or from both. The results here concern the expectations under the model; they do not by themselves determine a test decision or the distribution of an F statistic.
Model and Notation
Consider \(k\) fixed groups. Group \(i\) contains \(n_i\) independent observations, and \(N=\sum_{i=1}^k n_i\) is the total sample size. Write the observation from unit \(j\) in group \(i\) as \(Y_{ij}\). The one-way fixed-effects model is
Here \(\mu_i\) is the fixed mean for group \(i\), and the errors are independent with \(E[\varepsilon_{ij}]=0\) and \(\operatorname{Var}(\varepsilon_{ij})=\sigma^2\) for every observation. Thus all groups share a common error variance. Normal errors are not needed to derive the expected mean squares; independence, zero error means, and a common finite variance are sufficient.
For the sample, let \(\bar{Y}_{i\cdot}\) be the mean of group \(i\), and let \(\bar{Y}_{\cdot\cdot}\) be the overall sample mean, weighted by the group sizes. The within-group sum of squares is \(SS_W=\sum_i\sum_j(Y_{ij}-\bar{Y}_{i\cdot})^2\); the between-group sum of squares is \(SS_B=\sum_i n_i(\bar{Y}_{i\cdot}-\bar{Y}_{\cdot\cdot})^2\). Their mean squares are \(MS_W=SS_W/(N-k)\) and \(MS_B=SS_B/(k-1)\), respectively, when the indicated degrees of freedom are positive.
The Expected Mean Squares
The between-group expression has two parts. The first, \(\sigma^2\), is the contribution from sampling error, which remains even when all fixed group means are equal. The second, \(\lambda/(k-1)\), is the additional contribution from differences among the fixed means. The group sizes matter: the grand mean is weighted, and a group mean farther from that weighted center contributes in proportion to its size.
Why These Expectations Hold
The within-group result follows by removing each group’s sample mean. Within group \(i\), write \(\bar{\varepsilon}_{i\cdot}=n_i^{-1}\sum_j\varepsilon_{ij}\). Since the fixed mean \(\mu_i\) cancels when centering observations within a group,
The expected first term is \(n_i\sigma^2\). Independence gives \(\operatorname{Var}(\bar{\varepsilon}_{i\cdot})=\sigma^2/n_i\), and the error mean is zero, so \(E[n_i\bar{\varepsilon}_{i\cdot}^{\,2}]=\sigma^2\). Therefore group \(i\) contributes \((n_i-1)\sigma^2\) in expectation. Summing over groups gives \(E[SS_W]=(N-k)\sigma^2\); dividing by \(N-k\) gives \(E[MS_W]=\sigma^2\).
For the between-group result, write \(\bar{Y}_{i\cdot}=\mu_i+\bar{\varepsilon}_{i\cdot}\) and \(\bar{\varepsilon}_{\cdot\cdot}=N^{-1}\sum_i n_i\bar{\varepsilon}_{i\cdot}\). Then \(\bar{Y}_{\cdot\cdot}=\bar{\mu}_w+\bar{\varepsilon}_{\cdot\cdot}\). Substitution into \(SS_B\) separates each centered group mean into its fixed part and its random error part. The cross-product has expectation zero because each error mean is zero.
The first term is \(\lambda\). For the last term, use \(\sum_i n_i(\bar{\varepsilon}_{i\cdot}-\bar{\varepsilon}_{\cdot\cdot})^2=\sum_i n_i\bar{\varepsilon}_{i\cdot}^{\,2}-N\bar{\varepsilon}_{\cdot\cdot}^{\,2}\). The expectation of the first sum is \(k\sigma^2\), since each group mean error has variance \(\sigma^2/n_i\). The overall mean error has variance \(\sigma^2/N\), so the expectation of the second term is \(\sigma^2\). Hence the random error part contributes \((k-1)\sigma^2\), and \(E[SS_B]=\lambda+(k-1)\sigma^2\). Dividing by \(k-1\) proves the stated formula for \(E[MS_B]\).
Worked Examples
Worked Example: Equal Fixed Means
A hypothetical study compares four fixed production settings, with five independent measurements at each setting. Suppose every setting has fixed mean 18 units and the common error variance is \(\sigma^2=16\) square units. Find the expected within-group and between-group mean squares. The group sizes are equal, but the key condition here is that the fixed means are equal.
Method. Apply the expected-mean-square formulas. Since all four fixed means are 18, the weighted grand mean is
Each deviation \(\mu_i-\bar{\mu}_w\) is zero. Therefore
There are \(k-1=3\) between-group degrees of freedom, and \(N-k=20-4=16\) within-group degrees of freedom. Thus
Both expectations equal the error variance. This does not mean that the two observed mean squares must be equal in a particular sample. Common mistake avoided: treating the equality of expectations under equal fixed means as a claim that every realized \(MS_W\) and \(MS_B\) will be identical.
Worked Example: Unequal Means and Unequal Group Sizes
A hypothetical materials experiment has three fixed settings. Their sample sizes are \(3,5,4\), their fixed means are \(20,22,25\) units, and the common error variance is \(4\) square units. Calculate both expected mean squares.
Method. First calculate the weighted grand mean, using \(N=3+5+4=12\):
The weighted squared deviations are
Here \(k-1=2\) and \(N-k=9\). Consequently,
The expected between-group mean square exceeds the common error variance by \(22.5\), the fixed-effects component per between-group degree of freedom. Common mistake avoided: using the unweighted average of \(20,22,25\) as the grand mean. With unequal group sizes, the correct center is \(22.5\), weighted by \(3,5,4\).
Worked Example: How Group Allocation Changes the Expected Between-Group Mean Square
A hypothetical two-setting study has fixed means \(30\) and \(33\) units, with common error variance \(\sigma^2=9\). Compare the expected between-group mean square for an allocation of \(4\) and \(6\) observations with an allocation of \(8\) and \(2\). In both designs, the total sample size is 10.
Method. For two groups with sizes \(n_1,n_2\), the weighted fixed-effects component simplifies to
This follows by centering both group means at their weighted average; their weighted squared deviations sum to the expression shown. For the \(4,6\) allocation,
Since \(k-1=1\), \(E[MS_B]=9+21.6=30.6\). For the \(8,2\) allocation,
Both designs have the same fixed means, error variance, and total sample size, but the more unbalanced allocation has a smaller expected between-group mean square. In each design \(E[MS_W]=9\). Common mistake avoided: assuming that the expected between-group mean square depends only on the difference in fixed means; the allocation also affects \(\lambda\).
Common Mistakes and Interpretation
Expected mean squares are model-based averages over repeated samples, not predictions of exact observed values. In particular, \(E[MS_W]=\sigma^2\) does not imply that every within-group mean square equals \(\sigma^2\). Similarly, the formula for \(E[MS_B]\) includes the error-variance component as well as the fixed-effects component.
For example, in the unequal-size study above, omitting the \(\sigma^2=4\) term would give \(45/2=22.5\), not the correct expected between-group mean square \(26.5\). Using an unweighted center instead of the weighted grand mean is another error: it changes the deviations used to calculate \(\lambda\), and can therefore change the result.
- Do not confuse fixed means with sample means. The \(\mu_i\) values are model parameters; \(\bar{Y}_{i\cdot}\) values vary from sample to sample.
- Use the appropriate degrees of freedom. Divide \(SS_B\) by \(k-1\) and \(SS_W\) by \(N-k\) when defining the two mean squares.
- Keep the common variance component. Even when group means differ, \(E[MS_B]\) is \(\sigma^2+\lambda/(k-1)\), not just \(\lambda/(k-1)\).
- Use the weighted grand mean. With unequal group sizes, \(\bar{\mu}_w\) is not generally the simple average of the \(k\) group means.
Check Your Understanding
For each problem, use the fixed-effects expected-mean-square formulas. Unless stated otherwise, errors are independent, have mean zero, and share the given variance.
- A study has four groups of size five, equal fixed means of 12, and error variance \(16\). Find \(E[MS_W]\) and \(E[MS_B]\). (Answer: \(16\) and \(16\))
- Three groups have sizes \(2,4,6\), fixed means \(5,7,8\), and error variance \(3\). Calculate the weighted grand mean, \(\lambda\), and both expected mean squares. (Answer: \(\bar{\mu}_w=43/6\), \(\lambda=41/3\), \(E[MS_W]=3\), \(E[MS_B]=59/6\))
- Two groups have sizes \(8\) and \(2\), fixed means \(40\) and \(46\), and error variance \(5\). Calculate \(\lambda\) and both expected mean squares. (Answer: \(\lambda=57.6\), \(E[MS_W]=5\), \(E[MS_B]=62.6\))
- Three equally sized groups have size \(4\), fixed means \(12,15,18\), and error variance \(2\). Find the weighted grand mean, \(\lambda\), and both expected mean squares. (Answer: \(\bar{\mu}_w=15\), \(\lambda=72\), \(E[MS_W]=2\), \(E[MS_B]=38\))
- Three groups have sizes \(3,3,6\), fixed means \(4,8,10\), and error variance \(7\). Calculate the weighted grand mean and expected mean squares, and state whether unequal fixed means increase \(E[MS_B]\) above \(\sigma^2\). (Answer: \(\bar{\mu}_w=8\), \(\lambda=72\), \(E[MS_W]=7\), \(E[MS_B]=43\); yes, by \(36\))