I am fitting a joint longitudinal and time to event model on production data with the aim of making dynamic predictions of the time of assembly of a machine. I am using JMbayes R package.
Among the time-dependent variables in the longitudinal part of the model I have a dummy variable that tells whether the mechanical part of the assembly is finished or not, this variable is 0 up to a certain time point, thereafter it becomes one from the time the mechanical part is completed to the time of the event (the assembly has been completed). So basically it is a one step function.
Now I am fitting a binomial(link="logit") longitudinal model for this variable using time fixed effect and a random effect for the order number related to the machine being assembled. I am linking this longitudinal model to the time event component using the "current value" association.
The idea is that if I complete the mechanical part of the assembly ahead of the historical average, it is likely that the total time of assembly will be lower, coversely if I spend much more time, it is likely that it will be higher.
I am sure this is not the right way to include this kind of variable in the model, both in modelling it in the longitudinal part of the model without taking into account that this is a binary step function over time monotone non-decreasing, and also for the way I linked it to the time component i.e. using the current value association, since the impact of the value of this variable depends on time: its value is always 0 during the first days of assembly and only from a certain time onwards it is informative.
Could you help me correct the model definition?