t_learner: Estimate heterogeneous treatment effects (HTEs) using the...

Description Usage Arguments Details Value References See Also Examples

View source: R/hte.R

Description

Estimate heterogeneous treatment effects (HTEs) using the T-Learner strategy.

Usage

1
t_learner(data, x, y, w, base_learner = "regression forest", plot = TRUE, ...)

Arguments

data

a dataframe object containing the variables and values.

x

a list of character vectors specifying variables to be included in the model (columns in the data). If unspecified, then it is assumed to be all columns in the data besides y and w.

y

a character vector specifying the response variable.

w

a character vector specifying the treatment status.

base_learner

a character vector specifying the base learner. One of "regression forest" or "OLS". Default is "regression forest".

plot

logical; if TRUE, then plots a histogram of treatment effects.

...

additional arguments passed to the base learner.

Details

Implements the T-learner algorithm described in Künzel et al. (2019) for estimating conditional average treatment effects (CATE). In the T-learner algorithm, the control response function is estimated using all units in the control group as

μ_0 = E [ Y(0) | X = x],

and the treatment response function is estimates using all units in the treatment group as

μ_1 = E [ Y(1) | X = x].

Both μ_0 and μ_1 are estimated using any base learner (supervised machine learning or regression algorithm). Here we implement the T-learner with the option for linear regression or regression forest (see Athey, Tibshirani, and Wager (2016)) as the base learner.

The CATE is then estimated in the second stage as

\hat{τ}(x) = \hat{μ}(x, 1) - \hat{μ}(x, 0).

Value

a list of two. The first element is a vector of conditional average treatment effect for each observation. The second element is the estimated average treatment effect.

References

Künzel, Sören R., Jasjeet S. Sekhon, Peter J. Bickel, and Bin Yu. 2019. “Metalearners for estimating heterogeneous treatment effects using machine learning." Proceedings of the National Academy of Sciences of the United States of America. Mar. 116(10): 4156–4165. https://doi.org/10.1073/pnas.1804597116

Athey, Susan, Julie Tibshirani, and Stefan Wager. 2016. “Generalized Random Forests." Working paper; Forthcoming in the Annals of Statistics. https://arxiv.org/abs/1610.01271

See Also

s_learner, x_learner

Examples

1
2
data("lalonde")
hte <- t_learner(data = lalonde, y = "re78", w = "treat", num.trees = 100, mtry = 3)

jackcollison/causality documentation built on Dec. 20, 2021, 8:05 p.m.