s_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 S-Learner strategy.

Usage

1
s_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 to the base learner.

Details

Implements the S-learner algorithm described in Künzel et al. (2019) for estimating conditional average treatment effects (CATE). In the S-learner algorithm, the treatment W is included as a feature similar to all of the other covariates without the indicator being given any special role. The combined response function

μ(x, w) = E ≤ft[ Y^{obs} | X = x, W = w \right]

can then be estimated using any base learner (supervised machine learning or regression algorithm) on the entire dataset. Here we implement the S-learner with the option forA linear regression or a regression forest (see Athey, Tibshirani, and Wager (2016)) as the base learner.

The CATE estimator is then given by

\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

t_learner, x_learner

Examples

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

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