Skip to content
Prev 293725 / 398513 Next

Understanding custom contrasts

On May 6, 2012, at 17:59 , Sandy Miller wrote:

            
Because of linear algebra, basically... You are confusing contrast parametrization with contrast transformation (and you're not alone in falling into that trap). The matrix you set up transforms two coefficients to three means as follows

a =  A1 + 0
b = -A1 + A2
c =  0  - A2

(and of course there's an intercept to add as well). Now, the contrast transformations that you want are

a - b = 2A1 - A2
b - c = 2A2 - A1

which you will surely notice are not the same as A1 and A2. Had you instead chosen this matrix

1  0
0  0
0 -1

then you will have a-b=A1 and b-c=A2.

The reason people often get this wrong is that the literature, originating in the analysis of balanced designs, tends to (over-)emphasize "orthogonal contrast" matrices, which satisfy C'C = I. In a balanced design, this leads to nice statistical properties and interpretation, but not in the general case. In a suitable sense, the orthogonal contrast matrices are their own inverses. However, for the generic case, you need to find a solution to the equation A'C=I given A or C.