Predict subgroups and obtain subgroup-specific estimates, E(Y|X) or PLE(X), for a trained ctree model (depends on if outcome_PLE argument)
# S3 method for submod_ctree
predict(object, newdata = NULL, ...)
Trained ctree model.
Data-set to make predictions at (Default=NULL, predictions correspond to training data).
Any additional parameters, not currently passed through.
Identified subgroups with subgroup-specific predictions of E(Y|X) or PLE(X).
Subgrps - Identified subgroups
pred - Predictions, E(Y|X) or PLE(X) by subgroup.
# NOT RUN {
library(StratifiedMedicine)
## Continuous ##
dat_ctns = generate_subgrp_data(family="gaussian")
Y = dat_ctns$Y
X = dat_ctns$X
A = dat_ctns$A
res_ctree1 = submod_ctree(Y, A, X, Xtest=X)
# Predict subgroups / estimates #
out = predict(res_ctree1, newdata=X)
# }
Run the code above in your browser using DataLab