emmeans is a continuation of the package lsmeans. The latter will eventually be retired.
Estimated marginal means (EMMs, previously known as least-squares means in the context of traditional regression models) are derived by using a model to make predictions over a regular grid of predictor combinations (called a reference grid). These predictions may possibly be averaged (typically with equal weights) over one or more of the predictors. Such marginally-averaged predictions are useful for describing the results of fitting a model, particularly in presenting the effects of factors. The emmeans package can easily produce these results, as well as various graphs of them (interaction-style plots and side-by-side intervals).
cldmethod for display of grouping symbols.
glhtfunction in the multcomp package.
emtrendsfunction works in terms of a reference grid of predicted slopes of trend lines for each factor combination.
aovlist), linear and generalized linear mixed models (e.g., nlme, lme4, afex), ordinal-response models (e.g., ordinal, MASS), survival analysis (e.g., survival, coxme), generalized estimating equations (gee, geepack), and others. See
help("models", package = "emmeans")
Package developers may provide emmeans support for their models by providing
emm_basis methods. See
vignette("extending", package = "emmeans")
To install the latest development version from Github, install the newest version of the devtools package; then run
devtools::install_github("rvlenth/emmeans", dependencies = TRUE, build_vignettes = TRUE)
Note: If you are a Windows user, you should also first download and install the latest version of
For the latest release notes on this development version, see the NEWS file