The results of my coxph() are significant, yet the cox.zph() test is significant too.

From my understanding of it, the significance of cox.zph() means that the Cox model is not fit to model the relationship between my covariates and the dependent variable. The reason being that this relationship is not linear, while the Cox model only accounts for linear relationships.

I want to know whether there is a relationship between my covariates and survival. Do the results of the cox.zph() test invalidate the results of the coxph()?

  • 1
    $\begingroup$ Not specifying the correct linear relationship between a covariate and the log-hazard can lead to a violation of the proportional hazards (PH) assumption. See this page. In that case fixing the model specification might also fix the PH problem, although time-dependendent coefficients can be needed. One could also consider parametric survival models that don't depend on (or even allow for) PH, like log-normal models or other accelerated failure time models outside the Weibull family. $\endgroup$
    – EdM
    Jul 25, 2020 at 15:21

1 Answer 1


zph() checks for proportionality assumption, by using the Schoenfeld residuals against the transformed time. Having very small p values indicates that there are time dependent coefficients which you need to take care of. That is to say, the proportionality assumption does not check linearity - the Cox PH model is semi parametric and thus makes no assumption as to the form of the hazard. The proportionality assumption is that the hazard rate of an individual is relatively constant in time, and this is what cox.zph() tests.

If a covariate breaks the assumption, it might need fixing as there are time dependent coefficients. To solve this you can either interact the coefficient with explicit time, or use strata based on the plotted residuals. For a detailed guide on doing this, see my answer here: Extended Cox model and cox.zph

Without doing something about it, it might invalidate the results, in a similar manner to how breaking linear regression assumptions might.


the effect of holding a diploma on the length of job search vs no diploma. Same scenario : coxph() and zph() significant. Can I say that holding a diploma has an effect on the length of job search?

In all likelihood yes, you could say that. However, given the failed proportionality assumption test, you cannot trust the coefficient of having a diploma (lets call this $diploma$). The Cox model assumes that the effect $diploma$ has on the time to find a job (lets call this $t_{job}$) is constant in time. That means that If $diploma$ increases the % of finding a job by 35%, this increase is regardless of time.

In the case that $diploma$ failed the proportionality assumption, as when the cox.zph() test for it is significant, adjustments need to be had. If $diploma$'s coefficient changes as a function of time (i.e., the more time it takes to find a job, the relative benefit of having a diploma linearly declines), than you need to add a time transformation, or tt() to your model based on the relationship function. If linear, for example:

model <- coxph(Surv(time, event) ~ diploma + tt(diploma), 
data = mydata, tt = function(x, t, ...) x * t)

In this case, the value of $diploma$ will be the initial diploma coefficient (at $t_0$ difference between having a diploma and not having a diploma), and the interaction would mean the decrease/increase in that initial value of the with every passing unit of time (hours/days etc.. however you count time). Do this and check cox.zph() again. If it it non-significant, you can probably leave it at that. It makes more theoretical sense that having the coefficient change at specific time points.

Note that you can specify any time of relationship in the tt() function, not just linear.

  • 1
    $\begingroup$ Defining a time-dependent coefficient as an interaction of a covariate with time, proposed above and illustrated in the answer linked from this answer, is incorrect. This is a common error; see the vignette on time-dependency in Cox models. There is a tt() function to allow correct specification of time-dependent covariates, but the result cannot currently be checked by cox.zph(). See this answer for details. $\endgroup$
    – EdM
    Jul 25, 2020 at 14:38
  • 1
    $\begingroup$ @EdM - absolutely true. Will edit this and other answer shortly. Sorry for causing some confusion. $\endgroup$ Jul 26, 2020 at 15:37
  • 2
    $\begingroup$ No apology needed. Most of your points in both answers were spot-on, except for this one common misunderstanding. Some of my best final answers here came from responding to others' comments about issues they found in my first attempts. That helpful and generally respectful give-and-take is one of the things I like most about this site. $\endgroup$
    – EdM
    Jul 26, 2020 at 16:02
  • 1
    $\begingroup$ @YuvalSpiegler, one clarification: in the first paragraph, you mention that "proportionality assumption is that the hazard rate is ... constant". Shouldn't this say that the hazard ratio is constant? The hazard function of an individual can have any shape (it doesn't have to be constant), but hazard ratios across individuals are constant at all points in time. $\endgroup$
    – Nayef
    Feb 27, 2021 at 3:07

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.