skills/27-dariia-m-my_claude_skills/event-studies/SKILL.md
Use this skill whenever the user wants to conduct an event study, create event study plots, test for parallel trends, implement difference-in-differences designs, or work with any panel data estimation that involves pre/post treatment comparisons. Trigger on phrases like "event study", "parallel trends", "pre-trends", "dynamic treatment effects", "leads and lags", "TWFE", "two-way fixed effects", "staggered adoption", "staggered treatment", "difference-in-differences", "DiD", "Sun and Abraham", "Callaway and Sant'Anna", "de Chaisemartin", "Borusyak", "did_multiplegt", "fixest", "did2s", "bacon decomposition", or any reference to plotting coefficients around a treatment event. Also trigger when the user uploads panel data and wants to estimate treatment effects with variation in treatment timing. All code is in R.
npx skillsauth add brycewang-stanford/Awesome-Agent-Skills-for-Empirical-Research event-studyInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
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.
Use this skill when the user wants to:
Before writing any code, determine the user's situation:
Is treatment timing the same for all treated units?
traditional-event-study.mdIs there reason to expect heterogeneous treatment effects across cohorts or over time?
modern-extensions.mdWhat is the user's goal?
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:
The parallel trends assumption states that, absent treatment, treated and control units would have followed the same trajectory. Pre-trend coefficients near zero are necessary (but not sufficient) evidence for this.
For any event study request, follow this general workflow:
Read these as needed based on the user's situation:
traditional-event-study.md - Traditional TWFE event study with fixest.
Read this for any event study request. It covers the baseline approach, plotting,
and the assumptions behind it.
modern-extensions.md - Modern robust estimators for staggered designs.
Read this when treatment timing varies across units or when the user asks about
heterogeneous treatment effects, or any of the newer DiD methods.
diagnostics-and-testing.md - Pre-trend testing, placebo checks,
Bacon decomposition, sensitivity analysis. Read this when the user wants to
validate their design or when you spot potential issues.
| Package | Purpose | When to use |
|---------|---------|-------------|
| fixest | TWFE event studies, Sun & Abraham | Default starting point |
| did | Callaway & Sant'Anna estimator | Staggered treatment, heterogeneous effects |
| did2s | Gardner (2022) two-stage DiD | Staggered treatment, clean decomposition |
| DIDmultiplegt | de Chaisemartin & D'Haultfoeuille | Staggered, robust to heterogeneity |
| bacondecomp | Bacon decomposition | Diagnosing TWFE problems |
| HonestDiD | Sensitivity analysis for pre-trends | Robustness checks on parallel trends |
| ggplot2 | Plotting | Always |
| modelsummary | Regression tables | When user needs tables |
All event study plots should follow these defaults (user can override):
ggplot2 with theme_minimal() or a clean custom themegeom_point + geom_errorbar),
NOT connected lines with shaded ribbons (geom_line + geom_ribbon). Each period t should
show an individual point with its own error bar. This is the standard format in economics journals.tools
Show mcp-stata identity, connected tools, and status. Use when the user asks if mcp-stata is available, asks about access to the toolkit, or asks what Stata tools are connected.
tools
Activate when users mention Stata commands, .do files, regressions, econometrics, stored results, graphs, dataset inspection, replication, or Stata errors. Route the task through mcp-stata tools and the specialized research skills instead of treating it as plain text coding.
development
Build and review paper-ready regression, balance, and summary tables from Stata outputs. Use when the user needs a clean table for a draft, appendix, or coauthor share-out.
tools
Install, configure, update, or verify mcp-stata across Claude Code, Codex, Gemini CLI, Cursor, Windsurf, and VS Code. Activate when users ask to set up the Stata toolkit or troubleshoot the installation.