drizopoulos / JM

Joint Models for Longitudinal & Survival Data under Maximum Likelihood
34 stars 7 forks source link

“aeqSurv exception, an interval has effective length 0” #19

Closed agstone90 closed 3 years ago

agstone90 commented 4 years ago

Hi Dr. Rizopoulos,

Like a few of the commentors below, I am having an issue with getting my joint model to run, receiving an error "Error in aeqSurv(Y) : aeqSurv exception, an interval has effective length 0"

My survival object uses the survreg function with weeks as my unit of time.

lmefit<-lme(marker~ns(week,3),random=~week|ID, data=Data,control=lmeControl(opt="optim")) survfit<-survreg(Surv(time,status)~covariate,data=Data.id,x=TRUE) fitjoint<-jointModel(lmefit,survfit,timeVar="week")

I haven't been able to get any of the fixes listed here to work. The issue doesn't seem to be one of 2 weeks vs 2.0 weeks. Entering "timefix=FALSE" into the survreg call gets an error for an unused argument, and adding aeqSurv(survfit, tolerance = sqrt(.Machine$double.eps)) returns an error that survfit isn't a Surv object.

Any advice for how to get my model to run would be very appreciated!

Thanks!

drizopoulos commented 4 years ago

Have you tried to use coxph instead of survreg?

—— Dimitris Rizopoulos Professor of Biostatistics Erasmus University Medical Center The Netherlands


From: agstone90 notifications@github.com Sent: Friday, August 28, 2020 3:15:20 AM To: drizopoulos/JM JM@noreply.github.com Cc: Subscribed subscribed@noreply.github.com Subject: [drizopoulos/JM] “aeqSurv exception, an interval has effective length 0” (#19)

Hi Dr. Rizopoulos,

Like a few of the commentors below, I am having an issue with getting my joint model to run, receiving an error "Error in aeqSurv(Y) : aeqSurv exception, an interval has effective length 0"

My survival object uses the survreg function with weeks as my unit of time.

lmefit<-lme(marker~ns(week,3),random=~week|ID, data=Data,control=lmeControl(opt="optim")) survfit<-survreg(Surv(time,status)~covariate,data=Data.id,x=TRUE) fitjoint<-jointModel(lmefit,survfit,timeVar="week")

I haven't been able to get any of the fixes listed herehttps://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fstackoverflow.com%2Fquestions%2F46988426%2Ferror-in-aeqsurvy-aeqsurv-exception-an-interval-has-effective-length-0&data=02%7C01%7Cd.rizopoulos%40erasmusmc.nl%7C53c45118febc4b99f6e708d84aefd569%7C526638ba6af34b0fa532a1a511f4ac80%7C0%7C0%7C637341741220342748&sdata=l%2BiPngHbcuCSzGPV9Fu%2BHfbR6PRHu7DWxj7BfelRtG4%3D&reserved=0 to work. The issue doesn't seem to be one of 2 weeks vs 2.0 weeks. Entering "timefix=FALSE" into the survreg call gets an error for an unused argument, and adding aeqSurv(survfit, tolerance = sqrt(.Machine$double.eps)) returns an error that survfit isn't a Surv object.

Any advice for how to get my model to run would be very appreciated!

Thanks!

— 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%2FJM%2Fissues%2F19&data=02%7C01%7Cd.rizopoulos%40erasmusmc.nl%7C53c45118febc4b99f6e708d84aefd569%7C526638ba6af34b0fa532a1a511f4ac80%7C0%7C0%7C637341741220352741&sdata=U5fr%2FmoKfsFgm2JCfXRIsanO13MjwKjRASSU2qxb0R4%3D&reserved=0, or unsubscribehttps://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FADE7TT5NNC6KUFZOCU44WYLSC4AKRANCNFSM4QNS2HDQ&data=02%7C01%7Cd.rizopoulos%40erasmusmc.nl%7C53c45118febc4b99f6e708d84aefd569%7C526638ba6af34b0fa532a1a511f4ac80%7C0%7C0%7C637341741220352741&sdata=wUfqs2mEp6T8JbBCooupub7BS9W6uZxETjGq1%2Bnawv4%3D&reserved=0.

agstone90 commented 4 years ago

Hi Dr Rizopoulos,

Thank you so much for responding! It does seem to be running now that I've switched to coxph. Is there a reason that one should work and not the other? Given a time-independent covariate, would both produce the same model?

jinjinzhou commented 1 year ago

Even tried coxph model, I still have this error

rberch commented 1 year ago

Hi @jinjinzhou, please, did you find a solution to this? I have run into a similar situation. Thanks

jinjinzhou commented 1 year ago

Hi @jinjinzhou, please, did you find a solution to this? I have run into a similar situation. Thanks

For my situation, it is related to how I bin my longitudinal markers, i.e., some of them were measured on the same day or even more frequently. I filtered those when Tstart-stop < threshold

rberch commented 1 year ago

Hi @jinjinzhou, please, did you find a solution to this? I have run into a similar situation. Thanks

For my situation, it is related to how I bin my longitudinal markers, i.e., some of them were measured on the same day or even more frequently. I filtered those when Tstart-stop < threshold

Thank you @jinjinzhou ,

In my case, I am doing a simulation study. I simulate the longitudinal data and survival data (which has the ID, event status, and follow-up time) using simsurv. And then when I fit the linear mixed model and coxph, they run without errors. However, when I run the jointModel, that is when I get the error: Error in aeqSurv(Y) : aeqSurv exception, an interval has effective length 0 I have searched online for possible solutions but I have not found any.

mariellabogoni commented 1 year ago

@rberch Did you find a solution? I have the same problem. Thank you!