Learn R Programming

⚠️There's a newer version (0.25.1) of this package.Take me there.

The marginaleffects package for R

marginaleffects allows users to compute and plot predictions, slopes, marginal means, and comparisons (contrasts, risk ratios, odds, etc.) for over 100 classes of statistical models. It can conduct linear and non-linear hypothesis tests, or equivalence tests, and calculate uncertainty estimates using the delta method, bootstrapping, or simulation-based inference.

The marginaleffects book (website) includes a “Get started” page, and over 25 chapters full of tutorials, case studies, and technical notes.

https://marginaleffects.com

Copy Link

Version

Install

install.packages('marginaleffects')

Monthly Downloads

23,482

Version

0.16.0

License

GPL (>= 3)

Maintainer

Vincent Arel-Bundock

Last Published

October 19th, 2023

Functions in marginaleffects (0.16.0)

get_averages

Average Estimates (aka "Margins")
expect_marginal_means

tinytest helper
get_coef

Get a named vector of coefficients from a model object (internal function)
comparisons

Comparisons Between Predictions Made With Different Regressor Values
expect_margins

tinytest helper
get_model_matrix

Get a named model matrix
get_group_names

Get levels of the outcome variable in grouped or multivariate models
get_predict

Get predicted values from a model object (internal function)
get_varcov_args

Take a summary() style vcov argument and convert it to insight::get_varcov()
inferences

(EXPERIMENTAL) Bootstrap, Conformal, and Simulation-Based Inference
get_vcov

Get a named variance-covariance matrix from a model object (internal function)
hypotheses

(Non-)Linear Tests for Null Hypotheses, Joint Hypotheses, Equivalence, Non Superiority, and Non Inferiority
marginaleffects

marginaleffects() is an alias to slopes()
marginalmeans

marginal_means() is an alias to marginal_means()
marginal_means

Marginal Means
plot_cap

plot_predictions() is an alias to plot_predictions()
posteriordraws

posteriordraws() is an alias to posterior_draws()
plot_cco

plot_comparisons() is an alias to plot_comparisons()
posterior_draws

Extract Posterior Draws or Bootstrap Resamples from marginaleffects Objects
plot_slopes

Plot Conditional or Marginal Slopes
predictions

Predictions
meffects

meffects() is an alias to slopes()
slopes

Slopes (aka Partial derivatives, Marginal Effects, or Trends)
print.marginaleffects

Print marginaleffects objects
plot_cme

plot_slopes() is an alias to plot_slopes()
reexports

Objects exported from other packages
plot_comparisons

Plot Conditional or Marginal Comparisons
plot_predictions

Plot Conditional or Marginal Predictions
sanitize_model_specific.glimML

Method to raise model-specific warnings and errors
set_coef

Internal function to set coefficients
expect_predictions

tinytest helper
datagrid

Data grids
expect_slopes

tinytest helper
complete_levels

Create a data.frame with all factor or character levels
deltamethod

deltamethod() is an alias to hypotheses()