联合建模:R中JM包中的错误

问题描述

我正在使用R包“ JM”来尝试为事件数据创建一个联合模型纵向时间,但是它会抛出错误消息。这是我对联合模型的首次尝试,并且提供了有关如何拟合模型的指南:

library("JM")
library("lattice")

aids.id <- aids[!duplicated(aids$patient),]

lmeFit.aids <- lme(CD4 ~ obstime + obstime:drug,random = ~ obstime | patient,data = aids)

coxFit.aids <- coxph(Surv(Time,death) ~ drug,data = aids.id,x = TRUE)

jointFit.aids <- jointModel(lmeFit.aids,coxFit.aids,timeVar = "obstime",method = "piecewise-PH-aGH")

我将此应用于自己的数据,而我的代码就是

df = read.csv('survival_data.csv')
sortID <- c('ID','Year') 
df <- df[do.call('order',df[sortID]),]
df.id <- df[!duplicated(df$ID),]

df.id$status <- as.numeric(df.id$status != 'No')

lm = lme(y ~ Year + Year:Education.level,random = ~Year | ID,data = df)

cx = coxph(Surv(time,status) ~ Education.level,data = df.id,x = TRUE)

jm = jointModel(lm,cx,timeVar = 'Year')

,我收到以下错误消息:

Error in jointModel(lm,timeVar = "Year") : 
it seems that there are longitudinal measurements taken after the event times for some subjects (i.e.,check subject(s): 223725,813285,956765,1114525,1587125,1697285,1833965,2292285,2817245,3564565,3705325,4454005,4626045,4626725,4853165,68002045,68002725,68021765,68021769,68035365,68058485,68058489,68060525,68060533,68060537,68064605,68064609,68084329,68095205,68095209,68095889,68097245,68097249,68133285,68133289,68133969,68136005,68136009,68136013,68136685,68137365,68138045,68159125,68159129,68159805,68159809,68160485,68160489,68160497,68292405,68295125,68297845,68297849,68297853,68301245,68320285,68320965,68320969,68348165,68367209,68367213,68382845,68382849,68383525,68383529,68427045,68427729,68429089,68429765,68429769,68432489,68433165,68433169,68439285,68439289,68439965,68440645,68441325,68481445,68481449,68567805,68568485,68569165,68569169,68569173,68569845,68570525,68570529,685712

有人可以解释此错误的含义吗?事件发生后如何检查数据是否具有纵向测量?此处用作示例的数据可以找到here

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...