Closed amirabadiza921 closed 1 year ago
any update?
Do you have a reproducible example? Also, you could try the newer JMbayes2.
Hello there. Just starting with JM and having an issue that seems to be related to the size of the matrixes from the two sbumodels, even though they originate from the same df. Your help would be greatly appreciated.
Here's the error that I get after running JMbayes2:
Error in jointModelBayes(mod_fi_onegroup, cox_fit, timeVar = "week") : sample sizes in the longitudinal and event processes differ.
this is the reprex() {though it differs from the error message above}
mod_fi_onegroup=lme(fi ~ week + one_group, random= ~ week|id, corr=corAR1(form = ~ 1|id), control=lmeControl(opt='optim'), data=fi.long, method="REML", na.action = na.exclude)
cox_fit<-coxph(Surv(age_weeks, censored) ~ one_group + cluster (id), data = fi.long, x=TRUE, model = TRUE)
library(JMbayes2)
joint_ca <- jm(cox_fit, mod_fi_onegroup, timeVar = "week")
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 fit.lm1<-lme(log(TSH_)~time ,random= ~time | code,control=lmeControl(opt="optim"),data=dataLong) summary(fit.lm1) model.cox<-coxph(Surv(Time,DM1)~sex15_1,data=data,x=T,model=TRUE) summary(model.cox) fit.JM<-jointModel(fit.lm1,model.cox,timeVar="time",method ="piecewise-PH-aGH")
Error in d log.hazard + log.survival : non-conformable arrays In addition: Warning message: In wk rep(x$P, each = nk) : longer object length is not a multiple of shorter object length Any advice for how to get my model to run would be very appreciated!
Thanks