Learn R Programming

DStree (version 1.0)

predict.DStreebag: Prediction from bagged Discrete-Time Survival Trees

Description

Predict the median survival time, hazard and survival probabilities from a DStreebag object.

Usage

"predict"(object, data, ...)

Arguments

object
a fitted object of class DStreebag
data
data frame containing the values at which predictions are required. The predictors referred to in the right side of formula(object) as well as the 'status' variable must be present by name in newdata.
...
further arguments passed to or from other methods.

Value

A named list with the following elements: The vector MedSurv contains the predicted median survival times of the observations in data. The matrices Surv and Haz contain the predicted probabilities and hazard rates, respectively, where each row refers to an individual and each column refers to an observed time point (1,2,...).

References

Bou-Hamad I., Larocque D.,Ben-Ameur H., Masse L. C., Vitaro F. and Tremblay R. E. (2009), Discrete-Time Survival Trees. Canadian Journal of Statistics 37 (1), 17-32.

Hothorn T., Lausen B., Benner A. and Radespiel-Troeger M. (2004), Bagging Survival Trees. Statistics in Medicine 23 (1), 77-91.

Examples

Run this code
data(cost)
## Discretize observed days to years
d.cost<-dis.cost(cost)

# Bagging Tree
bag <- bag(time~prevStroke+age+sex+alcohol+smoke,status="status",data=d.cost[1:330,],nBoot=10)
pred <- predict(bag,newdata=d.cost[331:518,])
pred$MedSurv

Run the code above in your browser using DataLab