Cox regression – time dependent effects

New Member
I have developed a multivariable Cox model including variables associated with mortality using Stata 14.1. I identified a time dependent effect between individuals with the highest (ctn2) and lowest (ctn0) concentrations of a biomarker and hazards of death. I would be grateful for any advice on how to assess which would be the most appropriate function of time (linear or log time etc.) for the time dependent effect.

A significant interaction was obtained if either a linear function of time or log(time) was used in the tvc command. I also split the follow-up time to estimate hazard ratios for different time periods. I compared this output with the hazard ratios estimated from the models including the time dependent effects for each function of time.

The hazard ratios obtained when splitting the follow up time appear slightly more consistent with those estimated when log(time) is included in the command (rather than just linear time). Is there a better way of identifying the most appropriate function of time for time dependent effects? I copy the commands and relevant output below.

stcox i.labnp ctn1 ctn2 b3.lm hn, nohr shared(ClinicID) tvc (ctn2) texp(_t)
------------------------------------------------------------------------------
_t | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
ctn1 | .5078195 .2661331 1.91 0.056 -.0137919 1.029431
ctn2 | 1.689404 .3628826 4.66 0.000 .9781675 2.400641
-------------+----------------------------------------------------------------
tvc |
ctn2 | -.0815239 .0267994 -3.04 0.002 -.1340497 -.0289981
-------------+----------------------------------------------------------------
The estimated hazard ratio associated with ctn2 (versus ctn0) as a function of time t is: HR(t) = exp(1.69 - 0.082t). So the estimated hazard ratio at the following time points would be:
• 1 month = exp(1.69 – (0.082*1)) = 4.99
• 3 months = exp(1.69 – (0.082*3)) = 4.24
• 6 months = exp(1.69 – (0.082*6)) = 3.31
• 12 months = exp(1.69 – (0.082*12)) = 2.03
stcox i.labnp ctn1 ctn2 b3.lm hn, nohr shared(ClinicID) tvc (ctn2) texp(logt)
------------------------------------------------------------------------------
_t | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
ctn1 | .511123 .2657851 1.92 0.054 -.0098063 1.032052
ctn2 | 1.954976 .4158998 4.70 0.000 1.139827 2.770125
-------------+----------------------------------------------------------------
tvc |
ctn2 | -.5647133 .1653178 -3.42 0.001 -.8887303 -.2406963
-------------+----------------------------------------------------------------
The estimated hazard ratio associated with ctn2 (versus ctn0) as a function of time log(t) is: HR(t) = exp(1.95 – 0.5647(log(t)). So the estimated hazard ratio at the following time points would be:
• 1 months = exp(1.95 – (-0.5647*(log1))) = 7.03
• 3 months = exp(1.95 – (-0.5647*(log3))) = 3.78
• 6 months = exp(1.95 – (-0.5647*(log6))) = 2.56
• 12 months = exp(1.95 – (-0.5647*(log12))) = 1.73
stsplit tperiod, at(0 1 3 6 9 12)
tab tperiod, m
gen ctnq_0=0
replace ctnq_0 =1 if ctn2==1&tperiod==0
gen ctnq_1=0
replace ctnq_1 =1 if ctn2==1&tperiod==1
gen ctnq_3=0
replace ctnq_3 =1 if ctn2==1&tperiod==3
gen ctnq_6=0
replace ctnq_6 =1 if ctn2==1&tperiod==6
gen ctnq_9=0
replace ctnq_9 =1 if ctn2==1&tperiod==9
gen ctnq_12=0
replace ctnq_12 =1 if ctn2==1&tperiod==12
stcox ctnq_0 ctnq_1 ctnq_3 ctnq_6 ctnq_9 ctnq_12
------------------------------------------------------------------------------
_t | Haz. Ratio Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
ctnq_0 (0 months) | 12.52519 6.117216 5.18 0.000 4.809099 32.6216
ctnq_1 (1 months) | 9.643025 4.143134 5.27 0.000 4.154261 22.38375
ctnq_3 (3 months) | 5.703691 2.161375 4.59 0.000 2.713932 11.98707
ctnq_6 (6 months) | 3.623968 1.708578 2.73 0.006 1.438373 9.130551
ctnq_9 (9 months)| 1.634026 .683593 1.17 0.240 .7197134 3.709866
ctnq_12 (12 months)| 2.767093 .8083588 3.48 0.000 1.560845 4.90555