使用相同的停止和开始时间,R中的coxph有两个不同的结果,为什么?

问题描述

我的生存分析遇到了障碍;我认为这与审查类型有关。这是我的生存数据的前30行。 tstart是患者入院并开始接受干预的时间,tstop是死亡(状态= 1)或出院(检查,状态= 0):

    tstart tstop status Intervention
1        2    14      0        FALSE
2        2     5      0        FALSE
3        2    10      1        FALSE
4        5     8      0        FALSE
5        6    10      0        FALSE
6        6    10      0        FALSE
7        7    10      0        FALSE
8        8    20      1         TRUE
9        8    25      0        FALSE
10       8    18      0        FALSE
11       8    11      0        FALSE
12       8     9      0        FALSE
13       9    11      0        FALSE
14       9    52      0         TRUE
15       9    26      1        FALSE
16      10    20      1         TRUE
17      10    14      0        FALSE
18      10    14      0        FALSE
19      10    11      0        FALSE
20      10    23      0         TRUE
21      10    26      0         TRUE
22      10    16      0        FALSE
23      11    21      0         TRUE
24      11    96      0         TRUE
25      11    14      0        FALSE
26      11    16      0         TRUE
27      11    14      0        FALSE
28      11    16      0        FALSE
29      11    16      0        FALSE
30      11    38      1         TRUE

根据我如何将此数据输入到coxph函数中,我得到两个不同的结果。即:

# METHOD ONE:
> coxph (Surv (time = (tstop - tstart),event = status) ~ Intervention,data = df.use)
Call:
coxph(formula = Surv(time = (tstop - tstart),event = status) ~ 
    Intervention,data = df.use)

                     coef exp(coef) se(coef)      z     p
InterventionTRUE -0.05975   0.94200  0.04727 -1.264 0.206

Likelihood ratio test=1.58  on 1 df,p=0.2084
n= 7362,number of events= 2364 

# METHOD TWO:
> coxph (Surv (time = tstart,time2 = tstop,data = df.use)
Call:
coxph(formula = Surv(time = tstart,data = df.use)

                     coef exp(coef) se(coef)      z             p
InterventionTRUE -0.29936   0.74129  0.04902 -6.106 0.00000000102

Likelihood ratio test=35.67  on 1 df,p=0.000000002337
n= 7362,number of events= 2364 

我认为这两种方法会返回相同的风险比,但是结果却截然不同。为什么是这样?如何避免呢?

解决方法

我不认为Surv(time = (tstop - tstart),event = status)等同于 Surv (time = tstart,time2 = tstop,event = status)timetime2之间的间隔并不是整个观察结果,而是已知发生死亡或检查的时间。因此,所有死亡事件的timetime2都等于tstop - tstart

当您不确切知道死亡或审查的时间是多少,但您知道它在两个值之间时,使用间隔。

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...