首页 > 解决方案 > 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, event = status) ~ Intervention, data = df.use)
Call:
coxph(formula = Surv(time = tstart, time2 = tstop, event = status) ~ 
    Intervention, 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 

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

标签: rsurvival-analysissurvival

解决方案


我不相信Surv(time = (tstop - tstart), event = status)等同于 Surv (time = tstart, time2 = tstop, event = status). time和之间的间隔time2不是整个观察,而是已知发生死亡或审查的时间。所以timetime2对于所有死亡事件都相等tstop - tstart

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


推荐阅读