The probability of each event type over follow-up, in the presence of competing events. When a patient can experience one of several mutually exclusive events, a Kaplan-Meier estimate of any single one is biased upward, because patients who had a competing event are still counted as being at risk of the event of interest. The cumulative incidence function accounts for them.
Usage
plot_cumulative_incidence(
time,
status,
group = NULL,
event = NULL,
conf_int = FALSE,
palette = "house",
xlab = "Follow up",
ylab = "Cumulative incidence",
title = NULL,
legend_title = NULL,
font = "Arial"
)Arguments
- time
Follow-up times.
- status
Event type per patient. The first level is the event of interest,
0is censoring, and any further levels are competing events. A factor with a0level, a numeric code vector, or a character vector are all accepted.- group
Optional grouping vector, giving one panel per group.
- event
Optional event type to plot. By default every event type is drawn.
- conf_int
Draw pointwise confidence bands.
- palette
Palette name passed to
get_color().- xlab, ylab, title
Axis and plot labels.
- legend_title
Legend title.
- font
Font family used in the plot.
See also
plot_KMCurve() for a single event where no competing risk
applies.