Learn R Programming

DStree (version 1.0)

DStree: Fit a discrete-time survival tree

Description

This function builds decision trees for discrete, right-censored survival data. The fitted tree estimates the hazard and survival probabilities for every terminal node, as well as the median survival time.

Usage

DStree(formula, status, data, control = control, weights = NULL)

Arguments

formula
a formula with response but no interaction terms. The response variable represents the observed survival times.
status
integer/string representing the column number/name of the 'status' variable in the data frame. 'status' must be a binary integer variable indicating whether the event occured (=1) or whether the event was censored/did not occur (=0).
data
data frame that contains all variables stated in the formula argument, as well as the 'status' variable.
control
a list of options that control the specification of the DStree algorithm. See DStree.control.
weights
a vector of optional case weights.

Value

An object of class DStree. For details see DStree.object.

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

Run this code
##Build tree
fit<- DStree(spell~ui+age+tenure+logwage,status="censor1",data=UnempDur,control=list(cp=0))
plot(fit)

Run the code above in your browser using DataLab