I built a linear mixed model and did a post hoc test for it. Fixed factors are the phase numbers (time) and the group.
statistic_of_comp <- function (x, df) {
x.full.1 <- lmer(x ~ phase_num + group + (1|mouse), data=df, REML = FALSE)
x_phase.null.1 <- lmer(x ~ group + (1|mouse), data=df, REML = FALSE)
print(anova (x.full.1, x_phase.null.1))
summary(glht(x.full.1, linfct=mcp(phase_num="Tukey")))
}
Now my problem is, that I want to do a post hoc test with more than one fixed factor. I found the following
linfct=mcp(phase_num="Tukey", group="Tukey)
but that doesn't give the result I want. At the moment I get the comparison for the groups with Tukey (every group with every other group) and the comparison between the two phases.
What I want is a comparison of the phase_numbers for every group. e.g. group1 phase1-phase2 ..., group2 phase1-phase2 etc.