I have data consisting of two measures per subject (variable score, measured at Day 0, and Day1 per each subject). There are two groups, and each subject belongs to one of them (variable Group). I would like to know if there are differences in the score values between these two groups of subjects. I tried aov and lme in R, and I got completely different results.
Why is the Group:Day effect significant using aov, and it is not significant using lme? Here is the code I used:
> demo1.aov <- aov(score ~ (Group*Day) + Error(Subject/Day), data = demo1)
> summary(demo1.aov)
Error: Subject
Df Sum Sq Mean Sq F value Pr(>F)
Group 1 0.2 0.198 0.15 0.7
Residuals 50 65.9 1.318
Error: Subject:Day
Df Sum Sq Mean Sq F value Pr(>F)
Day 1 0.3 0.34 0.45 0.507
Group:Day 1 4.0 4.02 5.29 0.026 *
Residuals 50 38.0 0.76
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
> demo1.lme<-lme(score ~ (Group*Day), random = ~ 1|Subject/Day, data = demo1)
> anova(demo1.lme)
numDF denDF F-value p-value
(Intercept) 1 50 0.394 0.533
Group 1 50 0.078 0.781
Day 1 50 1.225 0.274
Group:Day 1 50 2.064 0.157