In this article by Terry Therneau 2016, to address time-varying effect,


Testing proportional hazard assumption:

vfit <- coxph(Surv(time,status) ~ trt + prior + karno, data = veteran)
zp <- cox.zph (vfit, transform=function(time) log(time+20)

Extended Cox model addressing time-varying effect:

vfit3 <- coxph (Surv(time,status) ~ trt + prior + karno + tt(karno),
              data = veteran, 
              tt = function (x,t, ...) x*log(t+20))

I am concerned with usage of log(t+20) that author used in both analyses (testing assumption and addressing time-varying effect). why using specifically log(t+20) rather than just log(t) which is commonly used by some people (I think)?

*Something I would like to add, not directly related to my post question:

I strongly suggest someone with rep above 300 add a new tag "time-varying-coefficients" (only "time-varying-covariates" exist, but the two are different and very important to distinguish them). With appropriate 'tag' make post efficiently be searched. Thanks in advance.*


On page 19, the authors said:

"The time scale for the cox.zph plot used further above of $\log(t + 20)$ was chosen to make the first 200 days of the plot roughly linear."

t is survival time. $\log(t) = - \infty $ as $t \rightarrow 0$. So I think it is another reason to have +20 there so that the value of the function will not be close to large negative number. In fact you can construct the function of survival time as you like and suitable to the data.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.