Hi, 
 
I am using aov with an Error component to model some repeated measures data.
By repeated measures I mean the data look something like this...
 
subj    A        B        C
1       4        11       15
2       3        12       17
3       5        9        14
4       6        10       18
 
For each subject I have 3 observations, one in each of three conditions (A,
B, C). I want to test the following contrast (1, 0, -1). One solution is to
apply the contrast weights at the subject level explicitly and then call
t.test on the difference scores. However, I am looking for a more robust
solution as I my actual design has more within-subjects factors and one or
more between subjects factors.
 
A better solution is to specify the contrast in an argument to aov. The
estimated difference of the contrast is the same as that in the paired
t-test, but the residual df are double. While not what I expected, it
follows from the documentation, which explicitly states that these contrasts
are not to be used for any error term. Even though I specify 1 contrast,
there are 2 df for a 3 level factor, and I suspect internally the error term
is calculated by pooling across multiple contrasts. 
 
While very useful, I am wondering if there is way to get aov to calculate
the residual error term only based on the specified contrasts (i.e., not
assume homogeneity of variance and sphericity) for that strata?
 
If not, I could calculate them directly using model.matrix, but I've never
done that. If that is the preferred solution, I'd also appreciate coding
suggestions to do it efficiently. 
 
Thanks,
Steve
 
ps Is there a way to print a dataframe to the console such that it can be
pasted into an email and copied back out of the email and pasted into the
console?
 

        [[alternative HTML version deleted]]

______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to