MNLogit summary not printing information for first category?

55 views
Skip to first unread message

Todd Anderson

unread,
Dec 13, 2017, 7:33:46 PM12/13/17
to pystatsmodels
I'm doing a MNLogit on a dataset where the category to be predicted has the value 1, 2, or 3.  However, when I print the summary of the model, only information for categories 2 and 3 are printed.  What should I do to print the information on category 1 as well?

thanks,

Todd

josef...@gmail.com

unread,
Dec 13, 2017, 7:48:15 PM12/13/17
to pystatsmodels
On Wed, Dec 13, 2017 at 6:59 PM, Todd Anderson <drto...@comcast.net> wrote:
I'm doing a MNLogit on a dataset where the category to be predicted has the value 1, 2, or 3.  However, when I print the summary of the model, only information for categories 2 and 3 are printed.  What should I do to print the information on category 1 as well?

No, we need one level or category or choice as a reference level. As in Logit, there is exactly one selection from the set of choices per event. As a consequence the probability of selecting the different choices has to add up to one.
Because of this aggregation constraint, we loose one category and need to pick one as reference level. The probability for the reference category is one minus the sum of probabilities for the other categories or choices.

In Logit as special case we only have one set of paramaters for one of the choices, and the other category is the reference level.

The same happens in count model like binomial or variants of multinomial models with more than one choice per event/observation if we condition on the total number of counts in a trial or the total number of choices in an event. 
(It does not happen in Poisson because there the total number of counts is a random variable and we don't have a fixed aggregation constraint.)

Josef


 

thanks,

Todd

Todd Anderson

unread,
Dec 14, 2017, 12:41:25 AM12/14/17
to pystatsmodels
I'm not so interested in actually predicting with the model than seeing which features are relevant to the model.  What I am seeing is that all the features have P|z| < 0.05 for category 3 but there are some features for category 2 that are greater than 0.05.  I'd like to see the coefficients, std err, P|z| for the reference level you describe.  Very new at this so thanks for your response and please forgive my ignorance.

josef...@gmail.com

unread,
Dec 14, 2017, 1:05:04 AM12/14/17
to pystatsmodels
On Thu, Dec 14, 2017 at 12:41 AM, Todd Anderson <drto...@comcast.net> wrote:
I'm not so interested in actually predicting with the model than seeing which features are relevant to the model.  What I am seeing is that all the features have P|z| < 0.05 for category 3 but there are some features for category 2 that are greater than 0.05.  I'd like to see the coefficients, std err, P|z| for the reference level you describe.  Very new at this so thanks for your response and please forgive my ignorance.

There are no coefficients for the reference level. Those are implicitly defined.
The adding up constraint is not just for prediction, it's a basic property of the model and specified this way for the likelihood function that is maximized.

The estimated parameters for category 2 and 3 are relative to the reference category, i.e. the first. IIRC the estimated coefficient are the log-odds-ration of category 2, resp. 3, with the reference category.

What you could do is specify a different reference category if it helps in interpreting the results. (AFAIR, it stil cannot be chosen in the Model and needs to be done by  renaming the category levels or choices for alphanumerical sorting.)

Maybe it would be helpful for you to go through some multinomial Logit tutorials that explain a bit the definition of the model and background. 

Josef

Todd Anderson

unread,
Dec 14, 2017, 1:54:35 AM12/14/17
to pystatsmodels
I've done quite a bit of reading and watching videos.  I started with sklearn's LogisticRegressionCV and for that I get coefficients for all the categories (I think).  Is that because one or the other of these is doing one-vs-rest style and the other one is doing something different?  If you could suggest some document suitable for a newbie I'd appreciate it!  

thanks
Reply all
Reply to author
Forward
0 new messages