R中Cox模型的似然比检验
有人知道似然比检验吗,比如lmtest包中的lrtest,它适用于使用coxph生成的cox比例风险模型?lrtest似乎不适用于coxph模型R中Cox模型的似然比检验,r,cox-regression,R,Cox Regression,有人知道似然比检验吗,比如lmtest包中的lrtest,它适用于使用coxph生成的cox比例风险模型?lrtest似乎不适用于coxph模型 谢谢默认情况下,LR测试由thr生存软件包的coxph()返回(见最后一行): require(生存) test1在pkg:survival中有一个anova.coxph,它允许比较模型对象 fit <- coxph(Surv(futime, fustat) ~ resid.ds *rx + ecog.ps, data = ovarian) f
谢谢默认情况下,LR测试由thr生存软件包的
coxph()
返回(见最后一行):
require(生存)
test1在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
fit在上述情况下,哪个模型是空模型?谢谢。我把模型1称为“基本”模型。我保留术语“空模型”用于那些在RHS上只有“截距”的模型。在这种情况下,模型2(=fit
)具有由交互作用形成的额外项,在resid.ds
和rx
都不是基本因子水平的情况下,该项为1。
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