Causal Inference
11 articles
Matching in Python: a balanced covariate table doesn't make the estimate valid
Propensity-score matching returns 2.21 for a planted effect of 2.0 with a balance table that passes the 0.10 rule. The overlap diagnostic shows 6% of treated units have no comparable control; trimming recovers 2.04.
Difference-in-differences in Python: why the TWFE coefficient can mislead
With staggered adoption and heterogeneous effects, two-way fixed effects returns 1.01 where the planted average is 1.60, and a group-time estimator with clean controls recovers 1.60.
Synthetic control in Python: read the pre-fit before the gap
A hands-on walk through synthetic control in Python: why a zero-error pre-treatment fit is the weakest evidence for the gap, and the pre-fit that is allowed to be large is the diagnostic to trust.
Regression discontinuity in Python: getting the effect at the cutoff right
A global polynomial fit returns a clean, plausible 1.8 where the effect planted at the cutoff is 0.75. A local fit recovers about 0.75. How to estimate a regression discontinuity in Python, and the confounder the local fit still cannot see.
Using difference-in-differences in practice
When difference-in-differences is the right tool, the three assumptions stated as decisions, and the ways it breaks, each shown in a worked Too Early To Say case with open code.
Instrumental variables in Python: a strong first stage doesn't make the estimate valid
2SLS recovers a planted effect of 2.0 where OLS reads 2.79, but only if the exclusion restriction holds. A small direct path biases 2SLS to 2.62 while the first-stage F stays 2051, uncatchable in-sample.
When a policy reaches only a few units: rolling difference-in-differences (lwdid)
Rolling difference-in-differences (lwdid) gives credible effects from one treated unit and a few controls, and with so few units the transformation choice drives the answer.
Prediction-powered inference corrects AI survey imputation
Treating AI-imputed survey responses as data understated prevalence threefold; a regression adjustment lets predictions sharpen estimates without harm.
A field map for causal-inference methods
A Claude Code skill that builds a navigable citation network around a single method family, surfacing the seminal references, the current authors, the recent…
A reference library for empirical methods
A Claude Code skill that turns a DOI or PDF into a structured papers.md block documenting the estimator, identification strategy, and named assumptions, with…
Understanding the Limits of Parallel Trends Tests
Why a high p-value on a parallel-trends test can mislead, and how Rambachan-Roth sensitivity bounds reveal when a difference-in-differences claim is fragile.