0

brms: how do I setup a model with multiple categorical variables, so that all levels are present and none are baked into the general intercept?

E.g. suppose we have predictors:

  • gender (2 levels)

  • educ (educational level, 3 levels)

Doing

brm(somey ~ 0 + gender)

seems to allow me to have both levels of gender present as coefficients. However, if I modify this to:

brm(somey ~ 0 + gender + educ)

leads to still having the 2 genders individually, but now one level of educ is baked into the intercept. I'm not sure if this is desirable. I wonder how to have all 3 levels individually present and none baked into intercept.

Doing

brm(somey ~ 0 + gender + 0 + educ)

does not help.


Or put otherwise:

Can I have

\beta_1 x_1 + \beta_2 x_2

rather than

\beta_0 + \beta_1 x_1 + \beta_2 x_2
mavavilj
  • 129
  • 13
  • It's not entirely clear what you are trying to do - could you be looking for the interaction between gender and educ, i.e. the intercept computed each combination of gender and educ? – atmo Jul 21 '22 at 11:46
  • @atmo It's also possible that I'm misapplying the Bayesian models in the sense that maybe all the levels are not meant to be baked into the intercept. OTOH, this may make inferring the models more difficult. With 1 multilevel variable it's easy since one know what's baked into the intercept. But with > 1 multilevel variables the intercept becomes confusing. – mavavilj Aug 23 '22 at 11:53
  • I don't think I can help you beyond referring to Gelmans book: http://www.stat.columbia.edu/~gelman/arm/ – atmo Aug 29 '22 at 09:06

0 Answers0