Multinomial logistic regression with categorical family (brms)

Hi everyone, I’m new here and in general new with bayesian statistics and need some help.
I work on R, and I’m quite confortable with frequentist stats in general but bayesian is quite new for me.

-I am doing analyses using a multinomial brm with a categorical family (using package brms). I would like to have some insight on my model, if it makes sense ?
-And I woudl like to understand how the math behind works and how to interpret it ? Because I have 3 categories, and if I understand correctly the model takes the 1st one as reference and compare the 2 other to it.
-So if I want to have insight on all category comparison, I should change the reference level of my response variable and re-run the model ?
-I also have a factor with 3 levels as one of my explanatory variable and I also struggle to be sure of how to interpret the comparison between the different levels.

Here is my model :

mmb1.1 ← brm(newstatus ~ Season + scale_snow + scale_fields + scale_settlements +
Seasonscale_fields + Seasonscale_settlements + (1|Area),
family = categorical(), data = scale_1000, chains = 4,
iter = 4000, warmup = 1000, save_pars = save_pars(all = TRUE),
,backend = “cmdstanr”)

(the factor season has 3 levels)

Thanks,

Romane

Hi Romane, welcome to the forum!

-I am doing analyses using a multinomial brm with a categorical family (using package brms). I would like to have some insight on my model, if it makes sense ?

It makes a lot of sense! For learning about the math behind Bayesian models, I would recommend the book/lecture videos of Statistical Rethinking (McElreath, 2020). To go with that, there is a brms/tidyverse translation of the code from the book done by @Solomon that is excellent if you’re learning how to use brms. Here is the section that goes over multinomial regression.

For these types of models, it’s really important to do some prior predictive simulations to make sure the your assumptions look reasonable to you given your knowledge of what you’re studying. The last time I fit one of these models, all my priors seemed reasonable in isolation but together they were doing some weird things I didn’t/couldn’t anticipate. Here is a short writeup of how to do those with brms and another package called marginaleffects from @vincentarelbundock.

-So if I want to have insight on all category comparison, I should change the reference level of my response variable and re-run the model ?

You don’t need to re-fit the model with difference reference categories, as all the information you need is already there. However, interpreting the summary table is really hard (at least for me). In general, but especially for this type of model, I think it’s way easier to interpret model predictions than the coefficients from the summary table. This can be done using the marginaleffects package, although using plot(conditional_effects() from brms will also work here for getting visualizations of the average probabilities of the levels of newstatus for an average Area.

-I also have a factor with 3 levels as one of my explanatory variable and I also struggle to be sure of how to interpret the comparison between the different levels.

So this is where packages like emmeans and marginaleffects come in handy. They can make those comparisons for you between categories so that you can get the comparisons you need.

References

Arel-Bundock V, Greifer N, Heiss A (Forthcoming). “How to Interpret Statistical
Models Using marginaleffects in R and Python.” Journal of Statistical Software.

Lenth R (2024). emmeans: Estimated Marginal Means, aka Least-Squares Means. R
package version 1.10.2, https://CRAN.R-project.org/package=emmeans.

McElreath, R. (2020). Statistical Rethinking: A Bayesian Course with Examples in R and STAN (2nd ed.). Chapman and Hall/CRC. https://doi.org/10.1201/9780429029608

3 Likes

Hi @romane_ar !

In addition to the wonderful suggestions and advice from @sjp above, I wanted to also recommend this paper by Jeremy Koster and Richard McElreath. They introduce how these models, their “fixed” effects, and even their variance-covariance matrices of the varying effects may be interpreted. They use an animal behavior context for their worked example which may be instructive.

Good luck! Multinomial models are fun, but I agree they can be dense as far as GLMs go!

Miles

2 Likes

Thank you !

Thank you for all these informations it really helps !

I just have a question regarding interpretation of the model with the predictions only.
Because my analyses are for a research paper I would like to have some insight of the significance of the results with the confidence interval. But is it just enough to interpret the predictions with plots ? Because I agree that the summary table is hard to understand and tricky.

Yes, the marginaleffects package can give you credible intervals around the contrasts of interest, and it’s also possible to manage the posterior distribution yourself to get this information.