Multiple Comparisons
Learn about the post-hoc comparisons, which are also known as Tukey tests.
Introduction
It’s often helpful and necessary to compare the different levels within a single categorical variable. For example, we probably would like to know if our three predator treatments differ significantly from one another. There are two primary ways to do this:
- We can use the
glht()
function in the multcomp package. The word multcomp is short for “multiple comparisons,” andglht()
stands for “general linear hypothesis test.” - We can use the emmeans package to calculate the estimated marginal means from the model and pairwise differences between them.
Note: Marginal means are estimated means for our treatment groups that account for other potential covariates or random effects in the model. Thus, they’re beneficial when we have more complex models, but they can also be used here.
In either case, we conduct what’s known ...