Subtree disappears from the plot shown in the second

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

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, mark.time=F, lty=1:4 titlexlab='Time to Progression',ylab='Prob Progression' legend.2,.2, legend=paste'node',c4,5,6,7, lty=1:4 45 grade<2.5 | g2<13.2 No ploidy:ab g2>17.91 g2>11.845 Prog g2<11.005 No No 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 | No (92/54) g2<13.2 Prog (40/45) No (52/9) g2>17.91 Prog (17/28) ploidy:ab No (23/17) g2>11.845 No (20/11) Prog (3/6) Prog (3/20) g2<11.005 No (14/10) No (6/1) No (12/5) Figure 15: No (14/8) Prog (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. plotfit, branch=0 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.

Ask a homework question - tutors are online