The log-rank test compares event counts with their conditional expectations under equal group hazard functions, using the individuals currently in each risk set. Assume the usual independent censoring conditions and independent strata. At pooled event time , let be the group numbers at risk, , and let be the event counts with total . Under the null hypothesis, conditioning on the risk counts and total events gives the hypergeometric distribution
Thus the null expected A count and its conditional variance are
When there is only one person at risk, the event allocation is deterministic and its variance is zero. The unstandardized log-rank statistic is , with variance estimate . Under standard large-sample conditions, is approximately standard normal under the null; the test detects systematic group differences in event rates. It is particularly effective for proportional-hazards alternatives, while crossing effects can cancel in the score.
For a stratified log-rank statistic, construct these risk sets and observed-minus-expected differences separately within each stratum , then sum:
This allows different baseline hazard functions between strata and avoids comparing an event with individuals in another stratum. The null is equal A and B hazards within each stratum, together with a censoring mechanism that does not invalidate the within-risk-set comparison.
In a paired stratum, both individuals initially form the risk set. A first event while both are still observed gives one nontrivial event allocation. After either individual leaves, every subsequent event is certain to belong to the only remaining group and has observed count equal to expected count. Therefore each pair supplies at most one informative table. A pair supplies none if the first exit is censoring before either observed event, if neither has an event during their joint follow-up, or if both fail simultaneously so that the tied event allocation is fixed. An event-censoring tie needs a specified convention; with events processed before same-time censoring, the other individual remains at risk for that event and the pair is informative. The untied continuous-time case avoids this ambiguity.
If A has the informative first event, the table at that time is
The phrase in the second column refers only to this event time; it does not mean that B can never fail. The expected A count is , so this table contributes to , with variance . An informative B-first pair contributes . All other tables contribute zero. Therefore the requested unnormalized score is
A positive score means more observed early events on A. There is no need to standardize it to answer the question.
To obtain an exact conditional law, put . Under the within-pair equal-hazard null, conditional on an event while both are at risk, either subject supplies it with probability . Equivalently, before the pair's first exit, the cause-specific event intensities for A and B are equal; integration over the common period of joint observation gives equal probabilities for the two informative outcomes. This argument requires noninformative observation of the failure process, not just equality of unadjusted marginal survival curves. Different independent pairs then have independent fair signs when informative. Conditioning on the set of informative pairs gives independent Bernoulli outcomes with probability ; conditioning only on their count mixes identical binomial laws and gives the same result:
This proves the paired log-rank reduction to a sign test. The conditional mass function is , , so an exact two-sided p-value sums the masses for with . If , there is no information for a treatment comparison. Failure-time distances beyond their ordering play no role in this paired score.
Since the observed times are ordered, the final risk set is . Its Cox partial likelihood factor is therefore
for either value of the last event indicator. Every earlier risk set and earlier event factor is unaffected by changing . Thus the entire partial likelihood as a function of is unchanged, not merely its value at one fitted coefficient. Its maximizing set, its score function and its Observed Fisher information are identical. In particular, any consistently chosen finite fitted is unchanged. The lone terminal event conveys no relative-hazard information because there is no other individual with whom to compare it.
Use the right-continuous Breslow estimator, so the increase from the value at to the value at means the interval . There is no event between these consecutive exit times, and at the risk set contains only subject . Hence
and the fitted individual cumulative hazard increases by
It is the subject's integrated hazard, rather than the reference baseline increment, that equals the event indicator.
For the final unheaded request, a fitted martingale residual at a subject's exit is
The revised observation leaves the last subject at risk until a later event time, still after every other subject has exited. Every earlier risk set is exactly the same as before, and the new final event again contributes the constant factor one. Thus part a gives unchanged coefficients, and every earlier Breslow estimator increment is unchanged. No additional events occur during the extended interval because all other subjects have already left observation.
For , the event indicator and fitted cumulative hazard at remain unchanged, hence so does . For the terminal subject, let denote its old fitted integrated hazard at its censored exit. That old residual is . Part b shows that the new final event adds one to its fitted integrated hazard, giving new residual
Therefore all fitted martingale residuals remain unchanged. Their invariance does not assert that the fitted survivor function at later times or the terminal event record is unchanged: the new late baseline hazard jump is real. This is the terminal-observation invariance of Cox martingale residuals, which relies on a unique final subject and unchanged covariate history.
Use the usual semiparametric Cox proportional-hazards model with observed covariates :
The covariates are implicit in the question's regression fit, even though the displayed data notation only lists exit times and event indicators. Assume entry at a common origin, time-constant covariates, distinct observed times and independent censoring. Write and . Conditional on a single event at in its risk set, the chance that individual supplies it is
The baseline hazard cancels. Consequently estimate by maximizing Cox partial likelihood
For example, the score and information of Cox partial likelihood follow by differentiation. Define , and . Then
When a finite identifiable maximum exists, iterate until convergence. The Observed Fisher information also gives the usual asymptotic coefficient uncertainty. Censored subjects enter the relevant risk sets, even though they supply no numerator event factor.
After fitting , estimate the cumulative hazard of the reference subject by the Breslow estimator
Its jump at an event is the observed event count divided by the total fitted hazard multiplier at risk. The estimate is an integrated baseline hazard, with hazard represented by a measure placing these jumps at observed event times. If a smooth ordinary hazard function is wanted, smooth these increments with a chosen kernel and bandwidth; differentiating the step function as an ordinary function would incorrectly give zero away from the jumps. The fitted individual cumulative hazard is over that individual's follow-up. The invariances below concern this Cox partial likelihood fit and this Breslow estimator; they need not hold for a fully parametric proportional-hazards fit or an arbitrarily smoothed hazard estimator.
Use the standard right censoring setup with everyone entering observation at time zero. At each observed time , the pre-exit risk set has size . The Nelson–Aalen estimator of the cumulative hazard function is
Censoring removes an individual from later risk sets but contributes no event increment.
Exchange the two finite sums:
Each event increment appears in exactly as many subjects' fitted cumulative hazards as there were subjects at risk for that increment. This proves the event-count identity for Nelson–Aalen cumulative hazards. Common entry is relevant: with delayed entry, a subject does not accumulate the increments before entering, so an entry-time subtraction would be needed.
One method for ties is to group observations at each distinct recorded time. If events occur at , use the pre-time risk set size including observations censored at that same recorded time, and take one jump . This is the usual events-before-censoring convention within a recorded tie. Since ,
Thus the grouped Nelson–Aalen event-count identity preserves the required identity at the recorded observation times. It is a sum over individuals, not an unweighted sum over distinct times.
A second method, suitable when ties reflect rounded times, is to break ties by small perturbations or an artificial ordering, then apply the untied estimator. The event-count identity holds on that new, untied time grid. It does not generally persist if all estimates are mapped back to the original common time. For example, two tied failures among two individuals give a grouped jump , so the original-time sum is . Sequentially breaking the failures gives jumps and , whose total is ; assigning the completed jump to both original tied observations gives sum . On the perturbed grid the two values are and , whose sum is again . This distinction states exactly what the second method does and does not preserve.
Another common grouped survival approach is the Kaplan–Meier estimator, from which one may estimate cumulative hazard by . Its jump is , not , and it likewise does not have the Nelson–Aalen event-count identity. In particular it becomes infinite at a time when all remaining individuals fail.
With left truncation, a subject is observed only if it survives to its entry time : subjects with are absent from the sample. A business already operating when observation begins has this delayed-entry mechanism. It joins a risk set only after its recorded entry age. Left truncation excludes earlier failures entirely; left censoring instead includes subjects whose event is known to have happened before a specified time. These mechanisms must not be conflated.
Converting size to a regression factor allows two unrestricted contrasts rather than imposing a linear trend on numerical size codes. The command relevel with a numeric second argument selects the second existing factor level as its reference level. For sorted codes this is medium, coded . However, the displayed coefficient labels size1 and size3 instead correspond to codes with code as reference. The printed coding and coefficient labels are inconsistent. The actual factor levels and labels must be checked. Under the intended medium-size reference, the two reported contrasts compare small and large businesses with medium ones; with literal coding their printed names would be size0 and size2.
Using B's delayed-entry survival object, the Cox proportional-hazards model is
Here is the unspecified baseline hazard for a medium-size village business and is the Cambridge indicator. The fitted hazard ratios are conditional on the other covariates and constant over business age under the proportional hazards assumption. The function fits regression coefficients through partial likelihood; its survival object must actually be B's version, rather than A's earlier object with the same name.
The location coefficient , with standard error , gives and a two-sided Wald test p-value about . Its reported hazard ratio is , with 95% confidence interval . At the same age and size, a Cambridge business therefore has an estimated closure hazard about 55.2% lower than a village business. The reciprocal ratio is . A hazard ratio is not a survival-probability ratio or a proportional increase in lifetime.
The intended small-versus-medium contrast is , with standard error , and p-value . Its hazard ratio is , with 95% confidence interval . The intended large-versus-medium contrast is , with standard error , and p-value ; its hazard ratio is , with interval . Neither size contrast provides convincing evidence of an effect. The wide intervals also show why these results do not establish equality of size-specific hazards.
The sample has businesses. The likelihood-ratio test, Wald test and score test jointly test all three coefficients being zero; their statistics are , and on three degrees of freedom, with p-values , and . None rejects at 5%. This is compatible with the significant one-coefficient location test: testing a specified one-dimensional contrast and testing three coefficients together are different questions. The location result offers some adjusted evidence, but the joint output does not demonstrate a strong overall improvement, and interpretation should acknowledge the uncertainty and the number of comparisons.
The reported is a Cox–Snell likelihood pseudo-R-squared, here . It measures likelihood improvement rather than a literal fraction of variance in lifetimes explained. Its attainable maximum is reported as . It does not validate the proportional hazards assumption or establish useful predictive performance. Adjusted survival predictions would require estimating the baseline survival function as well: . The coefficient summary alone does not supply adjusted five- or ten-year survival probabilities.
Before reporting results, check the size coding discrepancy, the precise sampling dates and the survival records. The stated January 2000–December 2005 span is six calendar years, despite being called five years. Check nonnegative ages, entry no later than exit, correctly recorded closure indicators and the same opening-based clock throughout. Establish whether inclusion and censoring are plausibly independent of lifetime given the covariates, and whether different opening cohorts or calendar environments can reasonably share the fitted lifetime model. Simply including delayed entry does not cure informative selection, omitted confounders or dependence between businesses.
Assess proportional hazards using Schoenfeld residuals against time and a proportional hazards assumption test, supplemented by groupwise log-minus-log survival plots. Investigate influential observations with coefficient-deletion diagnostics and deviance residuals, and inspect overall fit using Cox–Snell residuals. Consider a city-by-size interaction or time-varying effects if supported by the available events, rather than relying on the displayed three main effects. Finally, report the uncertainty and declining late risk sets—only six remain at the final listed event—and distinguish a conditional association from a causal explanation or a prediction for all future businesses.
Statistician B uses the more appropriate analysis. Its start–stop representation includes left truncation as well as right censoring. Both entry and exit are ages since opening, so a business belongs to the risk set at age only when . The event indicator distinguishes closure from a censored end of observation. The counting-process representation does not mean that multiple closures per business have been observed.
Statistician A records only exit and status and treats every sampled business as at risk from opening. That incorrectly adds already-established businesses to risk sets at ages before they entered observation, ignoring their necessary survival to entry. Its first risk count is , whereas B's is . The extra non-events dilute early estimated closure hazards and here bias the estimated survival upward. Correcting left truncation makes later risk sets capable of increasing as businesses enter at their respective ages.
For the Kaplan–Meier estimator with delayed entry, at event ages with closures and businesses at risk,
The standard error follows from the Greenwood formula. Between event times this survival function estimate is constant. At age five the last preceding event is at , and at age ten it is at . Thus the requested estimates, including their precision, are
and
These correspond to estimated proportions 46.2% and 28.0%, not to the probability of surviving five or ten additional years conditional on being sampled at an arbitrary age. A's corresponding estimates and use the inappropriate risk sets.
This interpretation assumes appropriately independent entry and censoring and a suitable common lifetime distribution across entry cohorts. A delayed-entry correction does not remove arbitrary informative sampling or calendar effects. More generally, if no observation covers the earliest ages, absolute survival from opening requires additional information about survival before the first observable age; the reported product-limit normalization is the one used in the supplied analysis.
Let be the number at risk just after , and suppose the events are grouped into tie sizes at ordered times in . With no intervening censoring or entry, their risk counts are , , , and so on. Hence the Kaplan–Meier telescoping across a censor-free interval gives
Only the total appears. Consequently the order of the events and their grouping into ties do not affect the estimate at . Censoring exactly at does not change this conclusion when it is processed after the events at that time, as in the standard convention. The calculation assumes ; no estimator beyond an exhausted risk set is being inferred from unobserved follow-up.
Let be the distinct observed event times, with individuals at risk just before and events there. Parameterize the event-time distribution by the conditional failure probabilities . Under independent censoring, the survival part of the nonparametric likelihood groups into factors
An individual still under observation at contributes either a failure factor or a survival factor; later-censored individuals contribute the latter factors until censoring. Maximizing each factor independently gives , including the boundary solutions when or . Multiplying the conditional survival probabilities yields the Kaplan–Meier estimator
The notation here denotes the survivor function, as in the question. The estimator is constant between event times. Under the usual simultaneous-event convention, individuals censored at remain in its risk set while events are processed, and are then removed.
The Cox proportional-hazards model specifies
where is an unspecified common baseline hazard and is the individual's covariate vector. The hazard ratio for two fixed covariate vectors is , constant in time. Assume independent subjects and independent censoring conditional on their covariates, and use the question's absence of tied events.
Let be an event time, its failing subject, and the risk set immediately before that time. In a short interval of length , the conditional probability that subject fails, given one failure among those at risk, is
The baseline hazard cancels. Multiplying the successive conditional event-identity factors gives the Cox partial likelihood for :
This is a partial likelihood, not the full survival likelihood for the unspecified . Risk sets evolve with the observed history; the derivation uses their successive conditional hazards, rather than assuming the risk sets themselves are independent.
Define and . For component ,
Differentiating again gives
Thus the score and information of Cox partial likelihood are the sum of event-minus-risk-mean contrasts and the sum of risk-weighted covariance matrices, respectively. The Hessian is negative semidefinite; the likelihood is concave, with strict identifiability requiring variation in the relevant risk-set covariates.