# NOT RUN {
# Get data and fit model:
data("cake", package="lme4")
model <- lmer(angle ~ recipe * temp + (1|recipe:replicate), cake)
# Compute LS-means:
ls_means(model)
# Get LS-means contrasts:
show_tests(ls_means(model))
# Compute pairwise differences of LS-means for each factor:
ls_means(model, pairwise=TRUE)
difflsmeans(model) # Equivalent.
# }
Run the code above in your browser using DataLab