I am using a time-varying covariate to represent subjects that can enter and leave groups at arbitrary times. Because group membership is not fixed, I posit that the true time-to-event is more accurately represented by cumulative hazard rates than by survival estimates.
The calculation of hazard rates has the interpretation of the number of events per unit time among those at risk, while survival estimates imply some probability of an event among a fixed cohort of subjects moving forward in time. Intuitively, I cannot describe what a survival curve is measuring when group membership is changing; the probability of an individual in a group surviving to the next time point given prior survival to the current time point seems unsupportable.
Do cumulative hazard rates have an advantage for these reasons?
If not, what is the interpretation of a survival curve in the presence of a time-dependent covariate?
library(dplyr) library(survminer) library(survival) set.seed(42) id <- rep(c(1:10), 100) n <- length(id) event <- rbinom(n, 1, 0.5) group <- sample(c(1,2),n, TRUE) time <- abs(rnorm(n,0,1)* 10 * group) df <- data.frame(id, event,group, time) df <- df %>% arrange(id) %>% group_by(id) %>% mutate(t0 = lag(time, default = 0, order_by = id), t1 = lead(t0 + time, default = time, order_by = id)) surv.obj <- with(df, Surv(t0, t1, event, type = "counting") ) survfit.obj <- survfit(surv.obj ~ group, df) ggsurvplot(survfit.obj, fun = "cumhaz", df, censor = F) ggsurvplot(survfit.obj, fun = "pct", df, censor = F)