I am new to Stan and brms but do have experience in lme4, mgcv etc. and “classical” R packages. With
lmer() model one can do this:
With mgcv one can specify similar ranef structure.
How can this be achieved with brms? Using
... + lf(sigma ~ 0 + TrialOrder) + ... is not exactly the same .
Hi there! Welcome to the Stan forum! :)
Did you try using the
lme4 syntax in brms? I think it should work.
And it did! Thanks! I have found the bug in my code as I (wrongly) did this:
While I actually wanted this:
Duplicated group-level effects are not allowed
But I still cannot wrap my head around some details in how and what you can do with ranefs. Could you recommend something to help me grasp what these two puppies are doing (I am making generic examples here):
lf(sigma ~ 0 + X1)
Hey! Glad it worked! :)
I’m not quite sure, but I think the only difference of
(1|p|RECORDING_SESSION_LABEL) is that the latter allows the random effects to be correlated across regression functions (when you are modelling multi-outcome regressions). The correlation (matrix) is captured by
p or whatever name you put there.
edit: I you consider one of my answers as solution to your question please mark it as solution. This helps us see which threads needs attention and it helps that look for solutions. Thanks! :)