snip: Cost-complexity Pruning of a DStree Object

Description Usage Arguments Value Examples

View source: R/DStree.snip.R

Description

Determines a nested sequence of subtrees of the supplied DStree object by recursively snipping off the least important splits, based on the complexity parameter (cp).

Usage

1
snip(tree, cp)

Arguments

tree

a fitted object of class "DStree"

cp

complexity parameter to which the DStree object will be trimmed

Value

A new DStree object that is trimmed to the value cp.

Examples

1
2
3
4
5
6
7
data(cost)
d.cost <- dis.cost(cost)

fit <- DStree(time~prevStroke+age+sex+alcohol+smoke,status="status",data=d.cost)

sfit<-snip(fit,cp=0.02)
plot(sfit) #plot smaller DStree object

DStree documentation built on May 30, 2017, 7:19 a.m.

Search within the DStree package
Search all R packages, documentation and source code