Hi all,
the following seemed like a trivial problem to me, but now I’m not sure anymore: I want to code an ANOVA in BRMS. This is a study with 2 groups of participants, and they each get measured at baseline and then after an intervention (in one group). Some participants miss data for the second measurement.
If I had no missing data, I would have coded the model non-hierarchically - where Ydiff is the difference between the two measurements:
brm(Ydiff ~ 1+ group)
And if I had had more than 2 measurements per person, I would have coded it to allow for individual differences in the intercept and also in the effect of measurement (i.e. ‘time’):
brm(Y ~ 1+ time*group + (1+time | subject))
However, now I’m unsure what to do for the ANOVA case (i.e. exactly two measurements), should I not have the random slopes and/or no random intercept?
[1] brm(Y~ 1+ time*group,data=myData)
[2] brm(Y~ 1+ time*group+(1 | subject),data=myData)
[3] brm(Y~ 1+ time*group+(1+time | subject),data=myData)
[4] brm(Y~ 1+ time*group+(-1+time | subject),data=myData) //i.e. only time varies
In a normal linear model, I can only have either intercept or the slope (time) as varying between subjects, not both. But in BMRS I can fit a model where both are varying. Results are:
- model with intercept and slope varying gives results for group * time that are very similar
- model with only slope varying gives similar results, but much larger credible intervals.
I guess now that I’ve written down all options, it seems like a random decision whether I fix intercept only or slope (time) only - even though asking google it seems that the most common would be to have a random intercept (though then I was not sure it’s just because non-Bayesian models don’t converge otherwise). But also it seems maybe over-parameterized to allow both intercept and slope to vary given that for each person I only have 1 or 2 measurements…
I would be very grateful for any pointers, also to papers/tutorials that explain this. I’ve tried to look this up, but not gotten very far.
Many thanks
Jacquie