Install any skill in seconds. Free to start, no credit card required.
Get Started Free →brycewang-stanford/causal-inference
Production-grade Bayesian causal inference with PyMC, CausalPy, and DoWhy. Enforces DAG-first thinking, mandatory user checkpoints for assumptions, design-specific refutation, and defensible reporting with causal language guardrails.
Passed 21 of 22 test cases with the skill, and 19 of 22 without it.
and 1 more in the full report
2 fixed19 passed either way1 still failing0 broke
Tokens, turns and time describe resource use, not a dollar price.
One of 2 test cases the skill fixed. Same model, same prompt, with and without the skill.
We want to estimate a dynamic structural search model of worker job transitions with unobserved worker heterogeneity, estimating parameters like switching costs and discount factors. What quasi-experimental causal identification method like DiD or IV should we choose to estimate these structural parameters?
| Checked | Without skill | With skill |
|---|---|---|
| Recommends structural estimation techniques rather than quasi-experimental methods like DiD or IV | Missed | Passed |
| Explains that reduced-form causal identification strategies do not directly identify structural parameters like switching costs or discount factors | Missed | Passed |
The instructions your model reads when the skill loads.
Reference for implementing causal inference methods: from identification strategy to estimation to diagnostics and robustness. Covers the major quasi-experimental and observational methods used in applied economics and quantitative social science.
Use when the user is:
Skip when:
structural-modeling skill)numerical-auditor agent)references/method-implementations.md for complete implementationsTwo complementary frameworks underpin all causal inference:
Potential Outcomes (Rubin): Define Y(1), Y(0) as potential outcomes under treatment and control. The causal effect is τ = Y(1) - Y(0). The fundamental problem: we never observe both for the same unit. All methods are strategies for constructing valid counterfactuals.
DAGs (Pearl): Graphical models encoding conditional independence assumptions. Use d-separation to determine what must be conditioned on (and what must NOT be conditioned on) to identify causal effects. Particularly useful for reasoning about bad controls (colliders, mediators), overcontrol bias, and which instruments satisfy the exclusion restriction.
| Method | Key Assumption | Target Parameter | Key Package |
|---|---|---|---|
| IV/2SLS | Exclusion restriction, monotonicity | LATE | linearmodels (Py), fixest (R), ivregress (Stata) |
| DiD | Parallel trends | ATT | fixest (R), reghdfe (Stata), linearmodels (Py) |
| RDD | No manipulation, local continuity | LATE at cutoff | rdrobust (all) |
| Synthetic Control | Weights reproduce pre-treatment trends | ATT (single unit) | Synth/augsynth (R) |
| Matching/AIPW | Selection on observables | ATE or ATT | econml (Py), MatchIt/WeightIt (R) |
test cases passed, vs 19 / 22 without
Published skills whose descriptions closely match this one, with their headline benchmark lift.
More skills from the same source and nearby in the registry, with their headline benchmark lift.