# How to model multinomial data with uneven numbers of options between items

**URL:** https://discourse.mc-stan.org/t/how-to-model-multinomial-data-with-uneven-numbers-of-options-between-items/15456
**Category:** brms
**Tags:** specification, rstan
**Created:** [May 28, 2020, 9:27pm UTC](https://discourse.mc-stan.org/t/how-to-model-multinomial-data-with-uneven-numbers-of-options-between-items/15456 "2020-05-28T21:27:44Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Canaan\_Breiss](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/canaan_breiss/32/6694_2.png) [@Canaan\_Breiss](https://discourse.mc-stan.org/u/Canaan_Breiss)
#### Post date: [May 28, 2020, 9:27pm UTC](https://discourse.mc-stan.org/t/how-to-model-multinomial-data-with-uneven-numbers-of-options-between-items/15456/1 "2020-05-28T21:27:44Z")

</div>

Hi, I’m interested in modeling (using brms, ideally, or if not, something custom in rstan) multinomial count data, but I have data which a) I have reason to believe are influenced by the same / very similar factors, but b) have different outcome options.

For example, I have two kinds of items, call them A and B. Items of type A could have outcomes A1, A2, A3, and A4; however B items only have B1, B2, and B6 (another category distinct from the A categories) as possible outcomes. I have reason to believe that the data generating process — that is, whether an A item is realized as A1, A2, etc. — makes reference to the same factors / are influenced by the same predictors in both A and B items, and so therefore would like to model them using the same set of underlying variables (and also the same subjects gave responses for A and B type items), but since there are a different number of categories between A and B, not all of which overlap, I’m not sure the best way to go about trying to do this in the same model. Any advice / tips? Alternately, if this is a trivial problem / isn’t relevant here, any suggestions on where to look for answers? Thanks!

---

<div class="post-metadata">

### Author: ![p-gw](https://avatars.discourse-cdn.com/v4/letter/p/dec6dc/32.png) [@p-gw](https://discourse.mc-stan.org/u/p-gw)
#### Post date: [May 29, 2020, 8:04am UTC](https://discourse.mc-stan.org/t/how-to-model-multinomial-data-with-uneven-numbers-of-options-between-items/15456/2 "2020-05-29T08:04:53Z")

</div>

I find your questioin a bit hard to answer with the information you provided, but you could look at some kind of polytomous IRT model (e.g. the [Polytomous Rasch Model](https://en.wikipedia.org/wiki/Polytomous_Rasch_model)). I imagine these models are what you are looking for.

Since you stated that you have two item types A and B I would probably start with a Rating Scale Model (assuming the outcome categories are ordered) with a different set of threshold parameters for each item type. I do not know if brms can handle different number of outcome categories, but it can certainly be done in Stan itself. If programmed in Stan the model probably requires some custom indexing of the parameter vector, since there are no ragged data structures. This can be a bit of a pain sometimes, but shouldn’t be too bad if you only have 2 item types with fixed threshold parameters.

---

<div class="post-metadata">

### Author: ![Canaan\_Breiss](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/canaan_breiss/32/6694_2.png) [@Canaan\_Breiss](https://discourse.mc-stan.org/u/Canaan_Breiss)
#### Post date: [May 29, 2020, 8:08am UTC](https://discourse.mc-stan.org/t/how-to-model-multinomial-data-with-uneven-numbers-of-options-between-items/15456/3 "2020-05-29T08:08:44Z")

</div>

Hi Paul,  
Thanks for your response - to be more specific, the categories are not ordered and there are maybe 12 categories of item (A, B, C,…). So i think what you’re saying about jagged categories makes sense, but potentially in an unordered context? If there’s a name for that kind of model.  
Thanks!

---

<div class="post-metadata">

### Author: ![p-gw](https://avatars.discourse-cdn.com/v4/letter/p/dec6dc/32.png) [@p-gw](https://discourse.mc-stan.org/u/p-gw)
#### Post date: [May 29, 2020, 8:17am UTC](https://discourse.mc-stan.org/t/how-to-model-multinomial-data-with-uneven-numbers-of-options-between-items/15456/4 "2020-05-29T08:17:20Z")

</div>

You can take a look at the Nominal Response Model.

---

<div class="post-metadata">

### Author: ![Canaan\_Breiss](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/canaan_breiss/32/6694_2.png) [@Canaan\_Breiss](https://discourse.mc-stan.org/u/Canaan_Breiss)
#### Post date: [May 29, 2020, 5:48pm UTC](https://discourse.mc-stan.org/t/how-to-model-multinomial-data-with-uneven-numbers-of-options-between-items/15456/5 "2020-05-29T17:48:05Z")

</div>

Great, thanks!

---

<div class="post-metadata">

### Author: ![Canaan\_Breiss](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/canaan_breiss/32/6694_2.png) [@Canaan\_Breiss](https://discourse.mc-stan.org/u/Canaan_Breiss)
#### Post date: [May 29, 2020, 8:27pm UTC](https://discourse.mc-stan.org/t/how-to-model-multinomial-data-with-uneven-numbers-of-options-between-items/15456/6 "2020-05-29T20:27:19Z")

</div>

Actually, @p-gw, I read @paul.buerkner’s paper on Bayesian IRT (which seems to be the nearest bayesian resource to Nominal Resposne Modeling, as you suggested), but unfortunately it didn’t cover what to do with ragged categories / nominal data from a range of categories with unequal outcome numbers. Sorry to bother, but would you and/or Paul be able to give a small example on how to do this? Thanks!

---

<div class="post-metadata">

### Author: ![paul.buerkner](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/paul.buerkner/32/3303_2.png) [@paul.buerkner](https://discourse.mc-stan.org/u/paul.buerkner)
#### Post date: [May 30, 2020, 8:18am UTC](https://discourse.mc-stan.org/t/how-to-model-multinomial-data-with-uneven-numbers-of-options-between-items/15456/7 "2020-05-30T08:18:55Z")

</div>

You are asking for conditional logit models I think. There is a (workaroundy) implementation of this in brms, but it requires lots of manual specification: [https://github.com/paul-buerkner/brms/issues/560](https://github.com/paul-buerkner/brms/issues/560)

Also, rstanarm has a stan\_clogit function that might be of help.
