January 2016, Volume 69, Issue 1 | Russell V. Lenth
The lsmeans package in R provides a way to compute least-squares means (LS means) and their contrasts for various statistical models. LS means are predictions from a linear model or averages thereof, used to summarize the effects of factors and test linear contrasts. The package supports models fitted by R, including linear and mixed models, and allows for extending it to cover more model classes.
LS means are computed relative to a reference grid, which is defined by the levels of predictors in the model. The reference grid is essential for computing LS means, and the package provides functions to create and manipulate it. The package also allows for altering the reference grid by specifying different levels for predictors.
The package includes functions for working with LS means, such as computing contrasts, pairwise comparisons, and polynomial contrasts. It also supports graphical displays of LS means and their confidence intervals, as well as handling transformed responses and link functions in generalized linear models.
The package is also compatible with multcomp, providing methods for simultaneous testing and multiple comparisons. It supports a wide range of models, including multivariate models, ordinal models, and Bayesian models fitted via MCMC methods. The package includes functions for estimating trends, handling messy data, and providing summaries of results.
The lsmeans package is a valuable tool for analyzing experimental data, providing a flexible and powerful way to compute and compare LS means across various models and data types.The lsmeans package in R provides a way to compute least-squares means (LS means) and their contrasts for various statistical models. LS means are predictions from a linear model or averages thereof, used to summarize the effects of factors and test linear contrasts. The package supports models fitted by R, including linear and mixed models, and allows for extending it to cover more model classes.
LS means are computed relative to a reference grid, which is defined by the levels of predictors in the model. The reference grid is essential for computing LS means, and the package provides functions to create and manipulate it. The package also allows for altering the reference grid by specifying different levels for predictors.
The package includes functions for working with LS means, such as computing contrasts, pairwise comparisons, and polynomial contrasts. It also supports graphical displays of LS means and their confidence intervals, as well as handling transformed responses and link functions in generalized linear models.
The package is also compatible with multcomp, providing methods for simultaneous testing and multiple comparisons. It supports a wide range of models, including multivariate models, ordinal models, and Bayesian models fitted via MCMC methods. The package includes functions for estimating trends, handling messy data, and providing summaries of results.
The lsmeans package is a valuable tool for analyzing experimental data, providing a flexible and powerful way to compute and compare LS means across various models and data types.