prune {TimeVTree}R Documentation

Function to Prune Using the Score Statistic

Description

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

Usage

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

##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)

[Package TimeVTree version 0.3.1 Index]