# Problem in multilevel (hierarchical) multinomial logistic regression (with brms)

**URL:** <https://discourse.mc-stan.org/t/problem-in-multilevel-hierarchical-multinomial-logistic-regression-with-brms/40882>\
**Category:** Modeling\
**Tags:** brms\
**Created:** [January 30, 2026, 1:04pm UTC](https://discourse.mc-stan.org/t/problem-in-multilevel-hierarchical-multinomial-logistic-regression-with-brms/40882 "2026-01-30T13:04:52Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![JohnKruschke](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/johnkruschke/32/21245_2.png) [@JohnKruschke](https://discourse.mc-stan.org/u/JohnKruschke)\
**Post date:** [February 3, 2026, 5:35pm UTC](https://discourse.mc-stan.org/t/problem-in-multilevel-hierarchical-multinomial-logistic-regression-with-brms/40882/10 "2026-02-03T17:35:59Z")

</div>

Thanks again to @mattansb for the detailed replies. Thanks also to the other responders in this thread.

I’ve now worked through a variety of related examples (not posted), and have come to this conclusion:

When the predict **ed** variable is categorical (named `resp` in a matrix of counts) and the predict **or** is categorical (named `group`), the most robust\[1\] approach in brms is

`formula = resp | trials(n) ~ 0 + group` for non-hierarchical (suppressing the intercept with `~ 0 +` makes it easier to specify the prior — this was not featured in any of the examples),  
`formula = resp | trials(n) ~ 1 + (1 | group)` for hierarchical,  
_both with_  
`family = multinomial(link = logit, refcat = NA)` (yes, that’s `NA` for `refcat`) _and a (moderately) informed prior_. Check that the prior is really doing what you intend.

The approach I proposed, using a dummy reference category, also seems to work pretty well! But it introduces subtle symmetric effects that have not yet been thoroughly characterized (@mattansb referred to it as a form of regularization).

Thanks again to all!

* * *

1. By “robust” I mean not introducing asymmetries across response categories, mathematically clear, and reasonable execution time.

---

_[View the full topic](https://discourse.mc-stan.org/t/problem-in-multilevel-hierarchical-multinomial-logistic-regression-with-brms/40882)._
