drizopoulos / JMbayes2

Extended Joint Models for Longitudinal and Survival Data
https://drizopoulos.github.io/JMbayes2/
79 stars 23 forks source link

Error when running 'predict()' according to the example in competing risk vignette #12

Closed mikoSL closed 2 years ago

mikoSL commented 2 years ago

Thank you for the great work/article published on 2021-12-19.

When running the example according to this article,

predLong <- predict(jFit_CR, newdata = ND, return_newdata = TRUE,
                    times = seq(6.5, 15, length = 25))
predEvent <- predict(jFit_CR, newdata = ND, return_newdata = TRUE,
                     process = "event")

It shows Error in split.default(x, g) : first argument must be a vector

According to the discussion in JMbayes, performing dynamic predictions from a competing risk mvJMbayes object is not supported, I am very excited that it is implemented in JMbayes2, it would be so wonderful to run through the example code and apply it with other data later.

BTW, JMbayes2 version I used is 0.1.8. Thank you very much for your time.

drizopoulos commented 2 years ago

Is this with the most recent version from GitHub, i.e., JMbayes2_0.1-85?

mikoSL commented 2 years ago

It is same with this issue. Close it and follow the discussion of this issue.

mikoSL commented 2 years ago

Thank you very much for the hint.

I have installed the latest version from Github, in Rstudio, with packageVersion('JMbayes2'), it shows 0.1-85.

When run jm(),

jFit_CR <- jm(CoxFit_CR, list(fm1, fm2), time_var = "year", 
              functional_forms = CR_forms, 
              n_iter = 25000L, n_burnin = 5000L, n_thin = 5L)

It shows the following error:

OMP: Error #13: Assertion failure at kmp_csupport.cpp(492).
OMP: Hint Please submit a bug report with this message, compile and run commands used, and machine configuration info including native compiler and operating system versions. Faster response will be obtained by including all program sources. For information on submitting this issue, please see https://bugs.llvm.org/.

OMP: Error #13: Assertion failure at kmp_csupport.cpp(492).
OMP: Hint Please submit a bug report with this message, compile and run commands used, and machine configuration info including native compiler and operating system versions. Faster response will be obtained by including all program sources. For information on submitting this issue, please see https://bugs.llvm.org/.
Error in unserialize(node$con) : error reading from connection

@Rochelle1995, what is your result?

Rochelle1995 commented 2 years ago

installed too, and runs without any problem on mine..However, I noticed something. In the cumulative risk part of the plot, it is not clear which event the curves belong to. I think a legend can solve this problem. Also, there is no CI bands in longitudinal part, despite CI_long=TRUE. Thanks...

drizopoulos commented 2 years ago

I cannot reproduce this error. I guess it has to do with your installation of Rcpp and RcppArmadillo.

mikoSL commented 2 years ago

@Rochelle1995 I checked all commits, then found the commit on Dec 17th,2021 was the change for version 0.1-85, I installed with remotes::install_github("drizopoulos/JMbayes2@8d6f6f86eafc847a1dfd0b75fe6e2768b5192063") But due to the error I had, there might be a better way to install the latest version in github.

Could you please share how you installed it?

Rochelle1995 commented 2 years ago

I didn't do anything different. I followed the commands on the site. I just didn't have rtools installed, r asked for it, I installed..

mikoSL commented 2 years ago

It was the problem of gfortran, fixed it according to this link. Now the code runs successfully. Thank you all for help!