Get estimates of (E(Y|X,A=1), E(Y|X,A=0), E(Y|X,A=1)-E(Y|X,A=0)) using trained BART model(s).
# S3 method for ple_bart
predict(object, newdata = NULL, ...)
Trained BART model(s).
Data-set to make predictions at (Default=NULL, predictions correspond to training data).
Any additional parameters, not currently passed through.
Data-frame with predictions of (E(Y|X,1), E(Y|X,0), E(Y|X,1)-E(Y|X,0))
# NOT RUN {
library(StratifiedMedicine)
## Continuous ##
dat_ctns = generate_subgrp_data(family="gaussian")
Y = dat_ctns$Y
X = dat_ctns$X
A = dat_ctns$A
# }
# NOT RUN {
mod1 = ple_bart(Y, A, X, Xtest=X)
summary(mod1$mu_train)
summary(predict(mod1)) # Training set predictions #
summary(predict(mod1, newdata=X)) # Test set, MCMC needs to re-run #
# }
Run the code above in your browser using DataLab