After determining that my Cox model with a particular covariate (drug) was violating the proportional hazard assumption, I took steps to incorporate a time-dependent continuous coefficient given how I believe my survival time would be best modelled.
Firstly, without modelling time-dependence the cox model yields the following summary in addition to the assessment of the drug covariate:
And as a plot, the drug covariate is not constant over time with respects to Beta (green line is the risk coefficient).
I have a good idea of how the effect the drug covariate should be having on the survival time i.e., this is a time to remission on patients undergoing treatment. Most patients get better sooner rather than later. Therefore, a rough estimate was to use an exponential probability of going into remission. The adjusted model, now with a time-dependent coefficient for Drug looks pretty awesome:
However, when I actually look at the significance, this new model is still suggesting that drug continues to violate the proportional hazard assumption.
Given the above plot, I can't see why drug continues to violate. I would appreciate any thoughts. Perhaps, one thought would be that the leftmost time interval on the Beta vs time plot, doesn't actually fit the drug coefficient which I use an exponential function to model?
Zooming in near time=0 I can see exactly why fitting this particular function did not resolve the issue of correcting a time-dependence covariate.
Sadly, I have no idea to progress from here. We really need this to be time-dependent.
Taking this plot, I cut the survival time at the points at which the beta(t) for drug crossed the coef line (green dashed). I then refit the cox model and tested the coefficients. It appears to work: