Understanding Statistical Marginal Effects

Aug 21, 2024

Lecture Notes on Interpreting Statistical Results with Marginal Effects

Introduction

  • Recorded talk for USR 2024 in Salzburg.
  • Discussing the marginal effects package developed over the years.
  • Speaker: Professor at the University de moral, Canada, with 15 years of experience publishing packages on CRAN.
  • Recently named associate editor of the ART Journal.

Key Problems in Statistics

  1. Inconsistency in Software Outputs

    • Example: Different outputs from the predict command in R depending on the type of model (e.g., GLM vs. ordinal logit).
    • Inconsistencies slow down users and complicate data analysis.
  2. Difficulty in Interpreting Statistics

    • Example: Logit regression model is hard to interpret due to challenges with probabilities and log-odds ratios.
    • Many people struggle with interpreting probabilities, especially in varying contexts (high and low probabilities).
    • Statistics becomes more complex with interactions and non-linear models.

Proposed Solutions

Post-hoc Transformations

  • Quote: "A parameter is just a resting stone on the road to prediction."
  • Importance of transforming model parameters into intuitive quantities that stakeholders can understand.

Marginal Effects Package

  • Features:
    • Supports 100+ model types (GLM, GAM, mixed effects, machine learning).
    • Provides a consistent workflow across different models.
    • Documented online with 30+ chapters full of case studies.
  • Main Quantities:
    1. Predictions: Fitted values for different predictor values.
    2. Counterfactual Comparisons: Risk differences, odds ratios, etc.
    3. Slopes: Partial derivatives or marginal effects.

Key Functions of the Package

  1. Hypothesis Testing

    • Flexible hypothesis argument available across all functions.
    • Example: Test if two coefficients are equal or compare treatment effects.
  2. Predictions

    • Enhanced predictions function provides richer results (estimates, p-values, confidence intervals).
    • Ability to average predictions by subgroup.
    • Example: Compare average predicted outcomes between different categories.
  3. Counterfactual Comparisons

    • Estimate effects when changing predictor values (e.g., effect of increasing a numeric predictor).
    • Supports various comparisons and ratios, allowing customized analysis.
  4. Slopes Function

    • Provides easy estimation of marginal effects and enables plotting of predictions versus slopes.

Additional Resources

  • Free online book: marginal effects with detailed chapters and illustrations.
  • Other packages maintained by the speaker:
    • Tiny Table: Simple, flexible table creation in various formats (HTML, LaTeX, Markdown).
    • Model Summary: For creating regression tables and descriptive statistics.

Conclusion

  • Encourages engagement through questions via email or social media.
  • Open to issues on GitHub regarding marginal effects or related topics.