After doing a model comparison with my mixed lmer model, I have a model with three main effects, no interaction, say signal ~ factor A + factor B + factor C + (1|subj)
.
Factor C has three levels, so I want to do a post-hoc test to see how the levels differ from each other. I tried two methods:
Method 1: mcp with Tukey (from multcomp package)
summary(glht(myModel, mcp(factorC="Tukey"))
where I get the following result:
Simultaneous Tests for General Linear Hypotheses
Multiple Comparisons of Means: Tukey Contrasts
Fit: lme4::lmer(formula = signal ~ factorA + factorB + factor C + (1 |
subj), data = s)
Linear Hypotheses:
Estimate Std. Error z value Pr(>|z|)
e1 - e2 == 0 0.8071 0.4681 1.724 0.1984
e1 - e3 == 0 1.9926 0.4681 4.257 <1e-04 ***
e2 - e3 == 0 1.1855 0.4681 2.533 0.0321 * ---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Adjusted p values reported -- single-step method)
Method 2: lsm (from lsmeans package)
summary(glht(myModel, lsm(pairwise ~ factorC)))
giving me the following result:
Simultaneous Tests for General Linear Hypotheses
Fit: lme4::lmer(formula = signal ~ factorA + factorB + factorC +
(1 | ID), data = s)
Linear Hypotheses:
Estimate Std. Error t value Pr(>|t|)
e1 - e2 == 0 0.8071 0.4681 1.724 0.198
e1 - e3 == 0 1.9926 0.4681 4.257 <1e-04 ***
e2 - e3 == 0 1.1855 0.4681 2.533 0.032 *
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Adjusted p values reported -- single-step method)
The results are pretty similar, and I would guess that the lsm-results are more reliable, since lsmeans is explicitly suited for models with unequal observations. I still wonder, though, whether it is acceptable to do so and would appreciate any comment!