Estimates the average treatment effect in the partially linear model \(Y = \theta T + g(X) + \varepsilon\) using the residual-on-residual (orthogonalised) estimator of Chernozhukov et al. (2018). Two nuisance functions are estimated with machine learning and cross-fitting: the conditional outcome mean \(m(x) = E[Y | X = x]\) and the propensity score \(e(x) = P(T = 1 | X = x)\). The ATE is then $$\hat\theta = \frac{\sum_i (T_i - \hat e(X_i))(Y_i - \hat m(X_i))} {\sum_i (T_i - \hat e(X_i))^2}$$

ate_dml(
  data,
  outcome = "y",
  treatment = "t",
  outcome_learner,
  ps_learner,
  covariates = NULL,
  folds = 5,
  ps_trim = NULL
)

Arguments

data

A data.frame with the outcome, treatment and covariates.

outcome

Name of the outcome column. Default "y".

treatment

Name of the binary (0/1) treatment column. Default "t".

outcome_learner

An mlr3 regression learner for the conditional outcome mean m(x) = E[Y | X] (treatment excluded from the features).

ps_learner

An mlr3 classification learner used as the propensity score model, e.g. mlr3::lrn("classif.log_reg"). Its predict type is set to "prob" automatically.

covariates

Optional character vector of covariate columns. Defaults to all columns except the outcome and the treatment.

folds

Number of cross-fitting folds. Default 5. Cross-fitting is a core ingredient of DML; folds = 1 (in-sample nuisance estimates) is allowed but not recommended with flexible learners.

ps_trim

Optional trimming for the estimated propensity scores. Either a single value a (clips to [a, 1 - a]) or a length-2 range. NULL (default) applies no trimming.

Value

An object of class "causalmlr_ate"; see ate_naive().

Details

Note that unlike ate_dr(), the outcome model here regresses Y on the covariates only (the treatment is excluded), and the model assumes a constant (homogeneous) treatment effect.

References

Chernozhukov, V., Chetverikov, D., Demirer, M., Duflo, E., Hansen, C., Newey, W., & Robins, J. (2018). Double/debiased machine learning for treatment and structural parameters. The Econometrics Journal, 21(1), C1-C68.

See also

Examples

# \donttest{
library(mlr3)
data(sodium)
set.seed(1)
ate_dml(sodium, outcome = "bp", treatment = "sodium",
        outcome_learner = lrn("regr.rpart"),
        ps_learner = lrn("classif.rpart"),
        ps_trim = 0.01)
#> ATE estimate - Double machine learning 
#>   Estimate:  1.121
#>   Std. error: 0.04287 
#>   95% CI:    [1.037, 1.205]
#>   N:         10000
# }