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%
Related methods
Alternatives that take the same inputs:
Other methods under Survival and censored data:
- Peto-Peto generalized Wilcoxon test
- Censored regression (Tobit-style)
- Kaplan-Meier (log-rank test)
- Factors associated with outcome (time-to-event outcome)
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)
| Quantity | Celeus | Independent computation | Published value | Agrees |
|---|---|---|---|---|
| Estimate | 1.01719 | 1.01719 | - | Yes |
| p-value | 0.064591 | 0.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
| Quantity | Celeus | Independent computation | Published value | Agrees |
|---|---|---|---|---|
| Estimate | 1.02029 | 1.02029 | 1.02029 | Yes |
| Confidence interval | 1.00115, 1.03980 | 1.00115, 1.03980 | 1.0011, 1.0398 | Yes |
| p-value | 0.0376554 | 0.0376554 | 0.0377 | Yes |
| Number of events | 152 | 152 | 152 | Yes |
| Whole-model likelihood-ratio statistic | 14.6691 | 14.6691 | 14.67 | Yes |
| Proportional-hazards test statistic for each predictor | 0.5077410, 2.5489200, 0.0144409, 3.0050500 | 0.5077410, 2.5489200, 0.0144409, 3.0050500 | 0.5077, 2.5489, 0.0144, 3.0051 | Yes |
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
| Quantity | Celeus | Independent computation | Published value | Agrees |
|---|---|---|---|---|
| Estimate | 1.10584 | 1.10584 | - | Yes |
| Number of observations | 12588 | 12588 | - | Yes |
| Number of events | 1018 | 1018 | - | 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
| Quantity | Celeus | Independent computation | Published value | Agrees |
|---|---|---|---|---|
| Estimate | 1.19745 | 1.19745 | 1.19745 | Yes |
| p-value | 0.326016 | 0.326016 | 0.326 | Yes |
| Number of events | 128 | 128 | 128 | Yes |
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
| Quantity | Celeus | Independent computation | Published value | Agrees |
|---|---|---|---|---|
| Test statistic for each model term | 17.3405, 34.5230 | 17.3405, 34.5230 | - | Yes |
| Degrees of freedom for each model term | 3, 1 | 3, 1 | - | Yes |
References
- 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
- 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