Skip to content
Celeus

Cox proportional-hazards regression

Shown in the app as cox_ph. Part of the method reference, under Survival and censored data.

When to use

Time-to-event outcome (time + 0/1 event): hazard ratios for predictors, adjusting for covariates.

What you provide

  • Time (follow-up): one numeric column.
  • Event (1 = event, 0 = censored): one two-level column.
  • Predictors: one or more columns.

Options

Missing data

  • Complete case (listwise deletion)
  • Multiple imputation

Multiple comparisons

  • Not adjustable for this method. Where it makes post-hoc comparisons, the procedure applies its own correction.

Confidence level

Every interval in the result is reported at the level you choose:

  • 90%
  • 95%
  • 99%

Alternatives that take the same inputs:

Other methods under Survival and censored data:

Guides that discuss this method

How to read the output

These methods model time until an event, with censoring, from one or more predictors, for example the time until a component fails as a function of load and operating temperature. Each effect is adjusted for the other predictors in the model.

Cox regression: hazard ratios. A hazard ratio compares the instantaneous rate of the event: for a numeric predictor, per one-unit increase; for a categorical predictor, relative to the reference category. Above 1 means the event tends to happen sooner, below 1 later, and a 95% confidence interval that excludes 1 corresponds to p below 0.05. The model assumes each hazard ratio is constant over time (proportional hazards). The proportional-hazards check tests that assumption (Grambsch and Therneau, 1994); if it fails, a single hazard ratio averages an effect that changes over time.

Weibull accelerated failure time regression: time ratios. A time ratio describes how a predictor stretches or shrinks the time to the event. Above 1 means longer expected time to the event, below 1 shorter, again adjusted for the other predictors. It reports time ratios instead of hazard ratios, and it assumes the times follow a Weibull distribution (Wei, 1992). The Weibull model is also a proportional-hazards model, so it is not a remedy when the proportional-hazards check fails for a Cox model.

The headline result is the ratio for the first predictor. A categorical predictor with three or more categories is also tested as a whole, with a likelihood-ratio test across all its categories, because each of its ratios compares only one category with the reference. Coefficients are unstable when there are few events per estimated coefficient, which is what the events-per-variable check looks at; a categorical predictor counts once per non-reference category.

Proportional-hazards check. For Cox regression, the check is reported for each predictor and for the model as a whole, so you can see which predictor’s effect changes over follow-up. With multiple imputation there is no standard pooled version of this check or of the per-predictor likelihood-ratio tests, so neither is reported, and the Methods text says so.

Event value and confidence level. As for Kaplan-Meier, a two-valued text event column needs you to say which value marks the event. Every interval in the result uses one confidence level: 95% by default, or 90% or 99% if you choose it before the run. Results also state the number of events, which is what a survival analysis’s precision depends on.

Sources: Cox DR (1972), Journal of the Royal Statistical Society, Series B 34(2):187-202, doi:10.1111/j.2517-6161.1972.tb00899.x. Grambsch PM, Therneau TM (1994), Biometrika 81(3):515-526, doi:10.1093/biomet/81.3.515. Wei LJ (1992), Statistics in Medicine 11(14-15):1871-1879, doi:10.1002/sim.4780111409.

Worked examples

Celeus's result on a published or illustrative dataset, next to an independent computation and, where one exists, a published value. The data themselves are not reproduced here.

survival::lung (status recoded 0/1)

  • Source: Published dataset distributed with an R package
  • Licence: survival (GPL)
  • Reference: Loprinzi et al. (1994)
QuantityCeleusIndependent computationPublished valueAgrees
Estimate1.017191.01719-Yes
p-value0.0645910.064591-Yes

survival::lung (status as shipped: 1 = censored, 2 = dead)

  • Source: Published dataset distributed with an R package
  • Licence: survival (LGPL)
  • Reference: The survival package vignette (R package survival 3.8-6), summary(cfit1) and cox.zph(cfit1) for age + sex + wt.loss: age HR 1.0202913, 95% CI 1.0011 to 1.0398, p = 0.0377; 152 events; likelihood ratio test 14.67 on 3 df; Schoenfeld chi-squares 0.5077, 2.5489, 0.0144, global 3.0051
QuantityCeleusIndependent computationPublished valueAgrees
Estimate1.020291.020291.02029Yes
Confidence interval1.00115, 1.039801.00115, 1.039801.0011, 1.0398Yes
p-value0.03765540.03765540.0377Yes
Number of events152152152Yes
Whole-model likelihood-ratio statistic14.669114.669114.67Yes
Proportional-hazards test statistic for each predictor0.5077410, 2.5489200, 0.0144409, 3.00505000.5077410, 2.5489200, 0.0144409, 3.00505000.5077, 2.5489, 0.0144, 3.0051Yes

survival::nafld1 (missing BMI excluded; large n)

  • Source: Published dataset distributed with an R package
  • Licence: survival (LGPL)
  • Reference: Allen et al. (2018), Hepatology 67
QuantityCeleusIndependent computationPublished valueAgrees
Estimate1.105841.10584-Yes
Number of observations1258812588-Yes
Number of events10181018-Yes

survival::veteran (137 patients, 128 events)

  • Source: Published dataset distributed with an R package
  • Licence: survival (LGPL)
  • Reference: The survival package vignette 'Using Time Dependent Covariates and Time Dependent Coefficients in the Cox Model' (survival 3.8-6): trt coefficient 0.180197, hazard ratio 1.197453, p = 0.326; 128 events
QuantityCeleusIndependent computationPublished valueAgrees
Estimate1.197451.197451.19745Yes
p-value0.3260160.3260160.326Yes
Number of events128128128Yes

survival::veteran (cell type has 4 levels)

  • Source: Published dataset distributed with an R package
  • Licence: survival (LGPL)
  • Reference: Kalbfleisch and Prentice (1980), The Statistical Analysis of Failure Time Data; independent computation
QuantityCeleusIndependent computationPublished valueAgrees
Test statistic for each model term17.3405, 34.523017.3405, 34.5230-Yes
Degrees of freedom for each model term3, 13, 1-Yes

Validation report

References

  1. Cox, D. R. (1972). Regression models and life-tables. Journal of the Royal Statistical Society, Series B 34: 187-202. doi:10.1111/j.2517-6161.1972.tb00899.x doi:10.1111/j.2517-6161.1972.tb00899.x
  2. Therneau, T. M., Grambsch, P. M. (2000). Modeling Survival Data: Extending the Cox Model. Springer, New York. doi:10.1007/978-1-4757-3294-8 doi:10.1007/978-1-4757-3294-8