Skip to contents

T-learner (Kunzel et al. 2019, Eq. 3): fit mu0 on controls and mu1 on treated, tau_T(x) = mu1(x) - mu0(x). S-learner (Eq. 4): one regression with the treatment indicator as a plain feature, tau_S(x) = mu(x, 1) - mu(x, 0), the w coefficient under OLS. X-learner (Eqs. 5-9): impute effects D1 = Y1 - mu0(X1) and D0 = mu1(X0) - Y0, regress each on x, combine tau_X(x) = g(x) tau0(x) + (1 - g(x)) tau1(x) with g the propensity score (their Remark 1), or the constant mean(w) when ps is missing. R-learner (Nie and Wager 2021, Eq. 4): minimise the R-loss by OLS of the outcome residual on the treatment residual times the design (Robinson residualization). On a saturated linear DGP all four reduce to differences of OLS fits and agree exactly.

Usage

Meta1l(y, w, X, ps = NULL)

Arguments

y

Outcome, length n.

w

Binary treatment, 0/1.

X

Covariate matrix, n rows.

ps

Optional propensity scores used as the X-learner weight and the R-learner treatment expectation.

Value

List with estimate (list s, t, x, r of mean CATEs), cate_s, cate_t, cate_x, cate_r, coef_r, n, n_treat, method.

References

Kunzel, S. R., Sekhon, J. S., Bickel, P. J. and Yu, B. (2019), Metalearners for estimating heterogeneous treatment effects using machine learning, PNAS 116(10), 4156-4165, doi:10.1073/pnas.1804597116, Eqs. 3-9 and Remark 1. Nie, X. and Wager, S. (2021), Quasi-oracle estimation of heterogeneous treatment effects, Biometrika 108(2), 299-319, doi:10.1093/biomet/asaa076, Eq. 4. Curth, A. and van der Schaar, M. (2021), Nonparametric estimation of heterogeneous treatment effects: From theory to learning algorithms, AISTATS 130, arXiv:2101.10943.

Examples

set.seed(8)
n <- 300
X <- matrix(rnorm(n * 2), n, 2)
w <- rbinom(n, 1, 0.5)
y <- X[, 1] + w * (1 + X[, 2]) + rnorm(n)
Meta1l(y, w, X)$estimate
#> $s
#> [1] 0.7369283
#> 
#> $t
#> [1] 0.7238108
#> 
#> $x
#> [1] 0.7238108
#> 
#> $r
#> [1] 0.7170609
#>