Hi All,
I’ve been fitting joint longitudinal models with stan_jm, but wanted to make sure that my model was well-calibrated. I’ve been using simjm (thanks @sambrilleman!) to generate data with known parameter estimates like:
simdata <- simjm(n = 500,
fixed_trajectory = "cubic",
random_trajectory = "linear",
assoc = "etaslope",
return_eta = TRUE)
I’ve then used rstanarm::stan_jm to try and recover the estimates using:
tst_rst <- stan_jm(formulaLong = Yij_1 ~ Z1 + Z2 + poly(tij, degree = 3) + (poly(tij, degree = 3)|id),
dataLong = simdata$Long1,
formulaEvent = Surv(eventtime, status) ~ Z1 + Z2,
dataEvent = simdata$Event,
time_var = "tij",
id_var = "id",
assoc = "etaslope",
basehaz = "weibull",
chains = 4, cores = 4)
Unfortunately, the estimates that stan_jm returns are markedly different (orders of magnitude), especially with respect to the time variable (though estimates for the various coefficients are also slightly off). I’m assuming this is because my stan_jm model is mis-specified relative to how simjm generates the data, but I can’t tell from the documentation for simjm what I might be doing wrong. Any insight you have would be most appreciated.