Here is an ANOVA model with one between-subject factor (condition; 4 levels) and one within-subject factor (trial_seq; 20 levels).
amod = aov(decision_quality ~ condition*trial_seq + Error(user_id/trial_seq), data = d.task1) summary(amod)
I want to do a pairwise analysis for both the between-subject factor and the within-subject factor. I found that it is not straightforward to use a function like TukeyHSD() for a within-subject factor. I researched this problem and found some suggestions in another thread.
However, my lack of statistical background prevented me from fully understanding vignettes coming with the multcomp package. Anyway, I tried some random statements like:
summary(glht(amod, linfct = mcp(trial_seq = "Tukey")))
However, it generates the following error:
Error in model.matrix.aovlist(model) : ‘glht’ does not support objects of class ‘aovlist’ Error in summary(glht(amod, linfct = mcp(trial_seq = "Tukey"))) : error in evaluating the argument 'object' in selecting a method for function 'summary': Error in factor_contrasts(model) : no ‘model.matrix’ method for ‘model’ found!
- What did I do wrong?