I am trying to fit a “non-linear” model. Note that it’s not really non-linear, but the goal is to fit a change-score model (a consulting request) with missing values.
Conceptually, what I want is:
outcome ~ alpha + (mi(time2) - mi(time1))*beta. That is - There are missings in time2 and time 1 that I want to model from other predictors; after filling those in, I want to compute a difference score and linearly predict the outcome from it.
The following does not work (because
mi() is not a function in Stan). (Variables changed to be generic).
cs.bf <- brmsformula(outcome ~ alpha + (mi(time2) - mi(time1))*beta,nl=TRUE,beta ~ 1, alpha ~ 1) + brmsformula(time1|mi() ~ z1 + z2) + brmsformula(time2|mi() ~ z1 + z2)
Is there a way to specify this model?