did-analysis

Guide Difference-in-Differences analysis with assumption checks, model specification, and robustness tests.

6|1|Updated Apr 3, 2026
One-click install
npx skills add https://github.com/zhouziyue233/great-econometrics --skill did-analysis-zhouziyue233
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: did-analysis
Source: https://github.com/zhouziyue233/great-econometrics/tree/main/skills/did-analysis
Command: npx skills add https://github.com/zhouziyue233/great-econometrics --skill did-analysis-zhouziyue233

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

DID analysis is a rigorous, automated workflow for estimating causal effects when treatment is assigned over time. It guides users through assumption validation, model specification, and robustness checks to produce credible ATT estimates.

Core Features & Use Cases

  • Assumption validation: parallel trends checks, pre-treatment event-study diagnostics.
  • Modeling options: 2×2 DID, TWFE, staggered adoption estimators (CS/SA, Sun-Abraham), and dynamic effect analysis.
  • Robustness & diagnostics: placebo tests, alternative controls, permutation tests, and sensitivity analyses.
  • Use Case: evaluate policy changes or natural experiments with staggered adoption across units and time.

Quick Start

Provide your panel data (entity_id, year, treatment, outcome) and ask for a full DID analysis workflow.

Frequently Asked Questions about did-analysis

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

FAQPage Schema
How do I perform a difference-in-differences analysis for staggerated adoption policy evaluation?

To perform a difference-in-differences analysis, provide panel data containing entity_id, year, treatment, and outcome to trigger a workflow guiding assumption checks, model specification, and robustness tests. This produces credible causal inference estimates for policy changes or natural experiments.

How do I check parallel trends assumption before running a DID regression?

To check the parallel trends assumption, the skill guides you through pre-treatment event-study diagnostics and assumption validation. This verifies pre-treatment outcome trajectories are consistent before estimating the actual treatment effect.

Can I use Callaway-Sant'Anna or Sun-Abraham estimators for staggered adoption TWFE designs?

Yes, you can use Callaway-Sant'Anna, Sun-Abraham, and staggered adoption estimators alongside standard 2x2 DID and TWFE designs. The skill specifies appropriate models and calculates dynamic effect analysis for credible ATT estimates.

What robustness tests should I run to validate my difference-in-differences estimates?

To validate difference-in-differences estimates, run placebo tests, alternative controls, permutation tests, and sensitivity analyses. These robustness checks ensure your causal inference withstands diagnostic scrutiny across staggerated adoption timing.

Does this DID workflow support R, Stata, and Python exemplars?

Yes, this DID workflow supports R, Stata, and Python exemplars. It emphasizes parallel trends, treatment timing, and appropriate standard errors across these environments for credible causal inference.

Why does my TWFE regression show negative weights in a staggered adoption design?

For staggered adoption designs, TWFE regressions can produce negative weights due to heterogeneous treatment effects over time. The skill helps specify appropriate estimators like Callaway-Sant'Anna or Sun-Abraham to resolve this and yield credible dynamic effects.