Last data update: 2014.03.03

R: Fit a discrete-time survival tree
DStreeR Documentation

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

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

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(DStree)
Loading required package: rpart
Loading required package: pec
Loading required package: prodlim
Loading required package: Ecdat
Loading required package: Ecfun

Attaching package: 'Ecfun'

The following object is masked from 'package:base':

    sign


Attaching package: 'Ecdat'

The following object is masked from 'package:datasets':

    Orange

> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/DStree/DStree.Rd_%03d_medium.png", width=480, height=480)
> ### Name: DStree
> ### Title: Fit a discrete-time survival tree
> ### Aliases: DStree
> 
> ### ** Examples
> 
> ##Build tree
> fit<- DStree(spell~ui+age+tenure+logwage,status="censor1",data=UnempDur,control=list(cp=0))
> plot(fit)
Warning message:
labs do not fit even at cex 0.15, there may be some overplotting 
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>