I have performed a repeated measures ANOVA in R, as follows:
aov_velocity = aov(Velocity ~ Material + Error(Subject/(Material)), data=scrd)
summary(aov_velocity)
- What syntax in R can be used to perform a post hoc test after an ANOVA with repeated measures?
- Would Tukey's test with Bonferroni correction be appropriate? If so, how could this be done in R?
Best Answer
What you could do is specify the model with
lme
and then useglht
from themultcomp
package to do what you want. However, lme gives slightly different F-values than a standard ANOVA (see also my recent questions here).For other contrasts then bonferroni, see e.g., the book on
multcomp
from the authors of the package.You may also want to see this post on the R-mailing list, and this blog post for specifying a repeated measures ANOVA in R.
However, as shown in this question from me I am not sure if this approachs is identical to an ANOVA. Furthermore, glht only reports z-values instead of the usual t or F values. This seems to be uncommon, too.
So far, I haven't encountered another way of doing this.