% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/geoms-clinical.R
\name{geom_cuminc}
\alias{geom_cuminc}
\title{Cumulative incidence (competing risks)}
\usage{
geom_cuminc(mapping = NULL, data = NULL, linewidth = NULL)
}
\arguments{
\item{mapping, data}{Standard layer overrides. Map follow-up time to
\code{time}, the event code to \code{status} (0 = censored, 1, 2, ... = event
types), and optionally a treatment arm to \code{color}.}

\item{linewidth}{Line width.}
}
\value{
A \link{Layer} to add with \code{+}.
}
\description{
Aalen-Johansen cumulative incidence curves by event type, the correct
estimator when competing events make 1 - Kaplan-Meier biased upward.
}
\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()
}
