Unformatted text preview: umor
progression is greatest in node 7, which has patients who are younger and have a
higher initial tumor grade.
Error dev = 103.9783 plotfit2
textfit2,use.n=T For a nal summary of the model, it can be helpful to plot the probability of
survival based on the nal bins in which the subjects landed. To create new variables
based on the rpart groupings, use where. The nodes of fit2 above are shown in the
right hand panel of gure 12: node 4 has 1 event, 33 subjects, grade = 1-2 and g2
11.36; node 5 has 8 events, 28 subjects, grade = 1-2 and g2 11.36; node 6 has
37 events, 75 subjects, grade = 3-4, age 56.5; node 7 has 8 events, 10 subjects,
grade = 3-4, age 56.5. Patients who are younger and have a higher initial grade
tend to have more rapid progression of disease.
newgrp - fit2$where
plotsurvfitSurvpgtime,pgstat ~ newgrp, data=stagec,
titlexlab='Time to Progression',ylab='Prob Progression'
legend.2,.2, legend=paste'node',c4,5,6,7, lty=1:4 45 grade<2.5
No ploidy:ab g2>17.91 g2>11.845
No Figure 14: Prog Prog plotfit; textfit 9 Plotting options
This section examines the various options that are available when plotting an rpart
object. For simplicity, the same model data from Example 1 will be used throughout.
The simpliest labelled plot gure 14 is called by using plot and text without
changing any of the defaults. This is useful for a rst look, but sometimes you'll
want more information about each of the nodes.
fit - rpartprogstat
age + eet + g2 + grade + gleason + ploidy,
stagec, control=rpart.controlcp=.025 plotfit
textfit The next plot gure 15 has uniform stem lengths uniform=T, has extra information use.n=T specifying number of subjects at each node here it lists how
many are diseased and how many are not diseased, and has labels on all the nodes,
not just the terminal nodes all=T.
plotfit, uniform=T 46 grade<2.5
(12/5) Figure 15: No
(2/5) plotfit, uniform=T; textfit,use.n=T,all=T textfit, use.n=T, all=T Fancier plots can be created by modifying the branch option, which controls the
shape of branches that connect a node to its children. The default for the plots
is to have square shouldered trees branch = 1.0. This can be taken to the other
extreme with no shoulders at all branch=0 as shown in gure 16.
textfit, use.n=T These options can be combined with others to create the plot that ts your
particular needs. The default plot may be ine cient in it's use of space: the terminal
nodes will always lie at x-coordinates of 1,2,: : : . The compress option attempts to
improve this by overlapping some nodes. It has little e ect on gure 17, but in
gure 4 it allows the lowest branch to tuck under" those above. If you...
View Full Document
This document was uploaded on 09/26/2013.
- Fall '13