Expected mean squares

In statistics, expected mean squares (EMS) are the expected values of certain statistics arising in partitions of sums of squares in the analysis of variance (ANOVA). They can be used for ascertaining which statistic should appear in the denominator in an F-test for testing a null hypothesis that a particular effect is absent.

Definition
When the total corrected sum of squares in an ANOVA is partitioned into several components, each attributed to the effect of a particular predictor variable, each of the sums of squares in that partition is a random variable that has an expected value. That expected value divided by the corresponding number of degrees of freedom is the expected mean square for that predictor variable.

Example
The following example is from Longitudinal Data Analysis by Donald Hedeker and Robert D. Gibbons.

Each of s treatments (one of which may be a placebo) is administered to a sample of (capital) N randomly chosen patients, on whom certain measurements $ Y_{hij} $ are observed at each of (lower-case) n specified times, for $ h=1,\ldots,s, \quad i=1,\ldots,N_h $  (thus the numbers of patients receiving different treatments may differ), and $ j=1,\ldots, n.$  We assume the sets of patients receiving different treatments are disjoint, so patients are nested within treatments and not crossed with treatments. We have


 * $$ Y_{hij} = \mu + \gamma_h + \tau_j + (\gamma\tau)_{hj} + \pi_{i(h)} + \varepsilon_{hij} $$

where


 * $$\mu$$ = grand mean, (fixed)
 * $$\gamma_h$$ = effect of treatment $$h$$, (fixed)
 * $$\tau_j$$ = effect of time $$j$$, (fixed)
 * $$(\gamma\tau)_{hj}$$ = interaction effect of treatment $$h$$ and time $$j$$, (fixed)
 * $$\pi_{i(h)}$$ = individual difference effect for patient $$i$$ nested within treatment $$h$$, (random)
 * $$\varepsilon_{hij}$$ = error for patient $$i$$ in treatment $$h$$ at time $$j$$. (random)
 * $$\sigma_\pi^2$$ = variance of the random effect of patients nested within treatments,
 * $$\sigma_\varepsilon$$ = error variance.

The total corrected sum of squares is


 * $$ \sum_{hij} (Y_{hij} - \overline Y)^2 \quad\text{where } \overline Y = \frac 1 n \sum_{hij} Y_{hij}. $$

The ANOVA table below partitions the sum of squares (where $ N = \sum_h N_h $ ):

Use in F-tests
A null hypothesis of interest is that there is no difference between effects of different treatments—thus no difference among treatment means. This may be expressed by saying $ D_\text{Tr}=0, $ (with the notation as used in the table above). Under this null hypothesis, the expected mean square for effects of treatments is $ \sigma_\varepsilon^2 + n \sigma_\pi^2. $

The numerator in the F-statistic for testing this hypothesis is the mean square due to differences among treatments, i.e. it is $ \left. \text{SS}_\text{Tr} \right/(s-1). $ The denominator, however, is not $ \left. \text{SS}_\text{E}\right/ \big( (N-s)(n-1) \big). $ The reason is that the random variable below, although under the null hypothesis it has an F-distribution, is not observable—it is not a statistic—because its value depends on the unobservable parameters $ \sigma_\pi^2 $  and $ \sigma_\varepsilon^2. $


 * $$ \frac{\left.\frac{\text{SS}_\text{Tr}}{\sigma_\varepsilon^2 + n\sigma_\pi^2} \right/(s-1)}{ \left. \frac{\text{SS}_\text{E}}{\sigma_\varepsilon^2} \right/ \big( (N-s)(n-1) \big)} \ne \frac{\text{SS}_\text{Tr}/(s-1)}{\text{SS}_\text{E}/\big((N-s)(n-1)\big)} $$

Instead, one uses as the test statistic the following random variable that is not defined in terms of $ \text{SS}_\text{E}$ :


 * $$ F = \frac{\left.\frac{\text{SS}_\text{Tr}}{\sigma_\varepsilon^2 + n\sigma_\pi^2} \right/(s-1)}{ \left. \frac{\text{SS}_{\text{S}(\text{Tr})}}{\sigma_\varepsilon^2+ n\sigma_\pi^2} \right/ (N-s)} = \frac{\left. \text{SS}_\text{Tr} \right/(s-1)}{ \left. \text{SS}_\text{S(Tr)} \right/ (N-s)} $$