Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
BenGoudsmit opened this issue Nov 17, 2020 · 4 comments
Closed

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

BenGoudsmit opened this issue Nov 17, 2020 · 4 comments

Comments

@BenGoudsmit
Copy link

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
Copy link
Owner

drizopoulos commented Nov 17, 2020 via email

@BenGoudsmit
Copy link
Author

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

@drizopoulos
Copy link
Owner

drizopoulos commented Nov 17, 2020 via email

@BenGoudsmit
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants