# NOT RUN {
# Fit example model:
data("cake", package="lme4")
cake$Temp <- factor(cake$temperature, ordered = FALSE)
model <- lmer(angle ~ recipe + Temp + (1|recipe:replicate), cake)
# Extract LS-means:
head(lsm <- ls_means(model))
# Coerce LS-means objects to data.frames:
head(as.data.frame(lsm))
head(as.data.frame(lsm, add_levels=FALSE))
# }
Run the code above in your browser using DataLab