[R] Plotting question re. cuminc

K F Pearce k.f.pearce at newcastle.ac.uk
Fri May 15 16:31:25 CEST 2009

Hello everyone,

(This is my second question posted today on the R list).

I am carrying out a competing risks analysis using the cuminc function...this takes the form:


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,

Dr Kim Pearce CStat
Industrial Statistics Research Unit (ISRU)
School of Mathematics and Statistics
Herschel Building
University of Newcastle
Newcastle upon Tyne
United Kingdom

Tel.   0044 (0)191 222 6244 (direct)
Fax.   0044 (0)191 222 8020
Email: K.F.Pearce at ncl.ac.uk

More information about the R-help mailing list