How do I analyse the functional form of the relationship between a covariate to the hazard ratio in a Cox proportional hazard model?

Hi there,

I’m analysing the functional form of a continuous covariate to the hazard ratio in a Cox proportional hazard model. I’d like to compare a linear model to a model where the covariate is log transformed. I have two specific questions:

  • What is the appropriate method for visual inspection?
  • Apart from visual inspection, should I do a formal test to compare the two models?

Fe, this paper (link to paper) used martingale residuals for visual inspection, and a partial likelihood ratio test to compare a model with linear terms and a model using fractional polynomials.

Kind regards,
Linda

1 Like

it would surely be covered in Frank Harrell’s book but i don’t have it to hand. I know i have seen in practice people simply add quadratic or cubic terms and look at the change in -2logL or akaike’ information (aic). The only reason for doing a formal test i guess is if you must pre-specify in an analysis plan, then you can state clearly what the criterion will be

I’ll just add that often a log transformation does not fit well enough, which is why it’s usually better to fit a flexible function such as a restricted cubic spline function and be done with it. Testing for “significance” of the added nonlinear terms leads to temptation, i.e., removing the terms, which can ruin p-values and confidence limits. Plot the fitted curve to interpret it.