did_causal_analysis

Quantify causal effects of interventions using Difference-in-Differences with p-values and confidence intervals.

4|Updated Feb 22, 2026
One-click install
npx skills add https://github.com/GeneralReasoning/env-skillsbench --skill did-causal-analysis
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: did_causal_analysis
Source: https://github.com/GeneralReasoning/env-skillsbench/tree/main/trend-anomaly-causal-inference/environment/skills/did_causal_analysis
Command: npx skills add https://github.com/GeneralReasoning/env-skillsbench --skill did-causal-analysis

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pandas, numpy, statsmodels, and includes scripts (resource) components.

What problem does it solve?

Difference-in-Differences causal analysis to identify demographic drivers of behavioral changes with p-value significance testing. Use for event effects, A/B testing, or policy evaluation.

Core Features & Use Cases

  • Multivariate Heterogeneous DiD: estimate collective treatment effects across multiple features with interaction terms.
  • Univariate DiD fallback: robust when sample size is small, providing per-feature estimates.
  • Transparent reporting: outputs include DiD estimates, p-values, standard errors, and confidence intervals for interpretation across groups and periods.
  • Data preparation guidance: supports both intensive (sparse, participants-only) and extensive (complete panel) margins, with code examples for proper data structuring.
  • Flexible usage: designed for event studies, A/B tests, policy evaluation, and other pre/post intervention analyses.

Quick Start

Provide a dataset with a 'Period' column (baseline or treatment), feature columns for groups, and a numeric outcome column, then run the analysis to obtain DiD estimates, p-values, and confidence intervals.

Frequently Asked Questions about did_causal_analysis

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

FAQPage Schema
How do I use difference-in-differences to estimate the causal effect of a policy change?

Difference-in-differences estimates causal effects by comparing pre- and post-treatment observations across groups. This Skill calculates DiD estimates, p-values, and confidence intervals for policy evaluation using your panel data.

Can I run causal inference analysis with multiple features and interaction terms?

Yes, causal inference supports multivariate heterogeneous DiD with interaction terms to estimate collective treatment effects across multiple features. It returns per-feature estimates with p-values and confidence intervals for robust interpretation.

What is the best way to handle difference-in-differences when my sample size is small?

For small sample sizes, use the univariate DiD fallback to estimate treatment effects. This approach provides robust per-feature estimates with standard errors and p-values without requiring the data volume needed for multivariate models.

How do I structure panel data for difference-in-differences analysis?

Structure panel data with a 'Period' column indicating baseline or treatment, feature columns for groups, and a numeric outcome column. The Skill supports both intensive sparse margins and extensive complete panels for proper causal analysis.

Does difference-in-differences work for A/B testing and event studies?

Yes, difference-in-differences is applicable to A/B testing, event studies, and policy evaluation. It identifies causal effects of interventions by analyzing pre- and post-treatment observations across control and treatment groups.

What statistical outputs does the DiD analysis provide for significance testing?

The DiD analysis provides effect estimates, standard errors, p-values, and confidence intervals. These transparent statistical outputs allow you to test significance and interpret treatment effects across groups and time periods.