Aalen-Johansen cumulative incidence curves by event type, the correct
estimator when competing events make 1 - Kaplan-Meier biased upward.
geom_cuminc(mapping = NULL, data = NULL, linewidth = NULL)
Arguments
- mapping, data
Standard layer overrides. Map follow-up time to
time, the event code to status (0 = censored, 1, 2, ... = event
types), and optionally a treatment arm to color.
- linewidth
Line width.
Value
A Layer to add with +.
Examples
set.seed(1)
d <- data.frame(
t = rexp(120, 0.1),
ev = sample(0:2, 120, replace = TRUE, prob = c(.4, .35, .25))
)
ggnext(d, aes(time = t, status = ev)) + geom_cuminc()
#> <ggnext plot>
#> data: 120 x 2
#> aes: time = t, status = ev
#> layers: 1
#> coord: cartesian
#> mode: static