R中Cox模型的似然比检验



>有谁知道似然比检验,如LMTet包中的lrtest,适用于使用Coxph生成的Cox比例风险模型? LRTEST似乎不适用于CoxPh模型。

谢谢

pkg:survival 中有一个anova.coxph,它允许比较模型对象。

fit <- coxph(Surv(futime, fustat) ~ resid.ds *rx + ecog.ps, data = ovarian) 
fit2 <- coxph(Surv(futime, fustat) ~ resid.ds +rx + ecog.ps, data=ovarian)
anova(fit2,fit)
Analysis of Deviance Table
 Cox model: response is  Surv(futime, fustat)
 Model 1: ~ resid.ds + rx + ecog.ps
 Model 2: ~ resid.ds * rx + ecog.ps
   loglik  Chisq Df P(>|Chi|) 
1 -31.970                    
2 -30.946 2.0469  1    0.1525

这是一个 LR 测试。

W.R.T.评论。Cox 回归中的"零模型"将形成,在公式波浪号的 RHS 上只有一个1

fit <- coxph(Surv(futime, fustat) ~ 1, data = ovarian)

LR-Test 默认由 thr 生存包中的 coxph() 返回(见最后一行):

require(survival)
test1 <- list(time=c(4,3,1,1,2,2,3), 
              status=c(1,1,1,0,1,1,0), 
              x=c(0,2,1,1,1,0,0), 
              sex=c(0,0,0,0,1,1,1)) 
# Fit a stratified model 
coxph(Surv(time, status) ~ x + strata(sex), test1) 
Call:
coxph(formula = Surv(time, status) ~ x + strata(sex), data = test1)

   coef exp(coef) se(coef)     z    p
x 0.802      2.23    0.822 0.976 0.33
Likelihood ratio test=1.09  on 1 df, p=0.297  n= 7, number of events= 5 

最新更新