marginaleffects

Compute predictions, contrasts, slopes, and hypothesis tests for R and Python models.

629|70|Updated Sep 6, 2021
One-click install
npx skills add https://github.com/vincentarelbundock/marginaleffects --skill marginaleffects
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: marginaleffects
Source: https://github.com/vincentarelbundock/marginaleffects/tree/main/skill
Command: npx skills add https://github.com/vincentarelbundock/marginaleffects --skill marginaleffects

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill translates opaque model outputs into clear, actionable marginal-effect insights for data analysts across R and Python.

Core Features & Use Cases

  • Convert model results into marginal effects, including predictions, contrasts, slopes, and hypothesis tests.
  • Provide unit-level (conditional) and average (marginal) estimates for a wide range of estimands (ATE, ATT, CATE, risk/odds ratios, etc.).
  • Support exploratory grids and counterfactual scenarios via datagrid-like operations to explore predictor spaces.

Quick Start

Install and load the marginaleffects Skill, then ask for guidance on interpreting predictions, contrasts, and slopes from your model results.

Frequently Asked Questions about marginaleffects

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I compute marginal effects and contrasts from model outputs in R and Python?

Compute marginal effects by translating model outputs into predictions, contrasts, and slopes using functions like avg_predictions and avg_comparisons. This Skill supports both unit-level and aggregate summaries for R and Python users.

What is the difference between average predictions and unit-level slopes in hypothesis testing?

Average predictions provide aggregate marginal estimates across a population, while unit-level slopes offer conditional estimates for individual observations. Both estimands support hypothesis tests for various queries like ATE, ATT, and CATE.

Can I specify uncertainty and grids for counterfactual scenarios in marginal effects analysis?

Yes, you can specify uncertainty and use datagrid-like operations to explore predictor spaces and counterfactual scenarios. This allows for detailed by-group analyses and testing across custom predictor grids.

Does this approach support risk ratios and odds ratios for categorical model outcomes?

Yes, the framework supports a wide range of estimands including risk ratios, odds ratios, ATE, ATT, and CATE. It applies these computations across diverse model types for both R and Python environments.

What is the five-question framework for interpreting model results?

The five-question framework is an enforced methodology for clarifying model outputs through marginal effects. It structures the computation of predictions, contrasts, slopes, and hypothesis tests to ensure actionable insights.

When should I use avg_comparisons instead of standard model summaries?

Use avg_comparisons when standard model outputs are opaque and you need actionable marginal-effect insights. It translates complex results into clear contrasts and predictions for exploratory grids and by-group analyses.