[R] Plotting question re. cuminc

Uwe Ligges ligges at statistik.tu-dortmund.de
Sat May 16 16:38:28 CEST 2009



K F Pearce wrote:
> Hello everyone,
> 
> (This is my second question posted today on the R list).

and you have still not read the posting guide?

It asks you to "provide commented, minimal, self-contained, reproducible 
code" which also means that you need to tell which packages you are using.

I get, e.g.:

 > cuminc(ftime,fstatus,group)
Error: could not find function "cuminc"
 > ftime
Error: object 'ftime' not found
 > fstatus
Error: object 'fstatus' not found
 > group
Error: object 'group' not found

Best,
Uwe Ligges



> I am carrying out a competing risks analysis using the cuminc function...this takes the form:
> 
> cuminc(ftime,fstatus,group)
> 
> In my study, fstatus has 3 different causes of failure (1,2,3) there are also censored cases (0).  "group" has two levels (0 and 1).
> 
> I therefore have 6 different cumulative incidence curves:
> 
> cause 1, group=0; cause 1 group=1
> cause 2, group=0; cause 2 group=1
> cause 3, group=0; cause 3 group=1
> 
> If I type the following commands:
> 
>> xx<-cuminc(ftime,fstatus,group)
>> plot(xx,lty=1,color=1:6)
> 
> I end up with the 6 curves plotted on the same graph.
> 
> Is there a way that I can plot a selection of these curves? (say only curves for cause 1, group=0 and cause 1 group=1).
> 
> Thank you so much,
> Kind Regards,
> Kim
> 
> 
> Dr Kim Pearce CStat
> Industrial Statistics Research Unit (ISRU)
> School of Mathematics and Statistics
> Herschel Building
> University of Newcastle
> Newcastle upon Tyne
> United Kingdom
> NE1 7RU
> 
> Tel.   0044 (0)191 222 6244 (direct)
> Fax.   0044 (0)191 222 8020
> Email: K.F.Pearce at ncl.ac.uk
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.




More information about the R-help mailing list