emmeans

Estimated marginal means

https://github.com/rvlenth/emmeans

Science Score: 36.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
    2 of 21 committers (9.5%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (13.2%) to scientific vocabulary

Keywords from Contributors

tidy-data package-creation easystats data-wrangling visualisation report grammar data-manipulation recoding labelled-data
Last synced: 10 months ago · JSON representation

Repository

Estimated marginal means

Basic Info
Statistics
  • Stars: 394
  • Watchers: 11
  • Forks: 35
  • Open Issues: 3
  • Releases: 0
Created almost 9 years ago · Last pushed 10 months ago
Metadata Files
Readme Changelog

README.md

R package emmeans: Estimated marginal means

Website

https://rvlenth.github.io/emmeans/

Features

Estimated marginal means (EMMs, also 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).

  • Estimation and testing of pairwise comparisons of EMMs, and several other types of contrasts, are provided.

  • In rank-deficient models, the estimability of predictions is checked, to avoid outputting results that are not uniquely defined.

  • For models where continuous predictors interact with factors, the package's emtrends function works in terms of a reference grid of predicted slopes of trend lines for each factor combination.

  • Vignettes are provided on various aspects of EMMs and using the package. See the CRAN page.

  • We try to provide flexible (but pretty basic) graphics support for the emmGrid objects produced by the package. Also, support is provided for nested fixed effects.

  • Response transformations and link functions are supported via a type argument in many functions (e.g., type = "response" to back-transform results to the response scale). Also, a regrid() function is provided to reconstruct the object on any transformed scale that the user wishes.

  • Two-way support of the glht function in the multcomp package.

Model support

  • The package incorporates support for many types of models, including standard models fitted using lm, glm, and relatives, various mixed models, GEEs, survival models, count models, ordinal responses, zero-inflated models, and others. Provisions for some models include special modes for accessing different types of predictions; for example, with zero-inflated models, one may opt for the estimated response including zeros, just the linear predictor, or the zero model. For details, see vignette("models", package = "emmeans")

  • Various Bayesian models (carBayes, MCMCglmm, MCMCpack) are supported by way of creating a posterior sample of least-squares means or contrasts thereof, which may then be examined using tools such as in the coda package.

  • Package developers are encouraged to incorporate emmeans support for their models by writing recover_data and emm_basis methods. See vignette("extending", package = "emmeans")

Versions and installation

  • CRAN The latest CRAN version may be found at https://CRAN.R-project.org/package=emmeans. Also at that site, formatted versions of this package's vignettes may be viewed.

  • GitHub To install the latest development version from GitHub, install the newest version of the remotes package. If you are a Windows user, you should also first download and install the latest version of Rtools. Then run

r remotes::install_github("rvlenth/emmeans", dependencies = TRUE, build_vignettes = TRUE) Omitting the build_vignettes argument can save some time if you don't want the vignettes. They can always be found for the latest CRAN version or -- perhaps more up-to-date -- the emmeans site.

Note:

For the latest release notes on this development version, see the NEWS file

Rounding

For its summary output, emmeans uses an optimal-digits algorithm that rounds results to about the number of digits that are useful, relative to estimates' confidence limits. This avoids cluttering the output, but it is unlike other R results, which are typically less round. If this is annoying to you, there is an option (opt.digits = FALSE) that disables the optimal-digits routine.

"Tidiness" can be dangerous

I see more and more users who are in a terrible hurry to get results. They develop a "workflow" where they plan-out several steps at once and pipe them together. That's useful when you don't have to think about what happens in those steps; but when you're doing statistics, you should be thinking! Most functions in the emmeans package yield results that are accompanied by annotations such as transformations involved, P-value adjustments made, the families for those adjustments, etc. If you just pipe the results into some more code, you never see those annotations.

Please slow down! Look at the actual results from each emmeans package function without any post-processing -- None. That way, you'll see the annotated summaries. Statistics is pretty hard stuff. Don't make it harder by blindfolding yourself.

Supersession plan

The developer of emmeans continues to maintain and occasionally add new features. However, none of us is immortal; and neither is software. I have thought of trying to find a co-maintainer who could carry the ball once I am gone or lose interest, but the flip side of that is that the codebase is not getting less messy as time goes on -- why impose that on someone else? So my thought now is that if at some point, enough active R developers want the capabilities of emmeans but I am no longer in the picture, they should feel free to supersede it with some other package that does it better. All of the code is publicly available on GitHub, so just take what is useful and replace what is not.

Note: *emmeans** supersedes the package lsmeans. The latter is just a front end for emmeans, and in fact, the lsmeans() function itself is part of emmeans.*

Owner

  • Name: Russell V. Lenth
  • Login: rvlenth
  • Kind: user
  • Location: Iowa City, IA

Retired professor of statistics, University of Iowa. Dev. web-based applets in Java for sample-size and power, and R packages estimability, lsmeans, and rsm

GitHub Events

Total
  • Issues event: 45
  • Watch event: 31
  • Delete event: 1
  • Issue comment event: 144
  • Push event: 50
  • Pull request review event: 1
  • Pull request event: 7
  • Fork event: 4
  • Create event: 3
Last Year
  • Issues event: 45
  • Watch event: 31
  • Delete event: 1
  • Issue comment event: 144
  • Push event: 50
  • Pull request review event: 1
  • Pull request event: 7
  • Fork event: 4
  • Create event: 3

Committers

Last synced: 12 months ago

All Time
  • Total Commits: 622
  • Total Committers: 21
  • Avg Commits per committer: 29.619
  • Development Distribution Score (DDS): 0.055
Past Year
  • Commits: 36
  • Committers: 2
  • Avg Commits per committer: 18.0
  • Development Distribution Score (DDS): 0.028
Top Committers
Name Email Commits
Russell V. Lenth r****h@u****u 588
Fernando Miguez f****z 4
Hannes Riebl h****l@u****e 4
jpiaskowski j****k@g****m 4
Will Beasley w****y@h****m 3
Balazs Banfai b****i@r****m 3
retodomax 3****x 2
Iago i****o@d****e 1
Russell Lenth R****h 1
Balazs Banfai 5****. 1
Ben Bolker b****r@g****m 1
Bill Denney b****y 1
Daniel m****l@d****e 1
Henrik Singmann s****n 1
Jonathon Love j****n@t****c 1
Mara Averick m****k@g****m 1
Nina Munkholt Jakobsen nm@j****g 1
Pawel Rucki 1****u 1
iago-pssjd 4****d 1
iago-pssjd i****e@s****s 1
maarten-jung j****n@g****m 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 10 months ago

All Time
  • Total issues: 199
  • Total pull requests: 23
  • Average time to close issues: 26 days
  • Average time to close pull requests: 1 day
  • Total issue authors: 115
  • Total pull request authors: 10
  • Average comments per issue: 5.51
  • Average comments per pull request: 1.83
  • Merged pull requests: 17
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 33
  • Pull requests: 6
  • Average time to close issues: 10 days
  • Average time to close pull requests: 2 days
  • Issue authors: 27
  • Pull request authors: 4
  • Average comments per issue: 4.45
  • Average comments per pull request: 1.5
  • Merged pull requests: 4
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • Generalized (23)
  • qdread (10)
  • rvlenth (8)
  • gevro (8)
  • mattansb (6)
  • hugesingleton (6)
  • Dallak (4)
  • adrianolszewski (4)
  • MarcRieraDominguez (4)
  • hnguyen19 (3)
  • albertostefanelli (3)
  • samyogita-hardikar (3)
  • walrossker (3)
  • strengejacke (2)
  • derek-corcoran-barrios (2)
Pull Request Authors
  • jpiaskowski (7)
  • iago-pssjd (5)
  • banfai (4)
  • retodomax (4)
  • pawelru (2)
  • rvlenth (2)
  • wibeasley (2)
  • MichaelChirico (2)
  • bbolker (1)
  • maarten-jung (1)
Top Labels
Issue Labels
question (113) bug (42) enhancement (6) wontfix (2)
Pull Request Labels

Packages

  • Total packages: 2
  • Total downloads:
    • cran 113,519 last-month
  • Total docker downloads: 67,178
  • Total dependent packages: 102
    (may contain duplicates)
  • Total dependent repositories: 243
    (may contain duplicates)
  • Total versions: 107
  • Total maintainers: 1
cran.r-project.org: emmeans

Estimated Marginal Means, aka Least-Squares Means

  • Versions: 68
  • Dependent Packages: 91
  • Dependent Repositories: 239
  • Downloads: 113,519 Last month
  • Docker Downloads: 67,178
Rankings
Downloads: 1.0%
Dependent packages count: 1.0%
Dependent repos count: 1.1%
Stargazers count: 1.2%
Forks count: 2.9%
Average: 4.5%
Docker downloads count: 19.8%
Maintainers (1)
Last synced: 10 months ago
conda-forge.org: r-emmeans
  • Versions: 39
  • Dependent Packages: 11
  • Dependent Repositories: 4
Rankings
Dependent packages count: 5.5%
Dependent repos count: 16.0%
Average: 19.7%
Stargazers count: 22.6%
Forks count: 34.5%
Last synced: 10 months ago

Dependencies

DESCRIPTION cran
  • R >= 3.5.0 depends
  • CARBayes * enhances
  • MCMCglmm * enhances
  • MCMCpack * enhances
  • coxme * enhances
  • gee * enhances
  • geepack * enhances
  • mice * enhances
  • nnet * enhances
  • pscl * enhances
  • rstanarm * enhances
  • sommer * enhances
  • survival * enhances
  • estimability >= 1.3 imports
  • graphics * imports
  • methods * imports
  • mvtnorm * imports
  • numDeriv * imports
  • stats * imports
  • utils * imports
  • xtable >= 1.8 imports
  • MASS * suggests
  • MuMIn * suggests
  • bayesplot * suggests
  • bayestestR * suggests
  • biglm * suggests
  • brms * suggests
  • car * suggests
  • coda >= 0.17 suggests
  • ggplot2 * suggests
  • knitr * suggests
  • lattice * suggests
  • lme4 * suggests
  • lmerTest >= 2.0.32 suggests
  • logspline * suggests
  • mediation * suggests
  • mgcv * suggests
  • multcomp * suggests
  • multcompView * suggests
  • nlme * suggests
  • ordinal >= 2014.11 suggests
  • pbkrtest >= 0.4 suggests
  • rmarkdown * suggests
  • rsm * suggests
  • scales * suggests
  • splines * suggests
  • testthat * suggests