[R] se.contrast confusion

Adam D. I. Kramer adik at ilovebacon.org
Wed Feb 14 07:57:04 CET 2007


Hello,

I've got what I'd expect to be a pretty simple issue: I fit an aov object
using multiple error strata, and would like some significance tests for the
contrasts I specified.

In this contrived example, I model some test score as the interaction of a
subject's gender and two emotion variables (angry, happy, neutral), measured
at entry to the experiment (entry) and later manipulated (manip). This is a
fully within-subjects design.

Polynomial contrasts examine the effect of increasing emotional state

levels(entry) and (manip) are "a" "n" "h", so I set
contrasts(entry) <- contrasts(manip) <- contr.poly(3)
(I am led to believe that this is equivalent to specifying
contrasts=list(entry=contr.poly(3), manip=contr.poly(3)) in the aov call)

...and then fit the model:

fit <- aov(score ~ gender*entry*manip + Error(subject/(entry*manip))

...at this point, summary(fit) tests all the main effects and interactions
I'm interested in, and coef(fit) has the coefficients for all the contrasts
and their interactions. The question, however, is how to test the
significance of the contrasts, which is to say, compute the standard errors
and apply them to coef(fit) in a meaningful way.

The se.contrasts() function looks quite appealing, though it appears to
require me to respecify the contrasts...in both a contrast.obj and a coef.
It is not at all clear from the instrutions what contrast.obj is, especially
given that I have already specified the contrasts and they are already
represented in coef(fit). I may be missing something here.

Could someone suggest a way to go from coef(fit) to a table like
summary(fit) which tests the single-df contrasts (and interactions
therebetween) which I specified? Or a way to compute the standard errors for
these contrasts?

Many thanks,
Adam Kramer



More information about the R-help mailing list