Cumulative incidence curve plot in competing risk analysis by split groups, including a table describing competing events and group comparison using the proportional subdistribution hazards regression model described in Fine and Gray (1999).

NiceCumIncPlot(TIMES, STATUS, SPLIT = NULL, CENSCODE = 0,
  TARGETCODE = 1, EVENTTABLE = TRUE, COMPARE = T, RATETABLE = T,
  TIMEPOINT = NULL, ORDER = T,
  MAIN = "Cumulative Incidence Function", XLAB = NULL,
  YLAB = "cumulative incidence", XLIM = NULL, YLIM = c(0, 1),
  SCALE = NULL, UNIT = "???", COL = NULL, EVENTNAME = "Event",
  COMPETENAME = "Competing", CEX = 0.8, ...)

Arguments

TIMES

time variable in competing risk setting

STATUS

status variable in competing risk setting default 0 = Censored 1= Events of interest, 2= Competing EVENT(s)

SPLIT

=NULL optional split variable

CENSCODE

=0, non-standard code for censored observations

TARGETCODE

=1, non-standard code for Events of interest

EVENTTABLE

= T, show event table

COMPARE

=T, show table with comparisons based on proportional subdistribution hazards regression model

RATETABLE

= T, show table with rate estimates at TIMEPOINT and their 95 percent CI

TIMEPOINT

=NULL, time point at which ordering of curves is read off if desired

ORDER

=T, order legends such that legends matched curves from top to bottom

MAIN

="Cumulative Incidence Function" plot title

XLAB

=NULL, x-axis label, default is "Time" with UNITS added in brackets if UNITS specified

YLAB

="cumulative incidence", y-axis label

XLIM

=NULL, range of x-axis - NOTE that for the comparison also Events beyond XLIM are used.

YLIM

=c(0,1), range of y-axis

SCALE

=NULL, unit for tick distance on time axis

UNIT

="???", specify time unit to be included in XLAB, e.g. "days", "Months", "years"

COL

=NULL, specify colours for curves to overwrite the default

EVENTNAME

="Event" colname for Event in Event table

COMPETENAME

="Competing" colname for competing events in Event table

CEX

= .8 letter size for legends

...

further plot parameter passed to graphics::plot

Value

produces a plot and invisibly returns the fitted proportional subdistribution hazard model

Details

NiceCumIncPlot

Examples

if (FALSE) { N<-200 TimeToEvent<-rweibull(N,1) Events<-sample(0:2,N,replace=T,prob=c(.3,.5,.2)) Arm<-sample(LETTERS[1:2],N,replace=T) xx<-NiceCumIncPlot( TIMES=TimeToEvent, STATUS=Events, SPLIT=Arm, CENSCODE=0, TARGETCODE=1, EVENTTABLE = F, COMPARE = T, RATETABLE = T, TIMEPOINT=2, ORDER=T, MAIN="Cumulative Incidence Function", XLAB=NULL, YLAB="cumulative incidence", XLIM=NULL, YLIM=c(0,1), SCALE=NULL, UNIT="years", COL=NULL, EVENTNAME ="Event", COMPETENAME ="Competing", CEX=.8) }