Dear all, I’m very new to brms and stats in general but I want to know it it’s possible to do ‘one vs rest’ polytomous regression using BRMS, as so far I’ve only been able to do multinomial regression using the syntax:
brm(response ~ var1 + var2, data = data, family = ‘categorical’)
My response is a categorical variable with three levels and with this syntax I only get to see the the effects on two of the response levels against the reference level. I’d like to do ‘one vs the rest’ where the model uses each level as the reference level in turn and then gives you the results for all.
If I follow, there are several ways to do this with brm() models. To me, one of the better ways is with the tidybayes::compare_levels() function, which you can learn about here.
Also, it looks like this is your first post. Welcome to the Stan forums, @tj_1995!
I think I was actually just overcomplicating things and you can actually just compare the coefficients of the non reference levels by working out the difference between them relative to the reference level. Does that make sense?
If you have y \sim \text{categorical}(\theta) for y \in \{ 1, \ldots, N \} and \theta \in \Delta^{N-1} an N-1-dimensional simplex (meaning it’s N non-negative values that sum to 1), then you can work out all the marginals directly. If you want to set \text{logit}(\theta_1) = 0 as is traditional, you can work out what the other log odds are relative to that. You can do this for any variable or subset of variables, e.g., \Pr[y \in A] = \sum_A \theta_a.