Background
Survival models can be viewed as consisting of two parts: the underlying baselineThe Cox model
Introduction
Sir David Cox observed that if the proportional hazards assumption holds (or, is assumed to hold) then it is possible to estimate the effect parameter(s), denoted below, without any consideration of the full hazard function. This approach to survival data is called application of the ''Cox proportional hazards model'', sometimes abbreviated to ''Cox model'' or to ''proportional hazards model''. However, Cox also noted that biological interpretation of the proportional hazards assumption can be quite tricky. Let be the realized values of the covariates for subject ''i''. The hazard function for the Cox proportional hazards model has the form :: This expression gives the hazard function at time ''t'' for subject ''i'' with covariate vector (explanatory variables) ''X''''i''. Note that between subjects, the baseline hazard is identical (has no dependency on ''i''). The only difference between subjects' hazards comes from the baseline scaling factor .Why it's called "proportional"
To start, suppose we only have a single covariate, , and therefore a single coefficient, . Consider the effect of increasing by 1: :: We can see that increasing a covariate by 1 scales the original hazard by the constant . Rearranging things slightly, we see that: :: The right-hand-side is constant over time (no term has a in it). This relationship, , is called a proportional relationship. More generally, consider two subjects, i and j, with covariates and respectively. Consider the ratio of their hazards: :: The right-hand-side isn't dependent on time, as the only time-dependent factor, , was cancelled out.Absence of an intercept term
Often there is an intercept term (also called a constant term or bias term) used in regression models. The Cox model lacks one because the baseline hazard, , takes the place of it. Let's see what would happen if we did include an intercept term anyways, denoted : :: where we've redefined to be a new baseline hazard, . Thus, the baseline hazard incorporates all parts of the hazard that are not dependent on the subjects' covariates, which includes any intercept term (which is constant for all subjects, by definition).Likelihood for unique times
The Cox partial likelihood, shown below, is obtained by using Breslow's estimate of the baseline hazard function, plugging it into the full likelihood and then observing that the result is a product of two factors. The first factor is the partial likelihood shown below, in which the baseline hazard has "canceled out". The second factor is free of the regression coefficients and depends on the data only through the censoring pattern. The effect of covariates estimated by any proportional hazards model can thus be reported asLikelihood when there exist tied times
Several approaches have been proposed to handle situations in which there are ties in the time data. ''Breslow's method'' describes the approach in which the procedure described above is used unmodified, even when ties are present. An alternative approach that is considered to give better results is ''Efron's method''. Let ''t''''j'' denote the unique times, let ''H''''j'' denote the set of indices ''i'' such that ''Y''''i'' = ''t''''j'' and ''C''''i'' = 1, and let ''m''''j'' = , ''H''''j'', . Efron's approach maximizes the following partial likelihood. :: The corresponding log partial likelihood is :: the score function is :: and the Hessian matrix is :: where :: :: Note that when ''H''''j'' is empty (all observations with time ''t''''j'' are censored), the summands in these expressions are treated as zero.Examples
Below are some worked examples of the Cox model in practice.A single binary covariate
Suppose the endpoint we are interested is patient survival during a 5-year observation period after a surgery. Patients can die within the 5 year period, and we record when they died, or patients can live past 5 years, and we only record that they lived past 5 years. The surgery was performed at one of two hospitals, A or B, and we'd like to know if the hospital location is associated with 5-year survival. Specifically, we'd like to know the relative increase (or decrease) in hazard from a surgery performed at hospital A compared to hospital B. Provided is some (fake) data, where each row represents a patient: T is how long the patient was observed for before death or 5 years (measured in months), and C denotes if the patient died in the 5-year period. We've encoded the hospital as a binary variable denoted X: 1 if from hospital A, 0 from hospital B. Our single-covariate Cox proportional model looks like the following, with representing the hospital's effect, and i indexing each patient: :: Using statistical software, we can estimate to be 2.12. The hazard ratio is the exponential of this value, . To see why, consider the ratio of hazards, specifically: :: Thus, the hazard ratio of hospital A to hospital B is . Putting aside statistical significance for a moment, we can make a statement saying that patients in hospital A are associated with a 8.3x higher risk of death occurring in any short period of time compared to hospital B. There are important caveats to mention about the interpretation: # a 8.3x higher risk of death does not mean that 8.3x more patients will die in hospital B: survival analysis examines how quickly events occur, not simply whether they occur. # More specifically, "risk of death" is a measure of a rate. A rate has units, like meters per second. However, a relative rate doesn't: a bicycle can go 2 times faster than another bicycle (the reference bicycle), without specifying any units. Likewise, the risk of death (rate of death) in hospital A is 8.3 times higher (faster) than the risk of death in hospital B (the reference group). # the inverse quantity, is the hazard ratio of hospital B relative to hospital A. # We haven't made any inferences about probabilities of survival between the hospitals. This is because we would need an estimate of the baseline hazard rate, , as well as our estimate. However, standard estimation of the Cox proportional hazard model does not directly estimate the baseline hazard rate. # Because we have ignored the only time varying component of the model, the baseline hazard rate, our estimate is timescale-invariant. For example, if we had measured time in years instead of months, we would get the same estimate. # It's tempting to say that the hospital caused the difference in hazards between the two groups, but since our study is not causal (that is, we don't know how the data was generated), we stick with terminology like "associated".A single continuous covariate
To demonstrate a less traditional use case of survival analysis, the next example will be an economics question: what is the relationship between a companies' price-to-earnings ratio (P/E) on their 1-year IPO anniversary and their future survival? More specifically, if we consider a company's "birth event" to be their 1-year IPO anniversary, and any bankruptcy, sale, going private, etc. as a "death" event the company, we'd like to know the influence of the companies' P/E ratio at their "birth" (1-year IPO anniversary) on their survival. Provided is a (fake) dataset with survival data from 12 companies: T represents the number of days between 1-year IPO anniversary and death (or an end date of 2022-01-01, if did not die). C represents if the company died before 2022-01-01 or not. P/E represents the companies price-to-earnings ratio at their 1-year IPO anniversary. Unlike the previous example where there was a binary variable, this dataset has a continuous variable, P/E. However, the model looks similar: :: where represents a company's P/E ratio. Running this dataset through a Cox model produces an estimate of the value of the unknown , which is -0.34. Therefore an estimate of the entire hazard is: :: Since the baseline hazard, , was not estimated, the entire hazard is not able to be calculated. However, consider the ratio of the companies i and j's hazards: :: All terms on the right are known, so calculating the ratio of hazards between companies is possible. Since there is no time-dependent term on the right (all terms are constant), the hazards are proportional to each other. For example, the hazard ratio of company 5 to company 2 is . This means that, within the interval of study, company 5's risk of "death" is 0.33 ≈ 1/3 as large as company 2's risk of death. There are important caveats to mention about the interpretation: # The hazard ratio is the quantity , which is in the above example. From the last calculation above, an interpretation of this is as the ratio of hazards between two "subjects" that have their variables differ by one unit: if , then . The choice of "differ by one unit" is convenience, as it communicates precisely the value of . # The baseline hazard can be represented when the scaling factor is 1, i.e. . Can we interpret the baseline hazard as the hazard of a "baseline" company who's P/E happens to be 0? This interpretation of the baseline hazard as "hazard of a baseline subject" is imperfect, as it is possible that the covariate being 0 is impossible. In this application, a P/E of 0 is meaningless (it means the company's stock price is 0, i.e., they are "dead"). A more appropriate interpretation would be "the hazard when all variables are nil". # It's tempting to want to understand and interpret a value like to represent the hazard of a company. However, consider what this is actually representing: . There is implicitly a ratio of hazards here, comparing company i's hazard to an imaginary baseline company with 0 P/E. However, as explained above, a P/E of 0 is impossible in this application, so is meaningless in this example. Ratios between plausible hazards are meaningful, however.Time-varying predictors and coefficients
Extensions to time dependent variables, time dependent strata, and multiple events per subject, can be incorporated by the counting process formulation of Andersen and Gill. One example of the use of hazard models with time-varying regressors is estimating the effect of unemployment insurance on unemployment spells. In addition to allowingSpecifying the baseline hazard function
The Cox model may be specialized if a reason exists to assume that the baseline hazard follows a particular form. In this case, the baseline hazard is replaced by a given function. For example, assuming the hazard function to be the ''Weibull'' hazard function gives the ''Weibull proportional hazards model''. Incidentally, using the Weibull baseline hazard is the only circumstance under which the model satisfies both the proportional hazards, and accelerated failure time models. The generic term ''parametric proportional hazards models'' can be used to describe proportional hazards models in which the hazard function is specified. The Cox proportional hazards model is sometimes called a ''Relationship to Poisson models
There is a relationship between proportional hazards models andUnder high-dimensional setup
In high-dimension, when number of covariates p is large compared to the sample size n, the LASSO method is one of the classical model-selection strategies. Tibshirani (1997) has proposed a Lasso procedure for the proportional hazard regression parameter. The Lasso estimator of the regression parameter β is defined as the minimizer of the opposite of the Cox partial log-likelihood under an L1-norm type constraint. :: There has been theoretical progress on this topic recently.Software implementations
* Mathematica:CoxModelFit
function.
* R: coxph()
function, located in the survival package.
* SAS: phreg
procedure
* Stata: stcox
command
* Python: CoxPHFitter
located in the lifelines library.
* SPSS: Available under Cox Regression.
* Matlab: coxphfit
function
* Julia: Available in the Survival.jl library.
* JMP: Available in Fit Proportional Hazards platform.
See also
*Notes
References
* * * * * * {{DEFAULTSORT:Proportional Hazards Models Survival analysis Semi-parametric models Poisson point processes