prune.DStree: Prune a fitted survival tree

Description Usage Arguments Details Value References Examples

View source: R/DStree.prune.R

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

1
2
## S3 method for class 'DStree'
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.

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.

Value

prune returns one DStree object and four vectors of length equal to the number of subtrees:

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
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)

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

Related to prune.DStree in DStree...