我正在尝试使用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"))当我在没有frailty参数的情况下估计模型时,它工作得很好。但是当我包含它时,我得到了以下错误:
Error in if (any(ord > 1)) stop("Penalty terms cannot be in an interaction") :
missing value where TRUE/FALSE needed有没有人能解释一下我哪里错了?
致以敬意,
J
发布于 2015-04-15 23:40:36
我也有同样的问题,但最终意识到脆弱这个词是相加的!也就是说,它不应该在逗号之后,而应该在加号之后。
因此,将您的代码更改为以下代码应该可以解决问题:
Altman <- coxph(Surv(Tstart, Tstop, to == 2) ~ wWCTA + wRETA + wEBITTA + wMETL + wSTA + frailty(x=id, distribution= "gamma"), data=Multistate, subset = from == 1)https://stackoverflow.com/questions/23688701
复制相似问题