For individual , let count its observed event by time and let indicate membership of the risk set immediately before . Set and . Under a common hazard function and independent censoring, a currently at-risk subject has event probability in the next short interval. Summing over the current risk set gives the conditional intensity
Equivalently, the event count decomposes as
where is the mean-zero counting-process martingale obtained by subtracting its conditional compensator. Estimating the unknown hazard increment by the observed event increment divided by the risk set size gives the Nelson–Aalen estimator
Here are the distinct observed event times and includes the subject who is about to fail. A censored observation affects subsequent risk sets, but causes no event jump. This is the requested no-ties estimator; tied event counts would produce .
The derivation also identifies the estimation error:
Thus it estimates on the time range where individuals remain at risk. It is not exactly unbiased for the entire cumulative hazard after the last risk set disappears. Its usual Nelson–Aalen variance estimator is , since the compensator variance increment of the no-ties event process is .
For a counting process adapted to its observed history , a predictable counting-process intensity specifies
or more generally is a local martingale. In survival analysis, let record failures and record the risk set, including subjects at their own observation time. Under independent right censoring and a common hazard function , the aggregate intensity is , where and .
Writing , the conditional increment equation is . Replacing by the observed increment gives the Nelson–Aalen estimator
where ranges over the distinct observed event times. Censored observations remove subjects from subsequent risk sets but do not produce hazard jumps.
For these data the Nelson–Aalen estimator gives
Thus the six fitted cumulative hazards sum to , the number of observed failures.
The event-count identity for Nelson–Aalen cumulative hazards follows by exchanging the finite sums. With everyone entering at time zero,
This includes each failure subject in its own risk set. A delayed-entry dataset requires a different risk indicator and is not covered by this particular identity.
Under a constant hazard survival model, . Imposing the same identity gives the events divided by exposure estimator
Its fitted cumulative hazards at the six times are , again summing to four. It is also the maximum-likelihood estimate under independent right censoring, since the parameter-dependent likelihood is . This is a sensible estimate if the exponential survival model is appropriate, but four failures give little precision. The event-count identity by itself does not validate constant hazard; the large final jump in the Nelson–Aalen estimator also reflects a risk set of one, rather than by itself proving an increasing hazard.
For a proper continuous event time, the survival function is . The assumed invertibility of the cumulative hazard function gives, for ,
Therefore
This is the cumulative hazard probability transformation; it applies also conditionally on a subject's covariates, using that subject's correctly specified cumulative hazard function.
The fitted transformed times are Cox–Snell residuals. They retain their event/right censoring indicators, so a right-censored residual represents an exponential observation known only to exceed its displayed value. Under the fitted model and independent right censoring, calculate the Kaplan–Meier estimator of residual survival and compare it with , or calculate the residual Nelson–Aalen estimator and compare its cumulative hazard with the diagonal . Systematic departures reveal model inadequacy; sparse extreme residual risk sets and parameter estimation require caution. Treating all censored residuals as observed event times would invalidate this diagnostic.
Without right censoring, the residual mean should be approximately one. With right censoring, use the modified Cox–Snell residual
For a true unit-rate exponential distribution, the memoryless property gives . Thus an event keeps its known transformed time, while a censored observation is replaced by the conditional expected event time. Under independent right censoring, iterated expectation makes the mean of these adjusted values one when the true hazards are used, and approximately one when fitted hazards are used. These mean-imputed values do not themselves have an exponential distribution, so the survival-curve diagnostic should still use the original censored residual dataset. Moreover fitting equations can force the adjusted sample mean to one, making its mean alone a weak diagnostic.
For the proposed mixture of a finite right censoring time and no right censoring, and
Consequently
When right censoring has positive probability this choice is unique; if , no correction is needed and any has the same effect. Its independence from is the content of exponential memorylessness: the expected extra lifetime after any right censoring time is one. Conditioning on an arbitrary independent right censoring time proves the same correction beyond this special two-point mixture.
The command cox.zph checks the proportional hazards assumption test through time dependence of scaled Schoenfeld residuals. Under constant coefficients, their expected trend against transformed event time should be flat. A significant covariate-specific test would suggest that its coefficient varies with time; the global test checks the coefficients jointly.
The p-values are for age, for gender and for group, with global . Thus these tests find no evidence against proportional hazards. They do not prove the assumption, establish the correct age functional form, or test the censoring mechanism.
The separate diagnostic plot targets the broader fitted survival distribution. The code evaluates a fitted cumulative hazard function at each observed time and multiplies by the subject's fitted hazard multiplier, forming Cox–Snell residuals:
The curve returned without newdata by survfit is a reference-profile curve, not necessarily the all-zero-covariate baseline. The multiplier must use the same centering as that reference curve; the fitted linear predictors use the model's reference convention. With this consistency, times the multiplier is the fitted subject-specific cumulative hazard.
Part (a) shows why complete transformed event times should be approximately unit exponential if the Cox proportional-hazards model is correct. The Q–Q plot compares ordered fitted residuals with an independent random exponential sample. Most points are near the diagonal, with some upper-tail departures, so it gives no obvious indication of a gross distributional failure. A random reference sample adds simulation noise, and estimated parameters and tied recorded times prevent this from being an exact distribution-free test.
Importantly, four observed times are censored. Their transformed times retain the censoring indicators and are not complete exponential observations. Simply plotting all residuals as uncensored therefore gives only a rough visual check. A more appropriate Cox–Snell residual survival diagnostic fits a Kaplan–Meier estimator or Nelson–Aalen estimator to , retains the censoring flags, and checks whether the estimated cumulative hazard is close to , equivalently whether estimated survival is close to . Taken together, the supplied checks are broadly compatible with the fitted model, while none resolves potentially informative censoring from giving up.
The history contains the information observed strictly before : baseline characteristics, previous events and censoring, and therefore which individuals are currently eligible and under observation. Formally it is the pre- information in the relevant filtration. The at-risk process is 1 if individual is observed and event-free immediately before , and 0 otherwise. Let and write for the cumulative hazard increment.
The counting-process intensity in survival analysis gives
The common conditional hazard function is assumed to remain applicable after conditioning on the observed history, as under suitable independent censoring. Summing gives the conditional mean of the total event increment:
On times with , invert this relation to estimate the hazard increment:
The last sum is for untied events. This is the Nelson–Aalen estimator; for ties replace 1 by the number of events at that time. No increment can be estimated once the risk set is empty.
Put . A binary event increment has conditional variance . Since , its squared mean is of second order, giving
Treating the predictable risk set size as known given the history, the Nelson–Aalen estimator increment therefore has first-order variance
Substitute for to obtain the estimated increment variance . Summing these estimated predictable variances gives the usual Nelson–Aalen variance estimator:
The martingale has orthogonal increments, which justifies accumulating the predictable variances of the estimation error. This is an estimated sampling variance on the observed at-risk range, not a claim of exact finite-sample unbiasedness after the risk set becomes empty. For multiple events at an event time the usual extension replaces the numerator 1 by the event count.
Let and be the total observed counting process and size of the risk set. When the individual cumulative hazard functions are all , summing the conditional intensity equations gives
Replace the expected increment by its observed value and divide by the predictable risk set size. Thus the Nelson–Aalen estimator in integral form is
with the integrand defined as zero when . This is an integral against the step counting process, so each event time contributes its event count divided by the risk set just before that time. The Nelson–Aalen estimator estimates integrated hazard over times with observable risk; it does not supply information after observation has ended.
Use the allowed ratio-of-expectations approximation where . The unconditional numerator and denominator from part (b) give
The common censoring survivor function cancels in this approximation. By differentiating the logarithm, its value is the population integrated hazard:
This is not generally the arithmetic mean of the ; it is the cumulative hazard function of the population mixture from part (a). The cancellation requires a common independent censoring law and adequate observation of the time range.
The approximation establishes approximate unbiasedness, not exact finite-sample unbiasedness. For a direct counterexample, take one uncensored individual with exponential distribution of rate . The Nelson–Aalen estimator is then , whose expectation is , whereas . Thus it is not an unbiased estimator in general.
More explicitly, for independent individuals with a common event hazard , the exact expected estimator is
This exhibits finite-sample bias of Nelson–Aalen estimation and dependence on when empty risk sets are possible. In a heterogeneous population, replacing the random ratios by ratios of their means introduces an additional approximation. On adequately observed intervals with large risk sets, the population-mixture expression is the appropriate large-sample target.
The ordinary Nelson–Aalen estimator adds at event time . Under a fitted proportional hazards model, replace the number at risk by the sum of fitted hazard multipliers:
This is the Breslow estimator of the integrated baseline hazard, using fitted regression coefficients obtained by maximizing the Cox partial likelihood. The denominator arises because the total event intensity is ; with every multiplier equal to one it reduces to the Nelson–Aalen estimator.
The estimator is right-continuous, so already includes the event at . Subtracting it leaves only the events at and , whose risk sets are and . Hence
There is no increment at the censoring time . If the lower endpoint had instead been , an additional would be present. The final singleton event can increase the baseline hazard estimate even though its partial likelihood contribution is one.
Define the event counting process and at-risk process by
Under a common hazard function and independent censoring, the conditional event rate is . Equivalently, the counting-process compensator satisfies . Estimate a cumulative hazard increment by the observed event increment divided by the current risk set:
With no ties, has mass at , and . Thus the Nelson–Aalen estimator is
Only event times contribute, so no empty risk set is divided into an event count. Right-censored observations contribute time to the risk sets, but no event increment.
In the Cox proportional-hazards model, replace the number at risk in the Nelson–Aalen estimator by the sum of relative hazards:
The total event counting process has conditional rate , so the estimated baseline hazard increment is . Integrating gives the Breslow estimator
When , all relative hazards are 1 and this reduces to the Nelson–Aalen estimator. The denominator is positive at each observed event time.
Aggregate the individual increments. At an event time , their conditional expectation is the number
at risk times . Replacing expectation by the observed event increment gives . Thus the estimator is the Nelson–Aalen estimator
The Nelson–Aalen estimator is
For tied events, uses the number of events sharing time and the risk-set size just before that time.
At month 5,
Their ratio is .
At time , the observed number of events is and the exposure to the common instantaneous hazard is the risk-set size . The likelihood score for a hazard increment therefore equates observed and expected events:
Thus the Nelson–Aalen estimator is
It estimates the cumulative hazard function by adding event count divided by current exposure at every observed event time.
Let be the at-risk process and the counting process for observed events. Over a short interval, the multiplicative-intensity model gives
where is the hazard function and the cumulative hazard function. Solving this relation for the infinitesimal hazard increment suggests . Summing over distinct event times gives the Nelson–Aalen estimator
where events occur among individuals at risk. Here there are no ties, so .