问题
I have survival data in this format, with a time-varying exposure to Intervention:
ID start stop status Intervention
1 2 14 0 0
2 2 5 0 0
3 2 3 0 0
3 3 10 1 1
4 5 8 0 0
5 6 10 0 0
For example, for patient ID #3: from day 2 to day 3, the patient has not yet received the intervention (Intervention = 0), but starting on day 3 and lasting until day 10 (when the patient dies), the patient has received the intervention (Intervention = 1).
I thought that I could then estimate the time-varying effect of exposure in the following manner:
coxph (Surv (start, stop, status) ~ Intervention + cluster (ID), data = df.td)
However, I recently found that this method is not correct for right-censored data (Two different results from coxph in R, using same stop and start times, why?). Most basic guides to time-dependent survival analysis use a line like this (for example, as in https://www.emilyzabor.com/tutorials/survival_analysis_in_r_tutorial.html).
Is this method correct for estimating the effect of Intervention on outcome, given the structure of the data?
来源:https://stackoverflow.com/questions/63946293/how-to-do-survival-analysis-in-r-with-time-varying-exposure-to-an-intervention