% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/diagnostics.R
\name{hzr_nelson}
\alias{hzr_nelson}
\alias{print.hzr_nelson}
\title{Wayne Nelson cumulative hazard estimator with lognormal confidence limits}
\usage{
hzr_nelson(time, event, weight = NULL, conf_level = 0.95)

\method{print}{hzr_nelson}(x, digits = 4, ...)
}
\arguments{
\item{time}{Numeric vector of follow-up times.}

\item{event}{Numeric event indicator (1 = event, 0 = censored).}

\item{weight}{Optional numeric vector of event weights (default 1).
Weights are applied only to events (censored observations contribute
zero weight). Use for severity-weighted repeated events.}

\item{conf_level}{Confidence level for the interval (default 0.95).}

\item{x}{An \code{hzr_nelson} object.}

\item{digits}{Number of decimal places for formatting.}

\item{...}{Additional arguments (ignored).}
}
\value{
A data frame with one row per unique event time and columns:
\describe{
\item{time}{Event time.}
\item{n_risk}{Number at risk.}
\item{n_event}{Number of events at this time.}
\item{weight_sum}{Sum of event weights at this time.}
\item{cumhaz}{Nelson cumulative hazard estimate.}
\item{std_err}{Standard error.}
\item{cl_lower}{Lower lognormal confidence limit.}
\item{cl_upper}{Upper lognormal confidence limit.}
\item{hazard}{Interval hazard rate.}
\item{cum_events}{Cumulative (weighted) event count.}
}
}
\description{
Compute the Nelson-Aalen cumulative hazard estimate with lognormal
confidence limits. Supports weighted events for severity-adjusted
analyses of repeated/recurrent events.
This is the R equivalent of the SAS \code{nelsonl.sas} macro.
}
\details{
Unlike \code{survival::survfit()} which uses the Breslow estimator with
Greenwood variance, this function uses the Wayne Nelson estimator
with lognormal confidence limits that are always non-negative.
}
\examples{
data(cabgkul)
nel <- hzr_nelson(cabgkul$int_dead, cabgkul$dead)
head(nel)

}
\seealso{
\code{\link[=hzr_kaplan]{hzr_kaplan()}} for survival estimation.
}
