Marginaleffects
R package to compute and plot predictions, slopes, marginal means, and comparisons (contrasts, risk ratios, odds, etc.) for over 100 classes of statistical and ML models. Conduct linear and non-linear hypothesis tests, or equivalence tests. Calculate uncertainty estimates using the delta method, bootstrapping, or simulation-based inference
Install / Use
/learn @vincentarelbundock/MarginaleffectsREADME
marginaleffects.com
marginaleffects is a package for R and Python that makes it easy to interpret the results of statistical and machine learning models. Users can compute predictions, comparisons (contrasts, risk ratios, etc.), slopes (partial derivatives and marginal effects), and hypothesis tests for over 100 classes of statistical and machine learning models.
<a href="https://www.routledge.com/9781032908724"><img src="https://marginaleffects.com/assets/model_to_meaning_cover.png" alt="Model to Meaning cover" align="right" width="25%"></a>
Model to Meaning is a companion book that teaches a simple, consistent, and powerful conceptual framework to help analysts make sense of statistical and machine learning models. A free HTML version of the full book is available online.
Arel-Bundock, Vincent. 2026. Model to Meaning: How to Interpret Statistical Models in R and Python. CRC Press. routledge.com/9781032908724
The R and Python packages, documentation, and full free book are available at marginaleffects.com.
