I'm returning to a topic that was addressed by this question a number of months ago.
I have a coxph model that includes a factor covariate (a categorical variable) with three levels.
When I test the model for violations of the proportional hazards assumption using cox.zph, it shows that one of the levels of the factor is in violation of the assumption.
Normally, I would interact the offending covariate with a function of time, but in this case - as I'm dealing with a factor - I'm not sure that this makes sense.
In any case, attempting to interact the factor with a function of time returns an error.
Can you advise on what to do? Is there a way to 'target' the offending factor level with an interaction with time? Thanks.