Combines an outcome model \(\mu(x, t) = E[Y | X = x, T = t]\) with a propensity score model \(e(x) = P(T = 1 | X = x)\) in the augmented inverse propensity weighting (AIPW) estimator: $$\widehat{ATE} = \frac{1}{n} \sum_i \left[ \hat\mu_1(X_i) - \hat\mu_0(X_i) + \frac{T_i (Y_i - \hat\mu_1(X_i))}{\hat e(X_i)} - \frac{(1 - T_i)(Y_i - \hat\mu_0(X_i))}{1 - \hat e(X_i)} \right]$$ The estimator is consistent if either the outcome model or the propensity model is correctly specified (hence "doubly robust"). With folds > 1 both nuisance models are cross-fitted, which yields the cross-fitted AIPW estimator (also known as DML for the interactive/fully heterogeneous model).

ate_dr(
  data,
  outcome = "y",
  treatment = "t",
  outcome_learner,
  ps_learner,
  covariates = NULL,
  folds = 1,
  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 outcome model, e.g. mlr3::lrn("regr.ranger"). The treatment indicator is included as a feature and potential outcomes are predicted by setting it to 0 and 1.

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 for the propensity model. 1 (the default) fits and predicts in-sample; values greater than 1 use out-of-fold predictions, which reduces overfitting bias when using 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().

References

Robins, J. M., Rotnitzky, A., & Zhao, L. P. (1994). Estimation of regression coefficients when some regressors are not always observed. Journal of the American Statistical Association, 89(427), 846-866.

See also

Examples

# \donttest{
library(mlr3)
data(sodium)
ate_dr(sodium, outcome = "bp", treatment = "sodium",
       outcome_learner = lrn("regr.rpart"),
       ps_learner = lrn("classif.rpart"),
       folds = 5, ps_trim = 0.01)
#> ATE estimate - Doubly robust (AIPW) 
#>   Estimate:  1.147
#>   Std. error: 0.04321 
#>   95% CI:    [1.062, 1.232]
#>   N:         10000
# }