简体   繁体   English

使用R包“生存”的多状态生存分析

[英]Multistate Survival Analysis using R package “Survival”

I am trying to estimate Cox proportional hazards model for transition from state 1 to state 2 using R survival package as follows: 我正在尝试使用R survival包估算从状态1到状态2的Cox比例风险模型,如下所示:

Altman <- coxph(Surv(Tstart, Tstop, to == 2) ~ wWCTA + wRETA + wEBITTA + wMETL + 
            wSTA, data=Multistate, subset = from == 1, 
          frailty(x=id, distribution= "gamma"))

When I am estimating the model without the frailty argument, its working fine. 当我估计没有frailty论证的模型时,它的工作正常。 But when I am including it, I am getting the following error: 但是当我包含它时,我收到以下错误:

Error in if (any(ord > 1)) stop("Penalty terms cannot be in an interaction") : 
missing value where TRUE/FALSE needed

Can anyone please explain where I am going wrong? 任何人都可以解释我哪里出错了吗?

Regards, 问候,

J Ĵ

I had the same problem but eventually realized that the frailty term is additive! 我有同样的问题,但最终意识到脆弱的术语是附加的! That is, it shouldn't come after a comma but after a plus. 也就是说,它不应该在逗号之后但是在加号之后。

Changing your code to the following should thus solve the problem: 因此,将代码更改为以下内容可以解决问题:

Altman <- coxph(Surv(Tstart, Tstop, to == 2) ~ wWCTA + wRETA + wEBITTA + wMETL + wSTA + frailty(x=id, distribution= "gamma"), data=Multistate, subset = from == 1)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM