% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/geoms-special.R
\name{geom_nelson_aalen}
\alias{geom_nelson_aalen}
\title{Nelson-Aalen cumulative hazard curve layer}
\usage{
geom_nelson_aalen(
  mapping = NULL,
  data = NULL,
  color = NULL,
  alpha = NULL,
  linewidth = NULL
)
}
\arguments{
\item{mapping, data, color, alpha}{As in \code{\link[=geom_point]{geom_point()}}.}

\item{linewidth}{Curve width.}
}
\value{
A \link{Layer} to add with \code{+}.
}
\description{
Map \code{time} and \code{status} (1/TRUE = event, 0/FALSE = censored) exactly as
for \code{\link[=geom_km]{geom_km()}}; map \code{color} to compare groups. The cumulative hazard
H(t) is the additive counterpart of the Kaplan-Meier survival curve —
useful when the \emph{rate} of events, not the surviving fraction, is what
matters.
}
\examples{
set.seed(1)
d <- data.frame(t = rexp(80, 0.08), ev = rbinom(80, 1, 0.75))
ggnext(d, aes(time = t, status = ev)) +
  geom_nelson_aalen() +
  labs(title = "Cumulative hazard", x = "Time", y = "H(t)")
}
