How to Interpret Statistical Results
Using marginaleffects
for R
and Python
Our world is complex. To make sense of it, data analysts routinely fit sophisticated statistical or machine learning models. Interpreting the results produced by such models can be challenging, and researchers often struggle to communicate their findings to colleagues and stakeholders.
This website is designed to help data analysts overcome these challenges. It hosts free software and tutorials designed to empower researchers who want to translate model outputs into accurate insights that are accessible to a wide audience.
This website hosts a forever free online version of this forthcoming book:
How to interpret statistical results using
marginaleffects
forR
andPython
. Arel-Bundock, Vincent. Under contract with CRC Chapman & Hall.
Readers who do not have time for a book-length treatment may prefer this forthcoming article in the Journal of Statistical Software, or the quick start tutorial.
The book and article present a simple but powerful conceptual framework to help analysts make sense of complex models. They also offer detailed tutorials on marginaleffects
, a free software library for R
and Python
. marginaleffects
offers a single point of entry to easily interpret the results of over 100 different types of statistical and machine learning models in R
and Python
.
- Powerful: It can compute and plot predictions; comparisons (contrasts, risk ratios, etc.); slopes; and conduct hypothesis and equivalence tests for over 100 different classes of models in
R
. - Simple: All functions share a simple and unified interface.
- Documented: Each function is thoroughly documented with abundant examples. The marginaleffects.com website hosts a free textbook with several thousands of words of tutorials and case studies.
- Efficient: Some operations can be up to 1000 times faster and use 30 times less memory than with the
margins
package.
- Valid: When possible, numerical results are checked against alternative software like
Stata
or otherR
packages. - Thin: The
R
package requires relatively few dependencies. - Standards-compliant:
marginaleffects
follows “tidy” principles and returns simple data frames that work with all standardR
functions. The outputs are easy to program with and feed to other packages likeggplot2
ormodelsummary
. - Extensible: Adding support for new models is very easy, often requiring less than 10 lines of new code. Please submit feature requests on Github.
- Active development: Bugs are fixed promptly.
Software documentation, including function reference, changelog, and installation instructions, can be found here:
To cite marginaleffects
in publications, please use:
Arel-Bundock V, Greifer N, Heiss A (Forthcoming). “How to Interpret Statistical Models Using marginaleffects in R and Python.” Journal of Statistical Software.
@Article{,
title = {How to Interpret Statistical Models Using {marginaleffects} in {R} and {Python}},
author = {Vincent Arel-Bundock and Noah Greifer and Andrew Heiss},
year = {Forthcoming},
journal = {Journal of Statistical Software}, }