I was trying out other types of survival models with your example and ran into this issue.
library(JMbayes2)
#> Warning: package 'JMbayes2' was built under R version 4.1.2
#> Loading required package: survival
#> Loading required package: nlme
#> Loading required package: GLMMadaptive
#> Warning: package 'GLMMadaptive' was built under R version 4.1.2
#> Loading required package: splines
# AFT model for the composite event death or transplantation
pbc2.id$status2 <- as.numeric(pbc2.id$status != 'alive')
AFT <- survreg(Surv(years, status2) ~ sex, data = pbc2.id, dist = "loglogistic")
# a linear mixed model for log serum bilirubin
fm1 <- lme(log(serBilir) ~ year * sex, data = pbc2, random = ~ year | id)
# a linear mixed model for the prothrombin time
fm2 <- lme(prothrombin ~ year * sex, data = pbc2, random = ~ year | id)
# a mixed effects logistic regression model for ascites
fm3 <- mixed_model(ascites ~ year + sex, data = pbc2,
random = ~ year | id, family = binomial())
# the joint model that links all sub-models
jointFit <- jm(AFT, list(fm1, fm2, fm3), time_var = "year",
n_iter = 12000L, n_burnin = 2000L, n_thin = 5L)
#> Error in checkForRemoteErrors(val): 3 nodes produced errors; first error: matrix multiplication: incompatible matrix dimensions: 4680x1 and 2x1
summary(jointFit)
#> Error in summary(jointFit): object 'jointFit' not found
I was trying out other types of survival models with your example and ran into this issue.
Created on 2022-02-15 by the reprex package (v2.0.1)