Learn R Programming

DStree (version 1.0)

prune.DStree: Prune a fitted survival tree

Description

The prune function evaluates and prunes a survival tree that has been fitted by DStree. Different criteria can be used for evaluation (e.g. Brier Score or AIC). The result of the prune function is the optimal subtree (of class DStree) with regard to the chosen criterium, as well as various performance measures that were obtained from the subtrees during analysis. The returned performance measures are the Brier Score, the deviance, and an information criterion defined by gamma.

Usage

"prune"(tree, data, gamma = 2, which, ...)

Arguments

tree
fitted model of class "DStree". This object is assumed to be the result of some function that produces an object with the same named components as that returned by the DStree function.
data
optional data frame that is used to evaluate the fit of the tree. The predictors referred to in formula(tree) as well as the 'status' variable must be present by name in data. If missing, the data frame that was used to grow the tree is used.
gamma
optional positive integer value that determines the user defined information criterion. Setting gamma = 2 corresponds to the AIC criterium.
which
An optional string that determines which performance criteria should be computed from the subtrees. One of "CRIT", "DEV" or "BRIER". If which is missing the "BRIER" score is chosen.
...
further arguments passed to or from other methods.

Value

prune returns one DStree object and four vectors of length equal to the number of subtrees:
  • nsplit number of splits for every subtree
  • CRIT value of the user defined information criterion (underlying formula: CRIT = deviance + gamma * |terminal leaves| * |time periods|).
  • DEV deviance
  • BRIER Integrated Brier Score, see Hothorn et al. (2004)
  • pruned.fit optimal subtree regarding the choosen criterium specified in which

Details

The subtrees are the cost-minimzing subtrees in terms of deviance for given complexity parameters of the fitted tree. See Therneau et al (2013) p.12-13.

References

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

Therneau T. and Atkinson E., An introduction to recursive partitioning using the RPART routines, Technical Report 61, Section of Biostatistics, Mayo Clinic, Rochester.

Examples

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

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

# Determine subtree with minimum AIC
prunedtree <- prune(tree,d.cost,which="CRIT")
prunedtree$prunedfit

# Visualize AIC/Deviance of subtrees
plot(prunedtree$nsplit,prunedtree$CRIT)
plot(prunedtree$nsplit,prunedtree$DEV)

Run the code above in your browser using DataLab