ple_bart: Patient-level Estimates: BART

Description Usage Arguments Value References Examples

View source: R/ple_bart.R

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

1
2
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.

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
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)
summary(predict(mod1, newdata=X))

StratifiedMedicine documentation built on March 1, 2020, 9:07 a.m.