Description Usage Arguments Details Value References Examples
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
.
1 2 |
tree |
fitted model of class |
data |
optional data frame that is used to evaluate
the fit of the tree. The
predictors referred to in |
gamma |
optional positive integer value that determines
the user defined information criterion. Setting |
which |
An optional string that determines which performance criteria
should be computed from the subtrees. One of |
... |
further arguments passed to or from other methods. |
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.
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
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.
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.