[R] Asymmetrical ANOVA / contrasts
Joachim Claudet
joachim.claudet at gmail.com
Thu Dec 14 17:21:57 CET 2006
Dear all,
I have problems to code contrasts for performing an asymmetrical anova
with aov(). I am using aov() because I want to get the Mean Squares for
further analyses. I didn't find any solution to my problem in the help
files of functions aov(), contrasts(), C(), etc.
Let's say I have three locations, one with treatment P, and two with
treatment C:
> loc=factor(c(P1,P1,P1,P1,P1,C1,C1,C1,C1,C1,C2,C2,C2,C2,C2))
And here is my variable:
> X=c(21,23,34,32,23,9,4,5,6,8,3,2,8,7,6)
I want to test the effect of location P versus location C
Here is what I have done:
> contrasts(loc)=contr.treatment(3)
> aov(X~C(loc,c(2,-1,-1)))
This gives me exactly the same result as if I was doing simply
aov(X~loc) without first coding for the contrasts.
I have also tried:
> aov(X~loc,contrasts=contrasts(loc))
Could somebody tell me how to do?
Any help would be greatly appreciated.
Thanks,
Joachim Claudet.
--
<º)))>< <º)))>< <º)))>< <º)))>< <º)))>< <º)))>< <º)))>< <º)))><
Joachim Claudet
PhD
EPHE - CNRS FRE 2935
52, avenue Paul Alduy
66860 Perpignan cedex
Tel : 33 4 68662055
Fax : 33 4 68503686
<º)))>< <º)))>< <º)))>< <º)))>< <º)))>< <º)))>< <º)))>< <º)))><
More information about the R-help
mailing list