prune: Function to Prune Using the Score Statistic

Description Usage Arguments Details Value References Examples

View source: R/prune.R

Description

This function merges over-segmented intervals to create optimally pruned subtrees.

Usage

1
prune(fulltree)

Arguments

fulltree

output from output.coxphout

Details

prune uses the CART algorithm and -log (partial likelihood) as cost to find the optimally pruned subtrees.

Value

prune returns a matrix with the following columns, where each row is an optimally pruned subtree:

K

subtrees number 1, 2, etc. Tree #1 is the full tree

N[1]

Number of terminal nodes

alpha

penalty parameter corresponding to the subtree

S[1]

-log(partial likelihood) of the subtree

pruneoff

Node that was removed from the previous larger subtree to obtain the current subtree

References

Xu, R. and Adak, S. (2002), Survival Analysis with Time-Varying Regression Effects Using a Tree-Based Approach. Biometrics, 58: 305-315.

Examples

1
2
3
4
5
6
7
8
9
##Call in alcohol data set
data('alcohol')
require(survival)

coxtree <- coxph.tree(alcohol[,'time'], alcohol[,'event'], 
                      x = alcohol[,'alc', drop = FALSE], D = 4)
nodetree <- output.coxphout(coxtree)

subtrees <- prune(nodetree)

TimeVTree documentation built on May 2, 2019, 2:17 a.m.

Related to prune in TimeVTree...