What is the purpose of adding an interaction with time for a variable that does not meet the proportional hazards assumption? I don't see how it solves the problem. Does it allow the hazard ratio to be estimated, or does it just allow you to keep the variable in the model? I guess if it's the latter, it is a better substitute for stratifying if you have a continuous variable?
1 Answer
If the proportional hazards (PH) assumption isn't met for a predictor, a smoothed plot of its scaled Schoenfeld residuals against time will show how its estimated regression coefficient (log-hazard) changes over time. You might then adapt the model to include an interaction between the predictor and a function of time, a function chosen to match that change of coefficient over time. The R time dependence vignette illustrates that in Section 4, along with the cautions one needs to take to set up that function and the data properly.
That can accomplish two things.
First, it can describe the hazard associated with that predictor more reliably. Otherwise, the fixed-in-time coefficient for that predictor in a PH model will be an average over the events, an average that might hide an important time dependency.
Second, it might improve the estimates of the coefficients for the other predictors in the model. The iterative model-fitting process fits all coefficients together, as it compares each covariate value for the case with an event against the risk-weighted mean of the corresponding values for all cases at risk. With a more realistic model for the hazard over time associated with a predictor that doesn't meet PH, those risk-weighted mean covariate values can become more precise for all covariates.
-
$\begingroup$ You mention including the interaction can describe the hazard associated with that predictor more reliably. But this doesn't mean you can use the hazard ratio for that variable, does it? $\endgroup$– fmtcsCommented Sep 25, 2022 at 17:55
-
$\begingroup$ @fmtcs in that case there is no single, time-independent hazard ratio for that variable. You have to add its time-varying effect to its baseline effect. You can interpret the hazard ratio as it changes over time. The example with a step function for a coefficient in Section 4.1 of the time-dependence vignette shows that the baseline Karnofsky score is only associated with hazard for about the first 2 months. That's a way to "use" a time-varying regression coefficient for a predictor. $\endgroup$– EdMCommented Sep 25, 2022 at 19:45