Doubly-robust ATE estimators — three routes to one answer.
dr3 is a transparent, teaching-oriented implementation of the average treatment effect (ATE) estimators reconciled in Three Routes to One Answer: Reconciling AIPW, TMLE, and Double Machine Learning for Applied Researchers. AIPW, TMLE, and double machine learning all target the same efficient influence function
D(O) = [A/g(X) - (1-A)/(1-g(X))] (Y - Q_A(X)) + (Q_1(X) - Q_0(X)) - psi
and differ only in how they solve it (average the score vs. targeting) and how the nuisances g(X) = P(A=1|X) and Q_a(X) = E[Y|A=a,X] are fit (full-sample, cross-fit, or double cross-fit). dr3 runs the whole family on one shared Super Learner library, so any difference is estimator-driven, not implementation-driven.
Two choices generate the eight-estimator panel:
| full sample | single cross-fit | double cross-fit | |
|---|---|---|---|
| one-step | AIPW | DML | DC-AIPW |
| targeting | TMLE | CV-TMLE | DC-TMLE |
plus the singly-robust baselines (g-computation, IPTW).
Scope
dr3 is for teaching and reproducibility. It is a readable reference engine, cross-checked against the established tmle and AIPW packages — not a replacement for them. It targets the ATE for a binary treatment at a single time point; it is not a general causal-inference framework.
Quick start
library(dr3)
d <- dr_nhefs() # ships in causaldata; nothing to download
fit <- dr_panel(d$Y, d$A, d$X) # one call -> all eight estimators
fit
plot(fit)dr_panel() is a thin wrapper: fit the shared nuisances yourself and hand them to any estimator — pairing dr_aipw() with cross-fit nuisances is DML.
nu <- dr_nuisance(d$Y, d$A, d$X, strategy = "crossfit")
dr_aipw(d$Y, d$A, nu) # DML
dr_tmle(d$Y, d$A, nu) # CV-TMLEDatasets for the tutorials
dr3 bundles no data — each dataset is pulled from another package.
| Loader | Data | Source |
|---|---|---|
dr_nhefs() |
Smoking cessation → weight change (continuous) | causaldata |
dr_rhc() |
Right-heart catheterization → 30-day mortality (binary) | Hmisc::getHdata("rhc") |
Related
- Paper companion (reproduces every manuscript number/figure): https://ehsanx.github.io/dml-alternatives/
- Established packages this one is checked against:
tmle,AIPW,DoubleML,SuperLearner,tmle3/sl3.