asgard-ai-platform/grad-did
Apply Difference-in-Differences (DID) to estimate causal treatment effects by comparing changes in outcomes between treatment and control groups. Use this skill when the user evaluates policy interventions, natural experiments, or regulatory changes, needs to test parallel trends, or when they ask 'did this policy work', 'how do I identify causal effects without randomization', or 'what is the treatment effect'.
npx skills add https://github.com/asgard-ai-platform/skills --skill grad-did
Difference-in-Differences (DID) estimates causal effects by comparing the change in outcomes over time between a treatment group (affected by an intervention) and a control group (unaffected). By differencing out both time-invariant group differences and common time trends, DID isolates the treatment effect under the parallel trends assumption.
IRON LAW: DID is valid ONLY if the parallel trends assumption holds —
without it, the estimated treatment effect is biased by differential
pre-existing trends.
Key assumptions:
Define who is treated and when. Verify groups are comparable on pre-treatment observables. Document the treatment event and its timing.
Plot outcome trends for treatment vs control groups in pre-treatment periods. Run an event-study specification with leads and lags. Pre-treatment coefficients should be statistically insignificant.
Y = β₀ + β₁×Treat + β₂×Post + β₃×(Treat×Post) + Controls + ε. The coefficient β₃ is the DID estimator. Cluster standard errors at the treatment assignment level. See references/ for staggered adoption extensions.
Run placebo tests (fake treatment dates, fake treatment groups). Test sensitivity to control group choice. For staggered DID, use Callaway-Sant'Anna or Sun-Abraham estimators.
## DID Analysis: [Policy / Intervention]
### Research Design
| Element | Description |
|---------|-------------|
| Treatment group | [who] |
| Control group | [who] |
| Treatment date | [when] |
| Pre-treatment periods | [range] |
### Parallel Trends Test
| Pre-period lead | Coefficient | S.E. | p-value |
|-----------------|-------------|------|---------|
| t-3 | x.xx | x.xx | x.xx |
| t-2 | x.xx | x.xx | x.xx |
| t-1 | x.xx | x.xx | x.xx |
### DID Estimate
| Specification | β (Treat×Post) | S.E. | p-value | N |
|---------------|----------------|------|---------|---|
| Baseline | x.xx | x.xx | x.xx | xxx |
| With controls | x.xx | x.xx | x.xx | xxx |
### Robustness
- Placebo test result: [pass/fail]
- Alternative control group: [result]
### Limitations
- [Note any assumption violations]
Take asgard-ai-platform/grad-did from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.