Robust Cox Regression

Statistics
Introduced by
Lin & Wei
Year
1989
Type
Semi-parametric survival regression with robust variance
Family
Regression / GLM

What does it do?

Robust Cox regression fits the standard Cox proportional hazards model but estimates the variance of the coefficients with a sandwich estimator built from subject-level score residuals, rather than from the model-based information matrix.

The point estimates are unchanged, while standard errors and confidence intervals remain valid when observations are clustered or the working model is only approximately correct. Lin and Wei (1989) developed this variance for possibly misspecified Cox models.

The intuition behind the method

The usual Cox standard errors assume that subjects are independent and that the model is correctly specified. When subjects are grouped, for example patients within hospitals, or when the model is only approximately right, these assumptions can fail, and the standard errors can be too small even though the hazard-ratio estimates are reasonable. The robust variance instead measures how much each subject's score contributions actually vary in the data, so the reported uncertainty reflects the observed pattern rather than the assumed model. Lin and Wei's abstract reports that conventional model-based procedures can give poor confidence-interval coverage under misspecification, which is the problem this variance is designed to address.

History

Lin and Wei (1989) derived robust inference for the Cox proportional hazards model in the Journal of the American Statistical Association, showing that the maximum partial likelihood estimator is asymptotically normal under a possibly misspecified model, with a covariance matrix that can be consistently estimated by a sandwich-type estimator.

When to use it

Choose robust Cox regression when the outcome is time-to-event, the target quantity is a hazard ratio from a Cox model, and the observations are not clearly independent, for example repeated events per subject or subjects nested in centres, or when there is reason to think the working model is only approximately correct. Its point estimates equal those of the standard Cox model, so it mainly changes the uncertainty that is reported. Do not choose it when clustering is strong and the between-cluster variance itself is of interest; a frailty or mixed-effects Cox model is the appropriate tool then. Nor should it be used to rescue strongly non-proportional hazards, where time-varying coefficients or stratification are needed. When the model is correct, the robust and model-based standard errors agree asymptotically, so the choice costs little, but the sandwich result is asymptotic and should be checked when events are few.

Limitations and considerations

  • The sandwich variance is justified by large-sample theory, so its behaviour with small samples or few events should be checked in the data at hand. Lin and Wei (1989) report that robust score tests perform well even in small samples; the small-sample behaviour of robust Wald intervals should still be checked in the data at hand.
  • It does not correct a substantially violated proportional hazards assumption; time-varying coefficients or stratification are needed in that case.
  • For strong clustering or shared frailty, robust Cox gives marginal inference but cannot estimate cluster-level variance, which a frailty model provides.

Source conditions do not replace independent scientific review or validation by an analysis engine.

Strengths

  • Gives standard errors and confidence intervals that remain valid under mild misspecification of the covariance structure or under clustering, while leaving the partial-likelihood estimates unchanged.
  • Keeps the semi-parametric structure of the Cox model: the baseline hazard stays unspecified and the coefficients keep their hazard-ratio interpretation.
  • Accommodates repeated events per subject or multi-centre data by summing score residuals within clusters, which is available through a cluster term in common software.
  • Adds only a variance computation to the standard Cox fit, so the optimisation problem itself is unchanged.
  • When the Cox model is correctly specified, the robust and model-based variances agree asymptotically, so the robust variance serves as a check on the naive standard errors.

Applications

  • Multi-centre clinical trials in which patients are clustered within hospitals and the independence assumption is doubtful.
  • Recurrent-event survival analysis, such as repeated hospitalisations per patient, where the robust variance accounts for the dependence among a subject's repeated events by summing score residuals within subject.
  • Epidemiological cohort studies with family-based or geographic clustering.
  • Pragmatic trials with site-level randomisation analysed at the patient level.
  • Sensitivity analyses alongside a standard Cox model to check whether the conclusions depend on the model-based standard errors.

How it works

How it works

1

The Cox model specifies that the hazard for subject i at time t is the baseline hazard h₀(t) multiplied by exp(Xβ). The baseline hazard remains unspecified (non-parametric), and β is estimated by maximising the partial likelihood.

Formula
h(t|X) = h_0(t)\exp(X\beta)
2

The partial log-likelihood conditions only on the order of events, which removes h₀(t) from estimation. Maximising it gives the same β̂ as standard Cox regression, so robust estimation changes the variance, not the point estimates.

Formula
\ell_p(\beta) = \sum_{i: \delta_i=1}\left[X_i\beta - \log\sum_{j\in R(t_i)}\exp(X_j\beta)\right]
3

The sandwich variance Â⁻¹B̂Â⁻¹ replaces the naive inverse information matrix. B̂ is the sum of outer products of the subject-level score residuals Û_i, so it reflects the variability actually present in the data. For clustered data, the score residuals are summed within clusters before B̂ is formed.

Formula
\hat{V}_{\text{rob}} = A^{-1}\hat{B}A^{-1},\quad \hat{B}=\sum_i \hat{U}_i\hat{U}_i^\top
4

Hazard ratios, Wald tests and confidence intervals are computed from the robust variance. The proportional hazards assumption should still be checked with Schoenfeld residuals, because robust errors do not correct a substantially violated PH assumption.

Common pitfalls

  • Applying robust Cox to very small samples or to data with few events, where the large-sample variance may not be reliable.
  • Treating robust standard errors as a remedy for non-proportional hazards; the PH assumption should still be tested with Schoenfeld residuals regardless of the variance estimator.
  • Omitting the cluster variable when clustering exists, in which case the sandwich variance does not account for within-cluster dependence.
  • Confusing robust Cox, which changes only the variance, with frailty models, which add a random effect and change the likelihood and the point estimates.

Frequently asked questions

Does robust Cox regression change the hazard ratio estimates?

No. The partial-likelihood maximisation is identical; only the variance matrix, and therefore the standard errors and confidence intervals, changes. Hazard ratios are the same as those from the standard Cox model.

How is the cluster variable specified?

In R's survival package, use the cluster() term inside coxph(). In Stata, use vce(cluster clustvar). The score residuals are then summed within clusters before the sandwich matrix is formed.

When is a frailty model better than robust Cox?

When clustering is strong and you want to estimate the size of between-cluster heterogeneity, or when the random effect is scientifically meaningful, for example a genetic frailty. Robust Cox gives valid marginal inference but cannot estimate cluster-level variance.

How many events do I need for the robust estimator to be reliable?

No fixed minimum number of events is established for the robust estimator. Reliability depends on the total number of events and on the number of clusters, and because the sandwich estimator is an asymptotic result, few events or few clusters call for caution. If the robust and model-based intervals differ markedly, examine the data more closely or consider a frailty model.

Should I still check the proportional hazards assumption?

Yes, always. Robust standard errors do not correct a violated PH assumption; they address mild misspecification of the covariance structure. Use Schoenfeld residuals and the cox.zph test regardless of the variance estimator.

Related methods

Sources

  1. Lin, D. Y., & Wei, L. J. (1989). The robust inference for the Cox proportional hazards model. Journal of the American Statistical Association, 84(408), 1074–1078.

    Open DOI reference
  2. Therneau, T. M., & Grambsch, P. M. (2000). Modeling Survival Data: Extending the Cox Model. Springer.

    ISBN: 978-0387987784