MixedModels.jl icon indicating copy to clipboard operation
MixedModels.jl copied to clipboard

Multinomial / Categorical Outcomes

Open rodonn opened this issue 6 years ago • 8 comments

Is this package able to fit Multinomial Logistic Regression models or any other type of model with categorical/multiple discrete outcomes?

These types of models often come up when you need to choose one option out of a finite set of alternatives. They are very similar to binary logistic regression, except that the probabilities are given by the 'softmax' formula: $exp(X_j * Beta) / (1 + \sum_k X_k * Beta)$ rather than the $exp(X_j * Beta) / (1 + exp(X_j Beta))$ in a binary model.

Thanks!

rodonn avatar Apr 15 '18 21:04 rodonn

Not directly. It is possible that it could be modified to do so but I don't really know enough about this model to make such modifications.

dmbates avatar Apr 16 '18 15:04 dmbates

Thanks. I'm looking into how difficult it would be for me to make the modifications. Is the approach in MixedModels similar to what you describe in the lme4 theory documentation?

rodonn avatar Apr 20 '18 17:04 rodonn

You could use part of the code in Econometrics.jl. That one has multinomial logistic regression. I will work on adding dispatch for ordinal logistic regression too.

Nosferican avatar Aug 14 '18 20:08 Nosferican

You could use part of the code in Econometrics.jl. That one has multinomial logistic regression. I will work on adding dispatch for ordinal logistic regression too.

Any update on adding ordinal logistic regression?

spinkney avatar Sep 21 '19 11:09 spinkney

Econometrics.jl has ordinal logistic regression. However, it doesn't support mixed models so it is a simple proportional odds logistic regression. See the example.

Nosferican avatar Sep 21 '19 15:09 Nosferican

For multinomial models, you can achieve something similar by moving the response-categories to the predictors side. If you're trying to predict responses, you have to do a post-processing step to see what the probability is for each response, but that's relatively straightforward.

palday avatar Sep 27 '19 13:09 palday

For mlogit/ologit in Econometrics.jl,

fitted(model) # Fitted values
predict(model) # Predicted probabilities

Nosferican avatar Sep 27 '19 15:09 Nosferican

I've marked this as "big future", but it might make more sense as a spin-off package, much like clmm in R uses lme4 internally but all of the extra multinomial bits are not in lme4. Lean, focused packages are the Julian way.

palday avatar Feb 11 '21 18:02 palday