>I'm trying to learn how to do a repeated measures ANOVA in R using > lme().
>In SAS, I use the code:
>
>PROC MIXED DATA=[data set below];
> CLASS sub group trial;
> MODEL dv = group trial group*trial;
> REPEATED trial / SUBJECT=sub TYPE=CS;
>run;


>
>In R, I'm trying the code:
>
>results.cs <- lme(DV ~ factor(GROUP)*factor(TRIAL), data=[data set below],
>random= ~factor(TRIAL)|SUB, correlation=corCompSymm() )
>anova(results.cs)

Try

anova(lme(DV ~ GROUP*TRIAL,random= ~1|SUB, correlation=corCompSymm() ))

This yields the correct results (I converted all the factors into... factors). Note that the 'trial' factor is fixed.

Actually you do not need lme for that. You could use the aov function:

summary(aov(DV~GROUP*TRIAL+Error(SUB/TRIAL)))

(it works well because the data is balanced)


Christophe Pallier http://www.pallier.org

______________________________________________
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help

Reply via email to