plot.DStree: Plot a DStree Object

Description Usage Arguments Examples

View source: R/DStree.plot.R

Description

This function plots a DStree object on the current graphic device. It visualizes the fitted tree as well as the estimated survival/hazard probabilites for every terminal node.

Usage

1
2
## S3 method for class 'DStree'
plot(x, prob = "surv", select = NULL, ...)

Arguments

x

a fitted object of class "DStree"

prob

a string that indicates which probability should be plotted. "surv" draws survival probabilities, "haz" draws hazard probabilities.

select

a vector of strings that indicate terminal leaves for which the survival/hazard probabilities should be drawn. If not specified probabilities for every terminal leaf are drawn.

...

extra prp arguments to modify the appearance of the tree (from R package rpart.plot)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
data(cost)
# Discretize observed days to years
d.cost<-dis.cost(cost)

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

#Plot tree and survival probabilities
plot(fit)
#survival probabilities are in the first plot

#Plot tree and hazard probabilities for terminal leaves 4 and 15
plot(fit,prob="haz",select=c("2","7"))

DStree documentation built on May 2, 2019, 3:37 p.m.

Related to plot.DStree in DStree...