I am using a Cox regression to model mortality in response to a collection of health variables. I would like to test the proportional hazards assumption of my Cox model. For this, I've entered my fitted model with all variables (around 70) into the cox.zph function in R. From this I see some of the variables are p<0.05.

When I assess these visually (as recommended, especially for large sample sizes such as mine with >100 000 observations) I very much struggle to see how the assumption is violated. To demonstrate, see the figure for 4 of the variables, two being significant and two not.

enter image description here

My questions:

  1. How can one visually distinguish between those that violate the PH assumption and those that do not, based on these figures.

  2. My sample size is large which I'm led to believe can suggest violation of the PH assumption regardless; does the similarity between the images for the variables here suggest that in my case?

  3. For some of the variables which have been flagged as significant on the Schoenfeld there is no logical basis for varying PH over time (for example effect of healthy eating on mortality over time). I understand this can occur due to, e.g., missing a variable in the model set up, but I have included all possible variables here and I am doubtful this would be the case in my current aanlysis. What else can explain this?

  4. In many instances survival analysis is used for survival of a cohort over multiple years (as implied by the name). Clearly, in these circumstances, age is an important variable, yet, obviously age increases risk of event (death) over time and therefore has an interaction over time. Should this then be accounted for in all Cox models of this nature spanning the course of years? From the examples I've seen, I see that age is often a variable but its presumable violation of PH is not corrected (or even checked for).


1 Answer 1


Question 1. You can't, based on these figures. You seem to be using the survminer package. Last that I knew, it has a SERIOUS CODING ERROR for Schoenfeld residual plots that makes its plots essentially useless. The dashed lines, supposed to be confidence intervals for the smoothed curves, are beyond most of the data points. Use the plain old plots produced by the R plot() function on cox.zph objects, or fix the ggcoxzph() code as indicated in the linked answer.

Question 2. Yes, if you have a large enough sample size you will tend to find "statistically significant" deviations from the proportional hazards (PH) assumption. You have to apply your understanding of the subject matter to determine whether those deviations are practically significant. See this answer, for example. Even if PH is violated, the coefficients will represent a sort of weighted average of log-hazards that might be good enough in practice. There are ways to refine the usual Cox estimates to provide something approaching true time-averaged values; see the R coxphw package.

Question 3.

For some of the variables which have been flagged as significant on the Schoenfeld there is no logical basis for varying PH over time (for example effect of healthy eating on mortality over time).

This seems to be a perfect example of how PH could vary over time. Remember that the Cox regression coefficients are based on an assumption that the current values of covariates are related to the instantaneous hazard of an event. The effects of unhealthy eating don't express themselves immediately. If "unhealthy eating" is a baseline covariate that doesn't change over time, then I would expect the associated hazard to increase with time as plaque builds up in blood vessels and individuals transition at later ages into metabolic syndrome.

Beyond that, after half a century doing biomedical research, I've learned that Mother Nature doesn't always follow our intuition about a "logical basis" for anything.

Question 4. Age is generally important to control for in a survival model. You will unfortunately find that many studies do not test the underlying assumptions of survival models. In addition to checking PH assumptions, one should evaluate the linearity of log-hazard with respect to continuous covariates, validate the modeling process with an approach like bootstrap resampling, and determine how well calibrated the predicted survival probabilities are. See Frank Harrell's course notes, book, and rms package in R for details and implementation.

  • 1
    $\begingroup$ your answers on mine and others questions are much appreciated Ed. I found your answer to question 3 particularly interesting because, now I think about it, surely for almost all variables the impact on health then increases over time since the effects are not immediate (think sleep, smoking, exercise, stress - the effects of these are almost entirely from chronic exposure. Are they then all unsuitable for Cox unless adjusted?) $\endgroup$
    – JED HK
    Commented Jul 19, 2022 at 12:58
  • $\begingroup$ @JEDHK the question is whether the Cox modeling is good enough to be useful for its intended purpose. "All models are wrong, but some are useful". $\endgroup$
    – EdM
    Commented Jul 19, 2022 at 13:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.