The General Linear Model
The General Linear Model provides a framework for analyzing arbitrary univariate or multivariate regression, anova and ancova models. In Stata the manova command is used to fit general linear models, SAS calls the procedure proc glm.
H = A'(CB)'(C(X'X)-1C')-1(CB)A
E = A'(Y'Y - B'(X'X)B)A
where B = (X'X)-1X'Y
The A matrix operates on the dependent variables while the C matrix operates on the independent variables.
Consider the Design
manova y1 y2 = a b;
with a having 3 levels and b having 2 levels, the parameter vector is:

To test all the pairwise differences among the levels of a, use the following C matrices in the manovatest command:
C1 = (0, 1, -1, 0, 0, 0)
C2 = (0, 1, 0, -1, 0, 0)
C3 = (0, 0, 1, -1, 0, 0)
(μ α1 α2 α3 β1 β2)
manova y1 y2 = a b manovatest , test(C1) manovatest , test(C2) manovatest , test(C3)
Dependent Variables
The A matrix is also used in the manovatest command, for example, consider the difference in two dependent variables:
A = (1, -1)
manova y1 y2 = a b manovatest a, ytransform(A)
Memory Test
Remember the Linear model form Ed230B/C
Yij = μ + αj + εij The effect parameter: αj = μj - μ
Coding
Using dummy coding for two groups
X0 = 1, X1 = 1 or 0, and X2 = 0 or 1

Which yields two equations in three unknowns. The system is rank deficient with no unique solution.
Let α1 = μ1 - μ and α2 = μ2 - μ
Hence: α1 + α2 = μ1 + μ2 - 2μ
and since 