Brms model with a level of "random effect" set to zero?

Can a brms model include “random effect” terms like \beta_Z where
\beta_0 \equiv 0
\beta_1,...,\beta_M \sim N(0, \sigma)

(1 | Z) would be \beta_0,\beta_1,...,\beta_M \sim N(0, \sigma)

(-1 + Z_is_not_0 | Z) would be \beta_Z I(Z \ne 0) where \beta_0,\beta_1,...,\beta_M \sim N(0, \sigma), and \beta_0 wouldn’t be in the likelihood ?

Yep, the trick you posted should work well as long as you’re using 0 + Intercept syntax, rather than the implicitly centered design matrix that brms otherwise uses.

1 Like

thanks !

if I want the model to have no intercept (at the population-level, not just per “random effect”), I had been using -1 + but how would that syntax be combined with the 0 + Intercept syntax you propose ? would it be just 0 + ?

1 Like

Pretty sure you should be fine then, but paging @paul.buerkner to be absolutely certain:

If the user excludes the intercept with -1 + ... does this turn off the design matrix centering in the same way as excluding the intercept with 0 + ...?

In the mean time @shira I’m confident you should get what you want if you replace your -1 + with 0 + , and just don’t include the special Intercept term.


Yes, -1 and 0 work the same in R formulas.


Question for @jsocolar and @paul.buerkner:

In the brms formula documentation, it looks like the design-matrix centering is only for the population-level ? Would Z_is_not_0 in my above (-1 + Z_is_not_0 | Z) be centered, given that it is a group-level covariate ?

Thanks so much !