Skip to content
Prev 169541 / 398506 Next

Linear model: contrasts

The problem comes from mixing up general linear model (LM) theory to compute
B with the classical anova estimators.  The two methods use different
approaches to solving the normal equations.  LM theory uses any generalized
inverse of X'X to solve the normal equations.  Yours comes from ginv() which
uses SVD.  On the other hand, classical anova theory uses imposed contraints
to give the system a unique solution.  I'm not sure which generalized
inverse would correspond to the one that imposes the classical anova
constraints, but it must not be the one resulting from SVD in your example. 
Without the imposed anova constraints (called cell means), you won't have
the interactions summing to zero as you want.

hope that helps,
Ian
Stefan Kraemer-2 wrote: