predict.DStree: Predictions from a fitted DStree Object

Description Usage Arguments Value References Examples

View source: R/DStree.predict.R

Description

Returns the predicted median survival time, hazard and survival probabilities from a fitted DStree object.

Usage

1
2
## S3 method for class 'DStree'
predict(object, data, ...)

Arguments

object

a fitted object of class "DStree"

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 data. If missing, the fitted values are returned.

...

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.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
data(cost)
# Convert observed days to years
d.cost<-dis.cost(cost)

# Train Data
Train<-d.cost[1:300,]
# Test Data
Test<-d.cost[301:518,]

fit <- DStree(time~prevStroke+age+sex+alcohol+smoke,status="status",data=d.cost)

#Predictions from Test Data
predict(fit,Test)

DStree documentation built on May 2, 2019, 3:37 p.m.