Skip to main content

No project description provided

Project description

The parameters of a statistical model can sometimes be difficult to interpret substantively, especially when that model includes non-linear components, interactions, or transformations. Analysts who fit such complex models often seek to transform raw parameter estimates into quantities that are easier for domain experts and stakeholders to understand, such as predictions, contrasts, risk differences, ratios, odds, lift, slopes, and so on.

Unfortunately, computing these quantities---along with associated standard errors---can be a tedious and error-prone task. This problem is compounded by the fact that modeling packages in R and Python produce objects with varied structures, which hold different information. This means that end-users often have to write customized code to interpret the estimates obtained by fitting Linear, GLM, GAM, Bayesian, Mixed Effects, and other model types. This can lead to wasted effort, confusion, and mistakes, and it can hinder the implementation of best practices.

Marginal Effects Zoo: The Book

This free online book introduces a conceptual framework to clearly define statistical quantities of interest, and shows how to estimate those quantities using the marginaleffects package for R and Python. The techniques introduced herein can enhance the interpretability of over 100 classes of statistical and machine learning models, including linear, GLM, GAM, mixed-effects, bayesian, categorical outcomes, XGBoost, and more. With a single unified interface, users can compute and plot many estimands, including:

  • Predictions (aka fitted values or adjusted predictions)
  • Comparisons such as contrasts, risk differences, risk ratios, odds, etc.
  • Slopes (aka marginal effects or partial derivatives)
  • Marginal means
  • Linear and non-linear hypothesis tests
  • Equivalence tests
  • Uncertainty estimates using the delta method, bootstrapping, simulation, or conformal inference.
  • Much more!

The Marginal Effects Zoo book includes over 30 chapters of tutorials, case studies, and technical notes. It covers a wide range of topics, including how the marginaleffects package can facilitate the analysis of:

  • Experiments
  • Observational data
  • Causal inference with G-Computation
  • Machine learning models
  • Bayesian modeling
  • Multilevel regression with post-stratification (MRP)
  • Missing data
  • Matching
  • Inverse probability weighting
  • Conformal prediction

Get started by clicking here!

How to help

The marginaleffects package and the Marginal Effects Zoo book will always be free. If you like this project, you can contribute in four ways:

  1. Make a donation to the Native Women's Shelter of Montreal or to Give Directly, and send me (Vincent) a quick note. You'll make my day.
  2. Submit bug reports, documentation improvements, or code contributions to the Github repositories of the R version or the Python version of the package.
  3. Cite the marginaleffects package in your work and tell your friends about it.
  4. Create a new entry for the Meme Gallery!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

marginaleffects-0.0.9.tar.gz (39.9 kB view details)

Uploaded Source

Built Distribution

marginaleffects-0.0.9-py3-none-any.whl (49.9 kB view details)

Uploaded Python 3

File details

Details for the file marginaleffects-0.0.9.tar.gz.

File metadata

  • Download URL: marginaleffects-0.0.9.tar.gz
  • Upload date:
  • Size: 39.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.10.6 Linux/5.15.133.1-microsoft-standard-WSL2

File hashes

Hashes for marginaleffects-0.0.9.tar.gz
Algorithm Hash digest
SHA256 1ed6a33ea7e869ec2be08252f57fba8aa6b2aad7137aaa45aa007a8149d2167e
MD5 965e16d9270499a3864caa4e22e4540f
BLAKE2b-256 7a15018b6702f19ebe174498947a740f95f6c88317b8ba0c3b5b5edeee7c854d

See more details on using hashes here.

File details

Details for the file marginaleffects-0.0.9-py3-none-any.whl.

File metadata

  • Download URL: marginaleffects-0.0.9-py3-none-any.whl
  • Upload date:
  • Size: 49.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.10.6 Linux/5.15.133.1-microsoft-standard-WSL2

File hashes

Hashes for marginaleffects-0.0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 766e41de69d0b48d2634243ed9124a2b30c5135afbd8f4692ced9a133b728721
MD5 9a50db13122f4754d995de1627fe5cbc
BLAKE2b-256 1e40ff2e039ce42187f7aab1d43a4273b1db72877a40f54201d1c00beedeba84

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page