How to do survival analysis in R with time-varying exposure to an intervention, using Surv and coxph?

有些话、适合烂在心里 提交于 2021-01-07 03:52:29

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!