Learn R Programming

StratifiedMedicine (version 0.2.3)

ple_bart: Patient-level Estimates: BART

Description

Uses the BART algorithm (Chipman et al 2010; BART R package) to obtain patient-level estimates. Used for continuous or binary outcomes. Covariate by treatment interactions are automatically included in BART model (as in Hahn et al 2017).

Usage

ple_bart(Y, A, X, Xtest, family = "gaussian", sparse = FALSE, K = 10,
  ...)

Arguments

Y

The outcome variable. Must be numeric.

A

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

X

Covariate space.

Xtest

Test set

family

Outcome type ("gaussian", "binomial"), default is "gaussian" which uses wbart (BART for continuous outcomes). Probit-based BART ("pbart") is used for family="binomial"

sparse

Whether to perform variable selection based on sparse Dirichlet prior instead of uniform. See "gbart" in the BART R package for more details as well as Linero 2016. Default is FALSE.

K

For survival, coarse times per the quantiles 1/K,..,K/K. For AFT (abart), K=10. For more accurate survival predictions, set K=100 (default in abart).

...

Any additional parameters, not currently passed through.

Value

Trained BART model(s) and patient-level estimates (E(Y|X,1), E(Y|X,0), E(Y|X,1)-E(Y|X,0)) for train/test sets.

  • mod - trained model(s)

  • mu_train - Patient-level estimates (training set)

  • mu_test - Patient-level estimates (test set)

References

Chipman, H., George, E., and McCulloch R. (2010) Bayesian Additive Regression Trees. The Annals of Applied Statistics, 4,1, 266-298 <doi: 10.1214/09-AOAS285>.

Examples

Run this code
# NOT RUN {
library(StratifiedMedicine)

## Continuous ##
dat_ctns = generate_subgrp_data(family="gaussian")
Y = dat_ctns$Y
X = dat_ctns$X
A = dat_ctns$A
train = data.frame(Y, A, X)

# BART #
require(BART)
mod1 = ple_bart(Y, A, X, Xtest=X)
summary(mod1$mu_train)
# }
# NOT RUN {

# }

Run the code above in your browser using DataLab