# How is repeated-measures ANOVA a special case of linear mixed models?

In this comment @gung mentions that

On a different note, I think it's fair to think of RM ANOVA as a special case of linear mixed models.

and a subsequent comment concurs with this.

I understand that in a repeated-measures ANOVA we have observations nested inside subjects, and the dependency this creates maps precisely onto what linear mixed models are meant to deal with.

In what sense is repeated-measures ANOVA a special case of linear mixed models? Is it that repeated measures ANOVA assumes that the residuals have constant variance and are not correlated with each other, whereas linear mixed models does not assume this?

## 1 Answer

Repeated measurements ANOVA is a special case of linear mixed effects models because it is less-flexible in regards with the structure of the "random-effects" part of a linear mixed effects model as well as it assumes some further conveniences for the data at hand.

The repeated measurements ANOVA starts with the general form: \begin{align} y_{ij} = \mu_{ij} + \pi_{ij}+ \epsilon_{ij} \end{align}

where $i$ indexes the subject, $j$ the time-point, $\mu_{ij}$ is the mean at time $j$ for individual $i$, $\pi_{ij}$ is the consistent departure of $y_{ij}$ fron $\mu_{ij}$ for the the $i$-th individual and $\epsilon_{ij}$ are the errors. By consistent here one means that under (hypothetical) repetitions from the same individual, $y_{ij}$ has mean $\mu_{ij} + \pi_{ij}$. It is what one would describe as the conditional mean response in the context of an LME.

This fine but looking at the "random-effects" part the repeated measures ANOVA assumes that the distribution of the response variables has compound symmetry. This means that all response variables have equal variance, and each pair of response variables have a common correlation. (This strongly relates to the concept of sphericity - theoretically you only need sphericity rather than CS but it is (very) hard to get sphericity without CS. Huynh & Feldt, 1970, JASA). On the other hand, to quote Davis, 2002 Chapt. 6: "The linear mixed models approach to repeated measurements views the analysis as a univariate regression analysis of responses with correlated errors." To that respect the correlation can be many different structures, Toepliz, AR(1), compound symmetry (as above), random intercept and slope, etc. You can mix different error sources "without" a problem (eg. even aov documentation says that "If there are two or more error strata, the methods used are statistically inefficient without balance, and it may be better to use lme in package nlme..."). Finally, coming to the conveniences part: The repeated measurements ANOVA model cannot: 1. have variation among experimental units with respect to the number and timing of observations. 2. handle missing data or 3. time-dependent covariates. These goodies comes with linear mixed models only.

• +1 Can you explain the term "consistent" departure within your answer? – Antoni Parellada May 9 '16 at 1:59
• Should the model be like $y_{ij} = \mu_j + \pi_i+ \epsilon_{ij}$? Otherwise the three items on the right hand side seem to be not separable?. – bluepole May 9 '16 at 9:32
• +1. Also +1 to @bluepole's comment, I was also confused by that. Can you also clarify the terminology around this anova model? Is this one-way or "two-way" etc.? I think this is one-way RM ANOVA, more specifically with one within-subject effect (time) and no between-subject effects (these would be e.g. two groups of subjects). This might be helpful to mention. – amoeba says Reinstate Monica May 9 '16 at 9:50
• Apart from all that, it would be great if you could elaborate more on what happens (mathematically) when ANOVA is fitting this particular model vs. what happens when mixed model approach is used. In mixed model we assume that $\pi$ terms come from $\mathcal N(\mu,\sigma^2)$ and fit the whole thing with ML. How is anova different? Will the estimates coincide under some conditions? A demonstration would be great too. Sorry for lots of questions, but I am interested in this topic too and would be happy to offer a bounty for a good answer(s). – amoeba says Reinstate Monica May 9 '16 at 9:53
• @bluepole: Yes, it is the general basis of the model. Strictly speaking it should be: $y_{ij} = \mu + \pi_i + \tau_j + \epsilon_{ij}$ if anything but I wanted to emphasise the idea of an estimate for each $i$, $j$ index. ($\tau$ being the fixed effect at time $j$) – usεr11852 says Reinstate Monic May 9 '16 at 16:25