I have a question about the time-dependent variables in cox model. Supposed that I have three phases and the event may happen in any time and how can I fit these three time-dependent variables, tr1, tr2, tr3, in cox model? The sample dataset is shown below:
tr1 <- c(11.6, 19.04, NA, NA, 10.39, 4.63)
tr2 <- c(63.85, 20.29, NA, NA, 11.64, 7.33)
tr3 <- c(66.51, 22.95, NA, NA, 16.05, 9.11)
if_event <- c(1, 1, 0, 0, 1, 1)
sur_time <- c(125.81, 30.23, 59.27, 161.17, 51.36, 7.52)
income <- c(103844, 57246, 83056, 38380, 37518, 900)
population <- c(10000, 20000, 40000, 88000, 90000, 102034)
dat <- cbind(tr1, tr2, tr3, if_event, sur_time, income, population)
Can I use coxph(Surv(time, event) ~ tr1 * tr2 + tr1 * tr3 + tr2 * tr3, data) to show that time-dependent variables, tr1, tr2 and tr3?
Thanks so much for your kind help.
More details about the dataset:
tr1, tr2 and tr3 are three time-dependent variables since they have the same starting point, that is, tr1 means the time is from 0 to tr1 time, tr2 means the time from 0 to tr2, tr3 means the time from 0 to tr3. When if_event is 1, it shows that the event has happened and look at the record 1, the survival happened after tr3 time; for record 6, the survival happened between tr2 and tr3.
