I tried to fit survival model with several variables violating proportional hazard assumption. I read following vignette thoroughly, but cannot get satisfactory answers for my case. (https://cran.r-project.org/web/packages/survival/vignettes/timedep.pdf).
Qestion 1. Is it okay to do step function for multiple variables, like followings.
vet2 <- survSplit(Surv(time, status) ~ ., data= veteran, cut=c(90, 180),episode= "tgroup", id="id")
fit <- coxph(Surv(tstart, time, status) ~ trt + prior +
karno:strata(tgroup) + added_var1:strata(tgroup) + added_var2:strata(tgroup), data=vet2)
Actually in my case, there are 4 variables that violate the proportional hazard assumption.
Question 2. Tyring to use time-transform ( tt() ) in time-dependent coefficient model, but cannot konw what is the right way to use it. Vignette clearly says tt() is defined like
tt = function(x, t, ...) x * log(t+20)
But, I'm not sure what is correct way to describe relationship between time and variable of my case. (variables violating proportional hazard assumption are certain disease states (ex. diabetes, hypertension..) and type of surgery the patient received)
Look forward help!
Based on comment from IRTFM, I modified my questions. (Specifically, clarified Question 2 and erased Question 3 about default time-transformation.)