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
Recommend AND run open-source AI tools, agents, Claude Code / Codex skills, and MCP servers for any stage of a literature review — searching, reading, extracting, synthesizing, screening, citation-checking, and paper writing. Use when the user asks "what tool should I use to..." OR "install/run/use <tool> to ..." for research/lit-review work: automating a survey or related-work section, PDF→Markdown extraction for LLMs (MinerU/marker/docling), PRISMA / systematic review (ASReview), citation-backed Q&A over PDFs (PaperQA2), wiring papers into Claude/Cursor via MCP (arxiv/paper-search/zotero servers), or chatting with a Zotero library. Ships a launcher (scripts/litrun.py) that installs each tool in an isolated venv and runs it. Curated catalog of 70+ vetted projects. 支持中英文(用于「文献综述工具选型」与「一键安装/运行」)。
development
Route empirical-research requests through the Auto-Empirical Research Skills catalog when this whole repository is installed as one skill in Codex, CodeBuddy, Claude Code, or another IDE. Use to choose and load the right vendored AERS skill for causal inference, econometrics, replication, data acquisition, manuscript writing, peer review and referee responses, citation checking, de-AIGC editing, or full empirical-paper workflows without reading the entire repository at once.
documentation
Use when the project collects primary data or runs a field, lab, or survey experiment, before the intervention begins — write the pre-analysis plan, size the sample from a power calculation, and register with the AEA RCT Registry. Apply after the design is chosen in aer-identification and before any outcome data are seen.
tools
Guide economists to authoritative data sources with explicit, confirmed data specifications before retrieval; interfaces with Playwright MCP to navigate portals and extract real data, not articles about data.