Tutorials › Introduction to Statistics › Expected Mean Squares Under Equal Means

One-Way ANOVA · Tutorial 856 of 996

Expected Mean Squares Under Equal Means

See how the one-way ANOVA model leads both mean squares to estimate the common population variance when the group means are equal.

Intermediate 9 min read

What You'll Learn

  • State the one-way ANOVA model and the assumptions needed for the expected-mean-square results.
  • Explain what an expected mean square represents over repeated samples.
  • Derive the expected within-group mean square from within-group sums of squares.
  • Derive the expected between-group mean square, including when group sizes differ.
  • Distinguish a mean square’s expected value from its value in one particular sample.

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.

Model and assumptions: Suppose there are \(k\) groups, with \(n_i\) independent observations in group \(i\), and \(N=\sum_{i=1}^k n_i\) observations altogether. Write observation \(j\) in group \(i\) as \(Y_{ij}=\mu_i+\varepsilon_{ij}\). Assume the errors are independent, have mean zero, and share a common variance \(\sigma^2\). Under equal population means, \(H_0:\mu_1=\cdots=\mu_k\), all group means equal a common value \(\mu\). These assumptions are sufficient for the expected-mean-square results below; normality is not needed for these expectations.

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:

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

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

$$ \sum_{j=1}^{n_i}(Y_{ij}-\bar{Y}_i)^2 = \sum_{j=1}^{n_i}(Y_{ij}-\mu)^2 - n_i(\bar{Y}_i-\mu)^2. $$

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

$$ E\!\left[\sum_{j=1}^{n_i}(Y_{ij}-\bar{Y}_i)^2\right] = n_i\sigma^2-n_i\left(\frac{\sigma^2}{n_i}\right) = (n_i-1)\sigma^2. $$

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.

Result: Under independent observations, equal population means, and a common population variance, \(E(SSW)=(N-k)\sigma^2\), so \(E(MSW)=\sigma^2\).

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:

$$ \begin{aligned} E(SSB) &=\sum_{i=1}^k n_i\operatorname{Var}(\bar{Y}_i) -N\operatorname{Var}(\bar{Y}_{..})\\ &=\sum_{i=1}^k n_i\left(\frac{\sigma^2}{n_i}\right) -N\left(\frac{\sigma^2}{N}\right)\\ &=k\sigma^2-\sigma^2\\ &=(k-1)\sigma^2. \end{aligned} $$

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:

Result: Under equal population means and a common population variance, \(E(SSB)=(k-1)\sigma^2\), so \(E(MSB)=\sigma^2\). This result does not require equal group sizes.

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,

$$ E(SSB)=(k-1)\sigma^2=3(25)=75, \qquad E(MSB)=\frac{75}{3}=25. $$

For the within-group component,

$$ E(SSW)=(N-k)\sigma^2=16(25)=400, \qquad E(MSW)=\frac{400}{16}=25. $$

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,

$$ E(SSB)=3(9)-16\left(\frac{9}{16}\right)=27-9=18, \qquad E(MSB)=\frac{18}{3-1}=9. $$

For the within-group sum of squares, the degrees of freedom are \((3-1)+(5-1)+(8-1)=2+4+7=13\). Hence,

$$ E(SSW)=13(9)=117, \qquad E(MSW)=\frac{117}{16-3}=\frac{117}{13}=9. $$

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:

GroupObservationsGroup mean
18, 10, 1210
210, 12, 1010.667
38, 8, 108.667

The grand mean is \((30+32+26)/9=88/9=9.778\). The between-group sum of squares is

$$ SSB =3\left[\left(\frac{2}{9}\right)^2+ \left(\frac{8}{9}\right)^2+ \left(-\frac{10}{9}\right)^2\right] =\frac{56}{9}=6.222. $$

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

$$ MSB=\frac{56/9}{2}=\frac{28}{9}=3.111, \qquad MSW=\frac{40/3}{6}=\frac{20}{9}=2.222. $$

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,

$$ E(MSB) = \sigma^2+ \frac{\sum_{i=1}^k n_i(\mu_i-\mu_w)^2}{k-1}. $$

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.

  1. 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)\).
  2. Why does the expected between-group sum of squares involve \(k\sigma^2-\sigma^2\), rather than \(k\sigma^2\)?
  3. Does the equality \(E(MSB)=E(MSW)\) require equal group sizes? Explain briefly.
  4. A sample produces \(MSB=12\) and \(MSW=8\). Does this alone disprove equal population means? Explain the distinction between observed and expected values.
  5. Which model assumption is violated if one group has population variance \(3\) and another has population variance \(10\)?