Description Usage Arguments Examples
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.
1 2 |
x |
a fitted object of class |
prob |
a string that indicates which probability should be
plotted. |
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 |
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"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.