data(anxiety)
head(anxiety)
# Two-way mixed ANOVA: group (between) x time (within)
anxiety_long <- reshape(anxiety, varying = c("t1", "t2", "t3"),
v.names = "score", timevar = "time",
direction = "long")
summary(aov(score ~ group * factor(time) + Error(factor(id)/factor(time)),
data = anxiety_long))
Run the code above in your browser using DataLab