@mluerig This looks like it is almost certainly a bug.
The model you’ve specified uses the default association structure (i.e.
assoc = "etavalue"), meaning that the expected value for
Pigmentation and the expected value for
Length should be included as time-varying covariates in the survival submodel. That would correspond to a model with two association parameters.
But, as we can see from the estimates you’ve plotted, the model is trying to estimate five association parameters! My guess is that the use of the interaction term
Time_num * Food in each longitudinal submodel is being incorrectly handled when I’m forming the model matrices for the association structure; hence there are association parameters shown in the output that correspond to some nonsense interactions that aren’t even in the model you specified.
To try and diagnose whether this might be the issue, can you try fitting the multivariate joint model without the interaction terms in the longitudinal submodel (you only need to run it for a few iterations, say
iter = 20), e.g.
formulaLong = list(
Pigmentation ~ Time_num + Food + (1|Fam_Ind),
Length ~ Time_num + Food + (1|Fam_Ind)
dataLong = mod_data_longi,
formulaEvent = survival::Surv(Time_num, Survival) ~ Food,
dataEvent = mod_data_event,
time_var = "Time_num",
chains = 4, cores=8, seed = 12345, iter = 20)
and then plot the estimates – there should only be two association parameters estimated (called
It the above model returns the appropriate number of parameters, then we can be pretty certain it is the interaction term causing the problem. … Unfortunately I can’t form a reproducible example, even trying to replicate what I perceive to be the issue. If you can show a reproducible example, e.g. using the
pbcSurv dataset, or email me the dataset you are using then that would help me to troubleshoot.
Another thing I noticed in your code is that you have the variable
Time_num specified as both (i) the longitudinal time variable and (ii) the event time variable in the survival submodel. The variable names being the same isn’t an issue in itself, since they are drawn from different datasets. But if those are in fact the same variable, then that is an issue. The variable denoting the time of the event is not the same as the variable denoting the time of the longitudinal measurements.