0

It's stated on many online resources that Martingale plots can be used to assess linearity in a Cox model and there are abundant explanations about what constitutes being nonlinear in a plot, but I feel like advice on the appropriate subsequent action to take is lacking.

It's often described that squared terms, exponentials and logs can be added and restricted cubic splines could be used, but how can one know from visual assessment of the plots which is best?

For example, here are two variables of mine that appear nonlinear:

  1. Age

enter image description here

  1. Body length

enter image description here

Both of the above appear nonlinear but in different ways; what would be a course of action for such circumstances, but more importantly how can I learn how to know this myself?

Bonus question: So far I only checked vars that violate the PH assumption. Whilst I know that Martingale is mostly used for linearity and Schoenfeld for PH, I have read some conflicting accounts, and therefore clarity would be appreciated.

JED HK
  • 409
  • Does this answer your question? Cox PH linearity assumption: reading martingal residual plots You need to show a smoothed (e.g., loess) summary of the residuals to make any sense of these plots. It also matters whether you make these plots with or without the predictor you are evaluating. Plots from models without the predictor best show the functional form. – EdM Aug 01 '22 at 17:35
  • Hi Ed, I'd actually came across the question first time around but now that you've stressed the importance of loess being in the plot I find it more helpful. Still, knowing which actions to take in response to a nonlinear plot is still not evident and I can't seem to find resources for that. Should I really just trail and error it? Seems haphazard – JED HK Aug 02 '22 at 07:36
  • If you want to start from the shape of smoothed martingale residual plots then, yes, you use the shape as a guide for intelligent trial and error. In practice, flexible regression fits are generally used for continuous predictors: regression splines, smoothing splines, or other types of generalized additive models. – EdM Aug 02 '22 at 20:22
  • You might want to see this page for the ways to let the data tell you the functional form directly. All those methods can work with survival models. About the best you can do starting from martingale plots is to let the plots suggest things. For example, Section 5.1.2 of Therneau and Grambsch on this topic says for such a plot "A roughly logarithmic shape is suggested, and this can be easily checked by plotting on a log scale." – EdM Aug 02 '22 at 20:30
  • you're a legend Ed, thanks a lot – JED HK Aug 03 '22 at 08:29

0 Answers0