@misc{doubleml,
title = {DoubleML},
author = {Bach and Chernozhukov and Kurz and Spindler},
howpublished = {\url{https://docs.doubleml.org/}},
note = {Software / documentation}
}Slice the average effect: Group Average Treatment Effects and a CATE surface from a debiased IRM, with simultaneous confidence bands.
Input · what goes in
Outcome Y, binary treatment D, covariates X — plus the grouping variable(s) you want effects for.
Show data format & exampleHide example
Format — one row per unit: y, d ∈ {0,1}, covariates X.
y d age inc educ
1.2 1 41 38k 13
-0.3 0 53 21k 11
Pipeline · the recipe ⑂ has parallel branches
↑ Click any step in the diagram to read its logic, code, assumptions & discussion.
Build DoubleMLData (y, d, X)
Data preparation — shapes the raw inputs into what the estimator expects.
Declare outcome, binary treatment and covariates.
dml_data = dml.DoubleMLData(df, y_col='y', d_cols='d', x_cols=X)
- No comments on this step yet — be the first.
Log in to comment on this step.
Fit an Interactive Regression Model (IRM)
The core estimate — where the causal quantity itself is computed.
Cross-fitted, Neyman-orthogonal IRM with ML nuisances — the per-unit signal for heterogeneity.
dml_irm = dml.DoubleMLIRM(dml_data, ml_g, ml_m).fit()
- No comments on this step yet — be the first.
Log in to comment on this step.
Group Average Treatment Effects
Heterogeneity — who is affected, and by how much, not just on average.
Average the orthogonal signal within each group to get a GATE per subgroup.
gate = dml_irm.gate(groups=groups); gate.confint(joint=True)
- No comments on this step yet — be the first.
Log in to comment on this step.
CATE via a basis expansion
Heterogeneity — who is affected, and by how much, not just on average.
Project the signal onto a spline basis to trace a smooth CATE in a covariate.
cate = dml_irm.cate(basis); cate.confint(X_grid, joint=True)
- No comments on this step yet — be the first.
Log in to comment on this step.
Plot with simultaneous bands
Reporting — turn the numbers into a figure or table a reader can act on.
Show GATE bars and the CATE curve with joint (not pointwise) confidence bands.
# matplotlib: GATE bars + CATE curve with joint CIs
- No comments on this step yet — be the first.
Log in to comment on this step.
Output · what you get 3 figures
Figures reproduced from DoubleML — Bach, Chernozhukov, Kurz & Spindler — unofficial community showcase; all credit to the original authors.
⚠️ Unofficial community showcase of a DoubleML example. Not affiliated with the authors; figures are from the public documentation. All credit to Bach, Chernozhukov, Kurz & Spindler.
Slice the average effect: Group Average Treatment Effects and a CATE surface from a debiased IRM, with simultaneous confidence bands.
Discussion (0)
Log in to join the discussion.