Closed alhbiostat closed 2 years ago
Try JMbayes2
From: alhbiostat @.> Sent: Tuesday, November 30, 2021 2:06 PM To: drizopoulos/JMbayes @.> Cc: Subscribed @.***> Subject: [drizopoulos/JMbayes] rocJM and aucJM error when run using mvJointModelBayes model (Issue #89)
Waarschuwing: Deze e-mail is afkomstig van buiten de organisatie. Klik niet op links en open geen bijlagen, tenzij u de afzender herkent en weet dat de inhoud veilig is. Caution: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.
I'm struggling to get aucJM and rocJM to work with a multivariate joint model generated using mvJointModelBayes. I have two longitudinal measures that I have run jointModelBayes, aucJM and rocJM on independently (the latter two across a range of Tstart and Thoriz timepoints), which has worked fine, but evidently there is something the matter with the combined data frame of longitudinal measures used for mvJointModelBayes and provided asnewdata that aucJM/rocJM function does not approve of.
The joint model is as follows:
coxfit.mixed <- coxph(Surv(time = as.numeric(end.timepoint), event = status) ~ 1, data = mixedmod.surv , model = TRUE)
mixed.mod <- mvglmer(formulas = list(log(measure1) ~ ns(Days_since, df = 2) + (1|ID),
log(measure2) ~ ns(Days_since, df = 2) + (1|ID)),
data = mixedmod.data, families = list(gaussian,gaussian))
jointFit.mixed <- mvJointModelBayes(mixed.mod, coxfit.mixed, timeVar = "Days_since")
This all works fine and I get a summary output from jointFit.mixed
I then endeavour to generate the ROC to compare with the univariate models as so: rocJM(jointFit.mixed, newdata = mixedmod.data, idVar = "ID", Tstart = 14, Thoriz = 60)
and get the simplistic but highly uninformative error: Error in tmp[[i]] : subscript out of bounds Traceback:
Error in tmp[[i]] : subscript out of bounds
unlist(tmp[[i]])
unname(unlist(tmp[[i]]))
survfitJM.mvJMbayes(object, newdata = newdata2, idVar = idVar, survTimes = Thoriz, M = M)
survfitJM(object, newdata = newdata2, idVar = idVar, survTimes = Thoriz, M = M)
aucJM.mvJMbayes(jointFit.mixed, newdata = FERR.CRP.hosp, idVar = "CV_ID", Tstart = 14, Thoriz = 60)
aucJM(jointFit.mixed, newdata = FERR.CRP.hosp, idVar = "CV_ID", Tstart = 14, Thoriz = 60)
Only about 1/3 of the two measures were taken at the same timepoint (i.e. there is missing data for one or the other at most timepoints), but using only the common intersection doesn't help. I have read that ties in the time points may be problematic, so I have tried removing duplicate time points across samples, or offsetting them by a small amount, but this also doesn't help. I have plenty of data points falling before 14 days. The function will run if I subset small sections of my dataframe but I can't figure out why. Is there something I am missing here??
Any help would be much appreciated!
- You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fdrizopoulos%2FJMbayes%2Fissues%2F89&data=04%7C01%7Cd.rizopoulos%40erasmusmc.nl%7C9b93b25e00f442cbbbfa08d9b40229fd%7C526638ba6af34b0fa532a1a511f4ac80%7C0%7C0%7C637738743647520819%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=Kw9VaZMAYHM0XvzhWiyhyN42mA0h7kh1xonTT%2B5wH7g%3D&reserved=0, or unsubscribehttps://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FADE7TT2YOCAQFMLOR2M6O63UOTD3VANCNFSM5JBYMINA&data=04%7C01%7Cd.rizopoulos%40erasmusmc.nl%7C9b93b25e00f442cbbbfa08d9b40229fd%7C526638ba6af34b0fa532a1a511f4ac80%7C0%7C0%7C637738743647530782%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=JkF%2B7znzJTUpvIPADUYTmQhkDNHqgmzrGLhSZGXKbM8%3D&reserved=0.
I'm struggling to get
aucJM
androcJM
to work with a multivariate joint model generated usingmvJointModelBayes
. I have two longitudinal measures that I have runjointModelBayes
,aucJM
androcJM
on independently (the latter two across a range ofTstart
andThoriz
timepoints), which has worked fine, but evidently there is something the matter with the combined data frame of longitudinal measures used formvJointModelBayes
and provided asnewdata
thataucJM
/rocJM
function does not approve of.The joint model is as follows:
This all works fine and I get a summary output from
jointFit.mixed
I then endeavour to generate the ROC to compare with the univariate models as so:
rocJM(jointFit.mixed, newdata = mixedmod.data, idVar = "ID", Tstart = 14, Thoriz = 60)
and get the simplistic but highly uninformative error: Error in tmp[[i]] : subscript out of bounds Traceback:
Only about 1/3 of the two measures were taken at the same timepoint (i.e. there is missing data for one or the other at most timepoints), but using only the common intersection doesn't help. I have read that ties in the time points may be problematic, so I have tried removing duplicate time points across samples, or offsetting them by a small amount, but this also doesn't help. I have plenty of data points falling before 14 days. The function will run if I subset small sections of my dataframe but I can't figure out why. Is there something I am missing here??
Any help would be much appreciated!