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.
At event time , the vector Schoenfeld residual is
where is the fitted partial-likelihood coefficient. It compares the covariate of the person who actually failed with the covariate mean predicted for the failing person, using the fitted hazard weights over the risk set. Under the model at the true coefficient, the conditional expected failing covariate is precisely that weighted mean, so the corresponding Schoenfeld function is conditionally centered at zero. Residuals are defined at observed events, not at censoring times.
The score equation from part (a) is exactly
At a finite interior unpenalized maximum, , so
This is the intended fitted-residual identity. For an arbitrary trial coefficient it is a score, not generally zero; a single event with covariates zero and one in its risk set can have Schoenfeld function at . Penalized estimates or a boundary maximum also need their own score conditions rather than this unqualified zero-sum assertion.
Under proportional hazards, each coefficient is constant over event time. Examine the Schoenfeld residuals, preferably scaled Schoenfeld residuals, against time or a prespecified transformation such as log time, ranks or a fitted survival-time transformation. Plot a smooth trend and its uncertainty for each covariate. Under the working model there should be no systematic residual-time association; a persistent trend suggests a time-varying coefficient. In a coefficient-scale plot that adds to the scaled residuals, the null trend is horizontal at the fitted coefficient.
A formal proportional hazards assumption test can add a time interaction, for example , and test using a score test with information adjusted for the fitted constant coefficients. The score contributions involve the Schoenfeld functions weighted by . One can test each covariate and use a joint global test for a vector of time-interaction coefficients. Such an association would be possible despite the unweighted residual sum being zero, so that fitted identity does not establish proportional hazards.
A systematic nonhorizontal coefficient trend or significant residual-time association is evidence against a constant hazard ratio. Failure to reject is compatible with the assumption, not proof of it. These diagnostics target the proportionality restriction; they do not by themselves verify covariate functional form or independence of the censoring mechanism.
The difference is the observed event subject's covariate minus its conditional expected value under the working coefficient. It is the Schoenfeld function; at a fitted coefficient it becomes a Schoenfeld residual. If the conditional event-label distribution is generated by coefficient , part (b) gives
Hence its unconditional expectation is zero whenever it is integrable. Centering is at the true coefficient: data generated under do not generally make mean zero at an arbitrary trial value .
The same quantity is the score function of one conditional event factor, since
This connects its conditional centering to the usual zero-mean likelihood-score identity.
At each event time, a Schoenfeld residual is the observed event covariate minus its risk-set weighted mean:
Under a correct constant-coefficient model, these event-time residuals have no systematic time trend. Plot scaled Schoenfeld residuals against time or a prespecified transformation such as log time, with smooth curves and uncertainty bands. Depending on the plotting convention, adding the fitted coefficient produces an estimate of ; a horizontal curve then supports a constant coefficient, while a clear trend suggests violation. Examine sparse late follow-up with its wider uncertainty.
Formal tests can use residual-time association or a proportional-hazards time interaction extension , testing jointly for a multi-parameter factor and globally across covariates. Evaluate at each current event/risk-set time: multiplying a baseline variable by that person's eventual observed follow-up time would use outcome information and would not be the intended time-dependent model. A nonsignificant test with limited information does not establish proportionality.
For categorical groups, approximately parallel empirical log-minus-log survival curves provide another check, because proportional hazards imply . Use observed group curves, not fitted proportional-hazards curves that are parallel by construction, and recognize possible confounding by other variables. If a violation is real, consider stratifying on a categorical nuisance variable, adding an explicitly time-varying effect, or choosing another survival-model family. Stratification allows separate baseline hazards but sacrifices a single estimated hazard ratio for that stratification variable. Do not force a constant coefficient merely to preserve the original model label; describe the time pattern or limit the interpretation of the constant summary.
For an event at from subject , with covariate vector , define the Schoenfeld function
The second term is the hazard-weighted mean covariate in the risk set just before the event. The Schoenfeld residual is this function evaluated at the fitted coefficient, . Calculate one residual vector per event, using every at-risk subject, including those who will subsequently be censored. There is no ordinary event residual assigned at a right censoring time.
The Cox partial likelihood score function is . At the true constant coefficient in a Cox proportional-hazards model, the conditional event subject is selected with weights proportional to , so each Schoenfeld function has conditional mean zero. If the coefficient varies with time, that centering changes. Plot residuals against event time or a transformation of it, smooth them, and investigate departures from zero. Scaled Schoenfeld residuals account for the risk-set covariate variance and can display departures in coefficient units; score function tests based on residual-time association provide a formal check. Risk-set composition affects unscaled residual variance, and the total residual score function can be zero by fitting even when a time trend is present.
A scaled Schoenfeld residual rescales a Schoenfeld residual using fitted information so that its trend can diagnose departures from a constant coefficient in a Cox proportional-hazards model. A smooth trend against transformed event time estimates a time-dependent coefficient pattern; a flat trend supports the working proportional hazards assumption test.
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.
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.