SKILL.md
Event Study Skill
This skill covers everything needed to conduct event studies in R - from the traditional two-way fixed effects (TWFE) approach through modern robust estimators that handle staggered treatment timing and heterogeneous treatment effects.
When to Use This Skill
Use this skill when the user wants to:
- Create event study plots (coefficient plots around a treatment event)
- Test for parallel pre-trends in a difference-in-differences design
- Estimate dynamic treatment effects
- Work with staggered treatment adoption (units treated at different times)
- Implement any of the modern DiD estimators (Callaway & Sant'Anna, Sun & Abraham, etc.)
- Diagnose problems with TWFE under treatment effect heterogeneity
Quick Decision Tree
Before writing any code, determine the user's situation:
-
Is treatment timing the same for all treated units?
- Yes → Traditional TWFE event study is fine. See
traditional-event-study.md - No (staggered) → Go to step 2.
- Yes → Traditional TWFE event study is fine. See
-
Is there reason to expect heterogeneous treatment effects across cohorts or over time?
- No strong reason → Traditional TWFE may still be OK, but consider robust alternatives.
- Yes or unsure → Use a robust estimator. See
modern-extensions.md
-
What is the user's goal?
- Quick visualization of pre-trends → Traditional approach, fast and familiar.
- Publication-quality estimation → Recommend a robust estimator + traditional as comparison.
- Diagnostic check → Bacon decomposition to understand TWFE weights.
Core Concepts (Brief)
An event study plot displays estimated coefficients for leads (pre-treatment periods) and lags (post-treatment periods) relative to a baseline period (typically one period before treatment). The key elements are:
