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
Then, the hypotheses sum of squares and products matrix is
and the residuals sum of squares and products matrix is
The matrix Qh is analogous to the numerator of a univariate F-test, and Qe is analogous to the error sum of squares. Hence, the four statistics manova uses are:
where λi are the solutions of the characteristic equation |Qh – λQe| = 0.
where θi values are the solutions of the characteristic equation Qh – θ(Qh + Qe) = 0.
Roy's maximum root statistic
 Charles, S. D. Statistical Methods for the Analysis of Repeated Measurements. Springer Texts in Statistics. Springer-Verlag, New York, Inc., 2002.