Learn R Programming

StratifiedMedicine (version 0.1.3)

predict.submod_weibull: Predict submod: Model-based partitioning (Weibull)

Description

Predict subgroups and obtain subgroup-specific point-estimates (in pprogress).

Usage

# S3 method for submod_weibull
predict(object, newdata = NULL, ...)

Arguments

object

Trained MOB (Weibull) model.

newdata

Data-set to make predictions at (Default=NULL, predictions correspond to training data).

...

Any additional parameters, not currently passed through.

Value

Identified subgroups with subgroup-specific predictions.

  • Subgrps - Identified subgroups

  • pred - Predictions, based on weibull regression fit, estimate hazard ratio by subgroup.

Examples

Run this code
# NOT RUN {
# }
# NOT RUN {
library(StratifiedMedicine)
# Survival Data #
require(TH.data); require(coin)
data("GBSG2", package = "TH.data")
surv.dat = GBSG2
# Design Matrices #
Y = with(surv.dat, Surv(time, cens))
X = surv.dat[,!(colnames(surv.dat) %in% c("time", "cens")) ]
A = rbinom( n = dim(X)[1], size=1, prob=0.5  ) ## simulate null treatment

res_weibull = submod_weibull(Y, A, X, Xtest=X, family="survival")
out = predict(res_weibull)
plot(res_weibull$mod)
# }
# NOT RUN {

# }

Run the code above in your browser using DataLab