Skip to content
Prev 202874 / 398500 Next

How to compute contrast where there are interaction terms in the linear model?

On Fri, Dec 4, 2009 at 12:18 PM, Charles C. Berry <cberry at tajo.ucsd.edu> wrote:
I don't understand what polynomial contrasts are. Would you please
help me understand?

May I ask you the following question to understand contrasts in a
simpler examples?

In the following example, I fit formula Y~x1+x2 and Y~x1*x2.

For Y~x1+x2, I understand that coefficients(afit)['x1b'] is the
contrast between the factor mean of a and the factor mean of b.

But for Y~x1*x2, since there are the interaction terms, I'm not sure
if it makes sense to compare the levels of a and b. Would you please
let me know what coefficients(afit)['x1b'] means in this case?
(Intercept)         x1b         x2v         x2w
-0.14740700 -0.27974772  1.00234567 -0.01278949
(Intercept)         x1b         x2v         x2w     x1b:x2v     x1b:x2w
-0.27108992 -0.03238187  0.61269558  0.74790937  0.77930018 -1.52139771