R: Plot cumulative incidence functions

plot.etmCIF {etm} | R Documentation

## Plot cumulative incidence functions

### Description

Plot function for `etmCIF` objects. The function plots cumulative incidence curves, possibly with pointwise confidence intervals.

### Usage

    ## S3 method for class 'etmCIF'
    plot(x, which.cif, xlim, ylim,
        ylab = "Cumulative Incidence", xlab = "Time", col = 1, lty, lwd = 1,
        ci.type = c("none", "bars", "pointwise"), ci.fun = "cloglog",
        ci.col = col, ci.lty = 3, legend = TRUE, legend.pos, curvlab,
        legend.bty = "n", pos.ci = 27, ci.lwd = 3, ...)

### Arguments

`x` | A `etmCIF` object
`which.cif` | A numeric vector indicating which CIFs should be plotted. When missing, only the CIF of interest is plotted (determined through the `failcode` argument in `etmCIF`.)
`xlim` | x-axis limits for the plot. By default, `c(0, max(time))`
`ylim` | y-axis limits. Default is `c(0, 1)`
`ylab` | Label for y-axis. Default is `"Cumulative Incidence"`
`xlab` | Label for x-axis. Default is "Time"
`col` | Vector describing colours used for the CIF curves. Default is black
`lty` | Vector of line type
`lwd` | Thickness of the lines
`ci.type` | One of `c("none", "bars", "pointwise")`. `none` plots no confidence interval, `bars` plots the confidence intervals in the form of a segment for one time point, and `pointwise` draws pointwise confidence intervals for the whole follow-up period.
`ci.fun` | Transformation used for the confidence intervals. Default is "clolog", and is a better choice for cumulative incidences. Other choices are "log" and "log-log"
`ci.col` | Colour for the pointwise confidence interval curves. Default is same as the CIF curves
`ci.lty` | Line type for the confidence intervals. Default is 3
`legend` | Logical. Whether to draw a legend. Default is `TRUE`
`legend.pos` | A vector giving the legend's position. See `legend` for further details
`curvlab` | A character or expression vector to appear in the legend. Default is CIF + event label
`legend.bty` | Box type for the legend. Default is none ("n")
`pos.ci` | If `ci.type = "bars"`, vector of integers indicating at which time point to put the confidence interval bars. Default is 27
`ci.lwd` | Thickness of the confidence interval segment (for `ci.type = "bars"`)
`...` | Further graphical arguments

### Details

The function relies on `plot.etm` and `lines.etm` with more or less the same options. Exception is the drawing of the confidence intervals, for which several displays are possible.

### Value

No value returned

### Author(s)

Arthur Allignol arthur.allignol@gmail.com

### See Also

`etmCIF`, `plot.etm`, `lines.etm`

### Examples

    data(abortion)

    cif.ab <- etmCIF(survival::Surv(entry, exit, cause != 0) ~ group, abortion,
                     etype = cause, failcode = 3)

    cif.ab

    plot(cif.ab, ci.type = "bars", pos.ci = 24,
         col = c(1, 2), lty = 1, curvlab = c("Control", "Exposed"))

    plot(cif.ab, which = c(1, 2))

[Package etm version 1.1 Index]