JuliaStats / MixedModels.jl

A Julia package for fitting (statistical) mixed-effects models
http://juliastats.org/MixedModels.jl/stable
MIT License
402 stars 47 forks source link

Multinomial / Categorical Outcomes #124

Open rodonn opened 6 years ago

rodonn commented 6 years ago

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!

dmbates commented 6 years ago

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.

rodonn commented 6 years ago

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?

Nosferican commented 6 years ago

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.

spinkney commented 4 years ago

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?

Nosferican commented 4 years ago

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.

palday commented 4 years ago

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.

Nosferican commented 4 years ago

For mlogit/ologit in Econometrics.jl,

fitted(model) # Fitted values
predict(model) # Predicted probabilities
palday commented 3 years ago

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.