Heterogeneous treatment effects with a causal forest (GRF recipe)
The full GRF HTE playbook: cross-fit nuisances → causal forest → calibration → AIPW ATE → BLP → RATE → policy.
The full GRF HTE playbook: cross-fit nuisances → causal forest → calibration → AIPW ATE → BLP → RATE → policy.
Staggered-adoption DiD done right: group-time ATT(g,t) → event-study / group / calendar aggregations, with honest pre-trends.
Effect of 401(k) eligibility on net assets via PLR / IRM / IIVM with cross-fit ML nuisances — four learners, one honest comparison.
Make your assumptions explicit: draw a causal graph, identify the estimand by the backdoor criterion, estimate it, then actively try to refute it with placebo and confounding tests.
Build a synthetic version of the treated unit from a convex blend of donors, read the treated-minus-synthetic gap, and test it against placebos run on every donor.
Use genetic variants as instruments to estimate the causal effect of an exposure on an outcome from GWAS summary data — with IVW plus pleiotropy-robust MR-Egger and weighted-median checks.
A minimal first-contact recipe: regression forest, quantile forest, and a causal forest on the same data.
Causal forest → train/eval split → RATE with both AUTOC and Qini → TOC plot.
Double machine learning with a forest final stage: partial out nuisance with flexible learners, then read the conditional effect τ(x) — with valid confidence intervals.
Stop betting everything on a pre-trends test. Allow the post-treatment trend to deviate within a transparent class, and report the confidence set — and the breakdown value where the effect would vanish.
Preprocesses observational data by matching treated and control units on covariates, so downstream models depend less on modeling assumptions.
Fit a model on each side of the cutoff, put a posterior on the jump, and report a credible interval for the discontinuity — plus an honest look at how it moves with the bandwidth.
Fast fixed-effects event study that survives staggered timing — sunab() vs naive TWFE, plotted against the truth.
Lin's covariate-adjusted estimator and Neyman/HC2 robust standard errors for randomized experiments — one fast function, design-based inference.
Randomize treatment (complete, blocked, cluster) and estimate average effects with design-based variance — including cluster-randomized trials.
Before any estimation: encode your assumptions as a causal graph, enumerate the backdoor paths from treatment to outcome, and let the graph hand you the minimal set of covariates to adjust for.
Regression for randomized-response surveys — recover predictors of a sensitive behavior while every respondent's individual answer stays private.
Gardner's 2-stage estimator for staggered DiD: residualize on the untreated, then estimate the event study — fast and timing-robust.
Estimate who responds, not just the average: fit a family of meta-learners for the CATE, pick the best by validation error, then rank and target with an uplift curve.
The standard manipulation test for RD designs — checks whether the running variable's density jumps at the cutoff (a sign units sorted around it).
Censoring check → causal survival forest → RMST-scale AIPW ATE → calibration → report.
Decomposes a treatment effect into the part transmitted through a mediator (ACME) and the rest (direct effect), with sensitivity analysis.
Find which subgroups respond to a treatment and estimate causal interactions in factorial / conjoint experiments via a LASSO-regularized search.
Bayesian mixture modeling for principal stratification: causal effects within latent strata (e.g. compliers) under post-treatment confounding.
Turn any fitted model into interpretable quantities of interest — average marginal effects, predictions, contrasts — with simulation-based confidence intervals.
Propensity-score balancing weights for time-to-event outcomes: counterfactual survival curves, survival differences, and marginal hazard ratios.
Flags when a counterfactual question is a safe interpolation versus a model-dependent extrapolation far from your data.
A full design-and-analysis platform for causal effects via balancing weights (overlap, IPW, ATT, matching, entropy) for binary and multiple treatments.
Compare survival between treatment groups after removing confounding — via IPTW, the g-formula or AIPW — instead of a raw Kaplan-Meier that quietly bakes in selection.
Build a weighted 'synthetic' control from untreated units to estimate the effect of a single treated case over time.
Estimate causal effects at a cutoff with data-driven optimal bandwidths and bias-corrected, robust confidence intervals.
Reproducible random assignment — simple, complete, block, cluster, stratified — with the exact assignment probabilities design-based inference needs.
Don't just assume no unobserved confounding — quantify it: robustness value + contour plots benchmarked against your real covariates.
Trace the whole tradeoff curve between covariate balance and how many units you keep, then estimate the effect at every point on the frontier.
"Who Are You?" predicts an individual's probable race/ethnicity from surname, first/middle name, and geolocation using Bayesian (BISG) updating.
Reports how strong an unmeasured confounder would have to be, on the risk-ratio scale, to fully explain away an observed association.
Fills in missing values via fast bootstrap-EM multiple imputation, producing several complete datasets you analyze and combine.
A two-way fixed-effects DiD is a weighted average of all possible 2×2 comparisons — including 'forbidden' ones that use already-treated units as controls. This shows you the weights.
Match treated and control units on covariates, then bias-correct and get the correct large-sample standard errors.
Reweight controls to exactly match the treated group's covariate moments, achieving balance without iterative propensity-score tweaking.
Two-stage least squares for instrumental-variables regression, with the modern LATE interpretation and rich diagnostics.
Temporarily coarsens each covariate into bins, exact-matches treated and controls within bins, then estimates effects on the matched data.
Did the forest actually capture treatment-effect heterogeneity? Calibration → variable importance → BLP → omnibus tests.
Specify a study as model–inquiry–data–answer, simulate it, and read its diagnosands — bias, power, coverage — before you run it.
Multivariate regression for list (item-count) experiments, recovering the prevalence and predictors of a sensitive attitude without asking about it directly.
Slice the average effect: Group Average Treatment Effects and a CATE surface from a debiased IRM, with simultaneous confidence bands.
Matches treated unit-periods to controls with identical recent treatment histories, then applies a difference-in-differences estimator for TSCS data.
Exact Fisher randomization tests and sharp-null confidence intervals for any randomization scheme — the packaged version of the design-based test.
Generalized random forests that estimate conditional average treatment effects τ(x) non-parametrically, with valid confidence intervals.
Infers individual-level behavior from aggregate (district-level) data, the classic example being voting rates by race from precinct totals.
The companion R package for Imai's textbook Quantitative Social Science, bundling every dataset and chapter vignette for hands-on data-analysis teaching.
A Python toolkit for heterogeneous treatment effects from observational data — double ML, doubly-robust, orthogonal forests, meta-learners.
Beyond the average: how 401(k) eligibility shifts net financial assets across the whole wealth distribution, estimated orthogonally.
Identify the effect at a cutoff: a local-polynomial RD with an MSE-optimal bandwidth and robust, bias-corrected confidence intervals.
K-fold cross-fitted CATEs → RATE on out-of-fold priorities → honest verdict on heterogeneity strength.
Causal forest → doubly-robust scores → policytree → evaluate policy value → plot the tree.
Before you trust an observational estimate, prove balance: SMDs, overlap, and a Love plot before vs after adjustment.
When the conditional mean is smooth: regression forest baseline → ll_regression_forest → tuning → diagnostics.
Reweight both control units and pre-periods to build a synthetic control, then apply a DiD correction — robust where plain SC or TWFE struggle.
Turn debiased CATEs into a rule: fit a shallow, readable decision tree that maximises the doubly-robust policy value.
Train a causal forest on the source sample → reweight AIPW to a target population → report transported ATE.
Split a total effect into what flows through a mediator (indirect) and what doesn't (direct) — with a sensitivity analysis for mediator–outcome confounding.
For a multi-valued or continuous treatment: estimate E[Y(d)] at each dose and the contrasts between them, all cross-fitted.
When treatment is endogenous, an instrument identifies the complier (LATE) effect via two-stage least squares — after you check the instrument is strong.
From CATEs to a budgeted treatment policy: causal forest → DR scores → cost matrix → maq Qini curve → pick the budget.
My side-by-side for staggered adoption: Callaway–Sant'Anna vs Gardner's two-stage vs Sun–Abraham — do the event studies agree?
When the tails matter: estimate potential quantiles and the conditional value-at-risk of a treatment with Neyman-orthogonal scores.
My checklist for an observational effect: match, prove balance with cobalt, estimate on the matched sample, then quantify hidden-confounding risk with sensemakr.