Learn R Programming

StratifiedMedicine (version 0.2.3)

ple_causal_forest: Patient-level Estimates: Causal Forest

Description

Uses the causal forest algorithm (grf R package) to obtain patient-level estimates, E(Y|A=1), E(Y|A=0), and E(Y|A=1)-E(Y|A=0). Usable for continuous or binary outcomes.

Usage

ple_causal_forest(Y, A, X, Xtest, tune = FALSE, num.trees = 500,
  family = "gaussian", mod.A = "mean", ...)

Arguments

Y

The outcome variable. Must be numeric or survival (ex; Surv(time,cens) )

A

Treatment variable. (a=1,...A)

X

Covariate space.

Xtest

Test set

tune

If TRUE, use grf automatic hyper-parameter tuning. If FALSE (default), no tuning.

num.trees

Number of trees (default=500)

family

Outcome type ("gaussian", "binomial"), default is "gaussian"

mod.A

Model for estimating P(A|X). Default is "mean" calculates the sample mean. If mod.A="RF", estimate P(A|X) using regression_forest (applicable for non-RCTs).

...

Any additional parameters, not currently passed through.

Value

Trained causal_forest and regression_forest models.

  • mod - trained model(s)

  • pred.fun - Prediction function for trained model(s)

References

Athey S, Tibshirani J, Wagner S. Generalized Random Forests. https://arxiv.org/abs/1610.01271