drizopoulos / JM

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

Error in FUN(X[[i]], ...) : subscript out of bounds #25

Closed BenGoudsmit closed 2 years ago

BenGoudsmit commented 3 years ago

Dear prof,

In a large dataset (8081 patients, 69594 measurements) aucJM (JM:::aucJM.jointModel) keeps giving the error below, but if I change Tstart or Tstop slightly, it does work. My data is complete, sorted on id and time of measurement, I have no events on t=0. Why does it give this error?

AUC90d_base <- aucJM(JM_spline_valslope, longtestsurv, Tstart = 0.0001, Thoriz = 92/365.25, idVar = "id")

Error in FUN(X[[i]], ...) : subscript out of bounds

traceback()

3: lapply(X = X, FUN = FUN, ...)
2: sapply(pi2$summaries, "[", 1, 2)
1: aucJM(JM_spline_valslope, longtestsurv, Tstart = 1e-04, Thoriz = 92/365.25, 
       idVar = "id")

The JM is speficied as:

survFit <- coxph(Surv(tyrs, binstatus) ~ age10 + femalegender + cluster(id),
                 data = survtrain, x = TRUE)

lme_splines <- lme(score~ ns(labyrs, df=3)* (age10 + femalegender),
                   random= list(id = pdDiag(form= ~ns(labyrs, df=3))), data=longtrain)

dform = list(fixed = ~ 0 + dns(labyrs, df=3) + dns(labyrs,df=3):age10 +dns(labyrs,df=3):femalegender,
             random = ~ 0 + dns(labyrs, df=3),
             indFixed = c(2:4,7:12), indRandom = c(2:4)) 
#JM
JM_spline_valslope <- jointModel(lme_splines, survFit, timeVar = "labyrs",
                                     method = "spline-PH-aGH", param = "both", derivForm = dform)
drizopoulos commented 3 years ago

Do you have a longitudinal measurement (i.e., for score) per patient at t = 0?

From: Ben notifications@github.com Sent: Tuesday, November 17, 2020 4:16 PM To: drizopoulos/JM JM@noreply.github.com Cc: Subscribed subscribed@noreply.github.com Subject: [drizopoulos/JM] Error in FUN(X[[i]], ...) : subscript out of bounds (#25)

Dear prof,

In a large dataset (8081 patients, 69594 measurements) aucJM (JM:::aucJM.jointModel) keeps giving the error below, but if I change Tstart or Tstop slightly, it does work. My data is complete, sorted on id and time of measurement, I have no events on t=0. Why does it give this error?

AUC90d_base <- aucJM(JM_spline_valslope, longtestsurv, Tstart = 0.0001, Thoriz = 92/365.25, idVar = "id")

Error in FUN(X[[i]], ...) : subscript out of bounds

traceback()

3: lapply(X = X, FUN = FUN, ...)

2: sapply(pi2$summaries, "[", 1, 2)

1: aucJM(JM_spline_valslope, longtestsurv, Tstart = 1e-04, Thoriz = 92/365.25,

   idVar = "id")

The JM is speficied as:

survFit <- coxph(Surv(tyrs, binstatus) ~ age10 + femalegender + cluster(id),

             data = survtrain, x = TRUE)

lme_splines <- lme(score~ ns(labyrs, df=3)* (age10 + femalegender),

               random= list(id = pdDiag(form= ~ns(labyrs, df=3))), data=longtrain)

dform = list(fixed = ~ 0 + dns(labyrs, df=3) + dns(labyrs,df=3):age10 +dns(labyrs,df=3):femalegender,

         random = ~ 0 + dns(labyrs, df=3),

         indFixed = c(2:4,7:12), indRandom = c(2:4))

JM

JM_spline_valslope <- jointModel(lme_splines, survFit, timeVar = "labyrs",

                                 method = "spline-PH-aGH", param = "both", derivForm = dform)

— 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%2F25&data=04%7C01%7Cd.rizopoulos%40erasmusmc.nl%7C1123fe6922a34022b9df08d88b0bbf18%7C526638ba6af34b0fa532a1a511f4ac80%7C0%7C0%7C637412229847615192%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=MXXonQvsAs%2BDFZgMgS%2Bla7eBpcvxrvXdEnMgtdSB67I%3D&reserved=0, or unsubscribehttps://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FADE7TT33253ELC24Q3STBQLSQKHUNANCNFSM4TYWPPWA&data=04%7C01%7Cd.rizopoulos%40erasmusmc.nl%7C1123fe6922a34022b9df08d88b0bbf18%7C526638ba6af34b0fa532a1a511f4ac80%7C0%7C0%7C637412229847620173%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=UXc%2BltRrnkC4SltJwr0ZKQCBOB7PQiBgyYokG7wGwW8%3D&reserved=0.

BenGoudsmit commented 3 years ago

yes, each patient starts at t=0 years with a measurement.

drizopoulos commented 3 years ago

And, do you have events between Tstart and Thoriz?

From: Ben notifications@github.com Sent: Tuesday, November 17, 2020 9:04 PM To: drizopoulos/JM JM@noreply.github.com Cc: D. Rizopoulos d.rizopoulos@erasmusmc.nl; Comment comment@noreply.github.com Subject: Re: [drizopoulos/JM] Error in FUN(X[[i]], ...) : subscript out of bounds (#25)

yes, each patient starts at t=0 years with a measurement.

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fdrizopoulos%2FJM%2Fissues%2F25%23issuecomment-729170141&data=04%7C01%7Cd.rizopoulos%40erasmusmc.nl%7C01579af07c364f35d49b08d88b33f227%7C526638ba6af34b0fa532a1a511f4ac80%7C0%7C0%7C637412402514750591%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=lDuVrFHf1XvryEuqHjDeo5h7oVrUFgkKv9III8jR6GA%3D&reserved=0, or unsubscribehttps://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FADE7TT2FQBIRRWUGN4W3VL3SQLJLRANCNFSM4TYWPPWA&data=04%7C01%7Cd.rizopoulos%40erasmusmc.nl%7C01579af07c364f35d49b08d88b33f227%7C526638ba6af34b0fa532a1a511f4ac80%7C0%7C0%7C637412402514750591%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=B42Aq%2B9pWiR1R13AB94%2B2gngsRPEX4xlMK5FNEnSvCc%3D&reserved=0.

BenGoudsmit commented 3 years ago

yes, the first occurring event is at t=0.00273 years (0.99 days). above I set the Thoriz at 90 days.