生存分析 R语言(六)—— Extended and Stratified Cox

Extended Cox Model

extended cox model 是针对部分协变量不满足PHA的情况,在模型中增加那些协变量与时间的interaction项,从而可以考虑了协变量随时间变化的情况。
下面要考虑的是sex不满足PHA时。

library(survival)
anderson=read.table(choose.files(),col.names=c('time','censor','sx','logWBC','trt'))
attach(anderson)
anderson2=survSplit(anderson,cut=8,end='time',event='censor',start='start')
#在t=8处做cut,获得分割后的数据
anderson2$gt=(anderson2$start==8)+0
#heaviside function
detach(anderson)
attach(anderson2)
S=Surv(start,time,censor)
phm_2=coxph(S~sx+trt+logWBC+sx:gt)
summary(phm_2)
#模型中不需要gt项

分割点若有要求则按要求来,没有要求可以考虑均值,作为heaviside function 的节点

Call:
coxph(formula = S ~ sx + trt + logWBC + sx:gt)

  n= 66, number of events= 30 

          coef exp(coef) se(coef)      z Pr(>|z|)    
sx      0.9813    2.6679   0.5412  1.813   0.0698 .  
trt     1.1583    3.1847   0.4719  2.455   0.0141 *  
logWBC  1.5834    4.8713   0.3427  4.620 3.83e-06 ***
sx:gt  -2.1320    0.1186   1.0104 -2.110   0.0348 *  
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

       exp(coef) exp(-coef) lower .95 upper .95
sx        2.6679     0.3748   0.92367    7.7059
trt       3.1847     0.3140   1.26292    8.0307
logWBC    4.8713     0.2053   2.48853    9.5356
sx:gt     0.1186     8.4321   0.01637    0.8592

Concordance= 0.865  (se = 0.039 )
Likelihood ratio test= 52.16  on 4 df,   p=1e-10
Wald test            = 38.25  on 4 df,   p=1e-07
Score (logrank) test = 57.08  on 4 df,   p=1e-11

Stratified Cox Model

stratified cox model也是针对协变量不满足PHA提出的,这里的思想是对不满足PHA的协变量分层,将每个协变量分成两部分,分别是满足PHA的部分和不满足的部分。
协变量的效果在一个层(部分)里是一样的,即层内没有interaction,效果是常数,这就是Non-interaction assumption。
对于”no interaction“的model,每个层的baseline function都不一样,但指数项系数一致;
考虑interaction的模型baseline function h 0 h_0 h0和系数每层都不一样。

phm_si=coxph(S~strata(sx)+trt+logWBC+sx:logWBC+sx:trt)
#strata函数对sx分层
summary(phm_si)
Call:
coxph(formula = S ~ strata(sx) + trt + logWBC + sx:logWBC + sx:trt)

  n= 66, number of events= 30 

            coef exp(coef) se(coef)     z Pr(>|z|)  
trt       0.3113    1.3652   0.5636 0.552   0.5807  
logWBC    1.2061    3.3406   0.5035 2.396   0.0166 *
logWBC:sx 0.5366    1.7102   0.7352 0.730   0.4655  
trt:sx    1.6666    5.2942   0.9295 1.793   0.0730 .
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

          exp(coef) exp(-coef) lower .95 upper .95
trt           1.365     0.7325    0.4524     4.120
logWBC        3.341     0.2993    1.2452     8.962
logWBC:sx     1.710     0.5847    0.4048     7.226
trt:sx        5.294     0.1889    0.8562    32.735

Concordance= 0.797  (se = 0.058 )
Likelihood ratio test= 35.83  on 4 df,   p=3e-07
Wald test            = 21.69  on 4 df,   p=2e-04
Score (logrank) test = 33.15  on 4 df,   p=1e-06

你可能感兴趣的:(生存分析R实现,r语言)