For each observed event with , let be its risk set. The Cox partial likelihood is
Maximize it to obtain , estimate its variance from the observed partial information, and test using a partial likelihood-ratio test, Wald test, or score test. A positive fitted coefficient means the group with has the larger hazard.
A semiparametric proportional hazards model specifies
with finite-dimensional parameter but an unspecified baseline hazard . A partial likelihood uses a component of the data likelihood that depends on while eliminating the nuisance function. In the Cox proportional-hazards model, conditioning on which member of each risk set experiences the event produces the Cox partial likelihood.
Construct the two countries' period-specific risk sets with the same left truncation and right censoring rules, then compare their event counts by a log-rank test. This is a nonparametric comparison because it does not specify the shape of either country's hazard function.
Potential event time 2026-10-05
A potential event time is a support point permitted in the discrete event-time distribution used to derive the Kaplan–Meier estimator by maximum likelihood estimation. The support must include every observed exact event time. Additional points with a nonempty risk set but no observed event receive zero fitted event mass.
A grid of potential right censoring times includes every observed censoring time. Intervals between consecutive grid points have no internal censoring, so their Kaplan–Meier estimator factors telescope to a single ratio of event-free survivors to individuals observed across the interval. This gives the same estimator when endpoint risk sets are counted consistently.
A refractory period makes a patient ineligible for another event for a fixed time after a recurrence. Exclude this time from exposure and risk sets by delaying the next interval's entry to . In a gap-time recurrent-event model measured from the previous event, the next interval enters at gap age , not zero; the clock is not reset at the end of recovery.
Right censoring Created 2026-09-24 Updated 2026-10-14
An unobserved survival time is right-censored when it is known to exceed the last event-free follow-up time. For a potential survival time and potential observation-ending time , record
When , the occurrence was observed at ; when , only is known. An intact machine at the study's closing date and an event-free subject who stops attending follow-up can both yield right censoring, but the reasons for stopping matter for independent censoring. A subject right-censored at year two has contributed two years to person-time at risk and belongs to earlier risk sets. Neither recording a failure at year two nor discarding that subject preserves this information.
Under independent censoring and separate parameters for the observation mechanism, the part of the survival likelihood involving an absolutely continuous probability distribution for is . Thus a right-censored observation contributes the survival function , rather than the event probability density function . See Lu Tian's Stanford notes, Section 2.1, equations (2.1)–(2.2). The Kaplan–Meier six-subject cohort shows exactly how this distinction changes the calculation.
Risk set Created 2026-09-24 Updated 2026-10-14
The risk set immediately before an event time contains the individuals who remain observed, event-free, and eligible to experience the event. For a cohort observed from time zero, with exit times under right censoring, write and . Individuals with an event or right censoring exactly at are included in this denominator; process events before removing subjects right-censored at that same recorded time. Earlier right censoring removes subjects from later risk sets. With delayed entry, use the entry times too, as in the Kaplan–Meier estimator with delayed entry.
With a common excess hazard, let be the known background hazard averaged over the current risk set. Estimate the excess cumulative hazard by subtracting from the Nelson–Aalen estimator. Applying the product-limit construction gives the displayed estimator: the continuous background correction multiplies the ordinary Kaplan–Meier estimator. Its event jump is , while between events it grows at rate . Hence the unconstrained curve can increase, even if the true excess hazard is nonnegative. Replacing its jump factor by gives the alternative exponential cumulative-hazard estimator; these versions are close for small event fractions but are not identical.
Schoenfeld function Created 2026-10-06 Updated 2026-10-14
At a distinct event time, the Schoenfeld function is the event subject's covariate minus the hazard-weighted covariate mean over the risk set, as a function of a trial coefficient . Its evaluation at the fitted coefficient is a Schoenfeld residual. The sum of these functions is the Cox partial likelihood score function, and each is conditionally centered at zero at the true proportional-hazards coefficient.
If the risk set has two subjects with covariate zero and one with covariate one, its hazard-weighted mean is . A zero-covariate event has Schoenfeld function , while a one-covariate event has function . At the true coefficient their probabilities are and , so the conditional expected function is zero.
Schoenfeld residual 2026-10-06
At an untied event time, a Schoenfeld residual is the event subject's covariate vector minus its fitted risk-weighted average over the risk set. Under a correctly specified Cox proportional-hazards model, these residuals have no systematic mean trend with event time. They are defined at event times, unlike Cox–Snell residuals which can be evaluated at both events and censoring times.
At an untied event time, the Cox partial likelihood weights the current risk set by . Differentiation gives the displayed score function and the negative Hessian as a sum of weighted covariances. The score is the sum of Schoenfeld functions, so Schoenfeld residuals sum to zero at a finite interior unpenalized fit. At arbitrary trial coefficients or boundary fits, a zero sum is not a general identity.
Self-consistency of Kaplan–Meier estimation Created 2026-10-06 Updated 2026-10-14
The Kaplan–Meier estimator is self-consistent under fractional allocation of censored event times according to its own conditional fitted event distribution. Adding the corresponding fractional event counts and risk set weights leaves the estimator unchanged.
At a failure time with events among at risk, the Nelson–Aalen estimator adds , whereas minus the logarithm of the Kaplan–Meier estimator adds . For ,
Thus small event fractions give close cumulative hazard estimates. Large risk sets alone do not suffice when a large fraction fail together. If all remaining individuals fail, the logarithmic estimate becomes infinite while the Nelson–Aalen jump is one.
Represent each person's successive eligible episodes by separate left-open, right-closed intervals, retaining a common patient identifier and event-order information. A recurrence ends an interval and can be followed by another one; administrative censoring ends the final interval without an event. The row's entry time determines risk set membership. Multiple rows remain one patient history, with possible within-patient recurrent-event dependence.
Compute observed-minus-expected event contributions within each stratum's risk set, then add them across independent strata. Under the null, the corresponding conditional variances add. Standardizing gives an approximate normal distribution test, or its square gives a one-degree-of-freedom chi-squared distribution test. The comparison requires the usual exchangeability and independent censoring assumptions within strata.
Survival analysis Created 2026-09-24 Updated 2026-10-13
Survival analysis studies the probability distribution of a survival time: how long from a specified starting point until a specified occurrence. The occurrence need not be death. It might be a machine's first breakdown, a customer's first renewal, or a person's recovery. The meaning of "survival" is simply that the chosen occurrence has not happened yet. Both the starting point and the outcome must be defined before interpreting a survival function.
The distinctive difficulty is incomplete observation. A machine still working when observation stops supplies a lower bound on its survival time, rather than an observed breakdown time. Right censoring lets us retain that information. The Kaplan–Meier estimator estimates a survival function using the changing risk sets, without choosing an exponential distribution or another particular survival distribution. A hazard function instead describes the current event rate among those still event-free; its cumulative hazard connects those local rates to the whole survival function.
This framework turns different follow-up lengths into usable evidence about waiting times. It supports questions such as the chance of remaining event-free for another year, or the restricted mean survival time within an observed horizon. Lu Tian's Stanford teaching materials introduce these interpretations in Survival Distributions, Hazard Functions, Cumulative Hazards, Section 1.1.
Survival data 2026-10-14
Survival data describe the time from a specified origin to an event, together with covariates and the observation mechanism. Under right censoring, the observed exit time is and the event indicator is . With left truncation, an entry time is also recorded and subjects are observed only if . Recording the time origin, entry, exit and event indicator is essential for constructing valid risk sets.