2
$\begingroup$

Edit: added new plots generated with plot.cox.zph(), to replace those I had generated with survminer::ggcoxzph(), due to an error in the code of the latter as pointed out by EdM in a comment.

Recently I've been learning about Survival Analysis, and today I'm practicing checking the proportional hazards assumption of a Cox PH regression.

I've read that plotting the Schoenfeld residuals of a certain predictor is a way of assessing the validity of the proportional hazards assumption for that predictor. As I understand it, if the trend line through those residuals is not flat then it suggests the proportional hazards assumption is not valid for that predictor.

But having just done this for two predictors in my Cox PH regression, I am perplexed by the fact that the covariate with the wigglier trend through its Schoenfeld residuals is associated with a much higher p-value than that of the covariate with the less wiggly trend:

enter image description here

enter image description here

The trend in the upper plot is associated with a p-value of 0.887, while that of the lower plot is 0.076.

My question is: why does the wigglier Schoenfeld residual trend have a much higher associated p-value in this case? I assume my being perplexed by this has to do with some lack of understanding of the concepts at play.

$\endgroup$
3
  • $\begingroup$ You seem to be using the survminer package or some derivative package that has a SERIOUS CODING ERROR in its Schoenfeld residual plotting. See this page for how to proceed. Please replace your plots with plots done correctly as explained on the linked page, as in their current form they are essentially uninterpretable. $\endgroup$
    – EdM
    Commented Jul 19, 2022 at 16:40
  • $\begingroup$ @EdM thanks for pointing this out. I've edited the post to have the plots generated by plot.cox.zph(), as you suggest in your answer to that other question. I'm still confused as to why the wigglier trend has a much higher p-value in this case. Can you offer any insights based on the new plots? $\endgroup$
    – lex
    Commented Jul 20, 2022 at 15:06
  • $\begingroup$ @lex I just asked something somewhat similar (stats.stackexchange.com/questions/582606/…). It seems the resources for this are unclear $\endgroup$
    – JED HK
    Commented Jul 20, 2022 at 15:17

1 Answer 1

1
$\begingroup$

The null hypothesis evaluated by cox.zph() is whether the slope of the scaled Schoenfeld residuals versus (transformed) time equals 0. A wiggly curve without an overall trend is hard to distinguish from a straight flat line on that basis, so the result is a very high probability (p-value) that your data for the upper, wiggly curve are consistent with that null hypothesis.

The second curve has a fairly consistent upward trend with time. That makes it much less likely that the null hypothesis of slope = 0 is true. The p-value is "close to significant" by the usual, arbitrary, p < 0.05 criterion.

That said, you might still want to re-evaluate how you model both predictors.

In the top plot it looks like there is a noticeable drop in the coefficient estimate right after the very first time (time = 1?), perhaps from positive to negative, a rise thereafter until about time = 60, and fairly flat thereafter. Does that make sense, based on your understanding of the subject matter? Modeling that predictor with a time-varying coefficient could be considered. See the time-dependence vignette of the R survival package.

Similarly for the second predictor. The p-value isn't technically "significant", but there is a hint of a trend. Is that trend important enough to matter in practice, such that you might need to consider a time-varying coefficient for that as well? There are no cut-and-dried answers to that question; you have to apply your understanding of the subject matter and be able to defend your choice to skeptical reviewers of your work.

$\endgroup$

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.