Description Usage Arguments Details Value Examples
elbow.tree is like final.tree, but instead of using the minimum cost it uses the 'elbow' of the costs. It is similar to the elbow AIC or BIC approaches in the literature.
1 | elbow.tree(nodetree=nodetree, subtrees=subtrees, omega, alphac=2)
|
nodetree |
Fully grown tree from the original data. Output from |
subtrees |
Pruned subtrees from the original data. Output from |
omega |
Bias (i.e. third index of the output) from |
alphac |
Predetermined penalty parameter |
One can take the output (table) generated by this function and plot the (penalized) bias-corrected cost of each subtrees, then (visually) identify the 'elbow' as the selected subtree.
subtree |
output from |
cost.p |
This column contains the (penalized) bias-corrected cost of each subtree |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | ## Not run:
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)
store.mult.cont <- bootstrap(B=20, nodetree, subtrees, alcohol[,'time'],
alcohol[,'event'], x = alcohol[,'alc', drop = FALSE],
D=4,minfail=20, alphac=2)
Balph <- 0.5 * 2 * log(nrow(alcohol))
elbow.tree <- elbow.tree(nodetree, subtrees, store.mult.cont[[3]], alphac= Balph)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.