ndr_learner: DR- and NDR-learner.

View source: R/ndr_learner.R

ndr_learnerR Documentation

DR- and NDR-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) and the normalized DR-learner (Knaus, 2020). The involved predictions are based on ensemble. See algorithms 1 and 2 in Knaus (2020) for details.

Usage

ndr_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 NDR_foldi.

quiet

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

Value

cates

Returns n x 2 matrix containing DR- and NDR-learner predictions in case of a binary treatment or a number of comparisons x n x 2 array in case of multiple treatments.

list

A list of the four ndr_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.