## Multivariate Analysis of Variance for Repeated Measures

Multivariate analysis of variance analysis is a test of the
form `A*B*C = D`

, where `B`

is the *p*-by-*r* matrix
of coefficients. *p* is the number of terms, such
as the constant, linear predictors, dummy variables for categorical
predictors, and products and powers, *r* is the number
of repeated measures, and *n* is the number of subjects. `A`

is
an *a*-by-*p* matrix, with rank *a* ≤ *p*,
defining hypotheses based on the between-subjects model. `C`

is
an *r*-by-*c* matrix, with rank *c* ≤ *r* ≤ *n
– p*, defining hypotheses based on the within-subjects
model, and `D`

is an *a*-by-*c* matrix,
containing the hypothesized value.

`manova`

tests if the model terms are significant
in their effect on the response by measuring how they contribute to
the overall covariance. It includes all terms in the between-subjects
model. `manova`

always takes `D`

as
zero. The multivariate response for each observation (subject) is
the vector of repeated measures.

`manova`

uses four different methods to measure
these contributions: Wilks’ lambda, Pillai’s trace,
Hotelling-Lawley trace, Roy’s maximum root statistic. Define

$$\begin{array}{l}T=A\widehat{B}C-D,\\ Z=A{\left({X}^{\prime}X\right)}^{-1}{A}^{\prime}.\end{array}$$

Then, the hypotheses sum of squares and products matrix is

$${Q}_{h}={T}^{\prime}{Z}^{-1}T,$$

and the residuals sum of squares and products matrix is

$${Q}_{e}={C}^{\prime}\left({R}^{\prime}R\right)C,$$

where

$$R=Y-X\widehat{B}.$$

The matrix *Q _{h}* is
analogous to the numerator of a univariate

*F*-test, and

*Q*is analogous to the error sum of squares. Hence, the four statistics

_{e}`manova`

uses
are:**Wilks’ lambda**$$\Lambda =\frac{\left|{Q}_{e}\right|}{\left|{Q}_{h}+{Q}_{e}\right|}={\displaystyle \prod \frac{1}{1+{\lambda}_{i}}},$$

where

*λ*are the solutions of the characteristic equation |_{i}*Q*–_{h}*λQ*| = 0._{e}**Pillai’s trace**$$V=trace\left({Q}_{h}{\left({Q}_{h}+{Q}_{e}\right)}^{-1}\right)={\displaystyle \sum {\theta}_{i},}$$

where

*θ*values are the solutions of the characteristic equation_{i}*Q*–_{h}*θ*(*Q*+_{h}*Q*) = 0._{e}**Hotelling-Lawley trace**$$U=trace\left({Q}_{h}{Q}_{e}^{-1}\right)={\displaystyle \sum {\lambda}_{i}}.$$

**Roy’s maximum root statistic**$$\Theta =\mathrm{max}\left(eig\left({Q}_{h}{Q}_{e}^{-1}\right)\right).$$

## References

[1] Charles, S. D. *Statistical Methods for the
Analysis of Repeated Measurements*. Springer Texts in Statistics.
Springer-Verlag, New York, Inc., 2002.