dr_learner: DR-learner

View source: R/dr_learner.R

dr_learnerR Documentation

DR-learner

Description

This function produces out-of-sample predictions of conditional average treatment effects (CATEs) for all individuals in the sample using the DR-learner (Kennedy, 2020). The involved predictions are based on ensemble. See algorithm 1 Knaus (2020) for details.

Usage

dr_learner(
  y,
  w,
  x,
  ml_w = list(create_method("forest_grf")),
  ml_y = list(create_method("forest_grf")),
  ml_tau = list(create_method("forest_grf")),
  compare_all = TRUE,
  nfolds = 5,
  path = NULL,
  quiet = TRUE
)

Arguments

y

Numerical vector containing the outcome variable.

w

Treatment vector. Provide as factor to control ordering of the treatments, otherwise program orders treatments in ascending order or alphabetically.

x

Covariate matrix.

ml_w

List of methods to be used in ensemble estimation of propensity score. Methods can be created by create_method. Default is an untuned honest regression_forest.

ml_y

List of methods to be used in ensemble estimation of outcome regression. Methods can be created by create_method. Default is an untuned honest regression_forest.

ml_tau

List of methods to be used in ensemble estimation of CATEs. Methods can be created by create_method. Default is an untuned honest regression_forest.

compare_all

Relevant multiple treatments: If FALSE, only comparisons to first treatment considered.

nfolds

Number of folds used in cross-validation of ensemble weights (default nfolds=5).

path

Optional path to save the ensemble objects used to predict nuisance parameters and CATEs for later processing. Outputs of each fold i saved in new subfolder DR_foldi.

quiet

If FALSE, ensemble estimators print method that is currently running.

Value

cates

Returns a n x number of comparisons matrix (one column in case of binary treatment) containing the predicted CATEs.

list

A list of the four dr_oos outputs.

cf_mat

Matrix with k columns of indicators representing the different folds used in estimation.

References

  • Kennedy, E. H. (2020). Optimal doubly robust estimation of heterogeneous causal effects. arXiv preprint arXiv:2004.14497. http://arxiv.org/abs/2004.14497

  • Knaus, M. C. (2020). Double machine learning based program evaluation under unconfoundedness. arXiv preprint arXiv:2003.03191.http://arxiv.org/abs/2003.03191


MCKnaus/causalDML documentation built on Aug. 19, 2023, 5:47 p.m.