3

In R, I am fitting a model using the multinom() function from the nnet package. There is only 1 response variable and there are >2 classes. When I have a model with >3 classes, there's an error that says there are too many weights, so I'm using 3 classes: 0, 1, and 2 (categorical variables). The output from multinom() is stored in model.

Before, when I used 2 classes, summary(model)$coefficients returned a vector of numeric coefficients. When I used 3 classes, summary(model)$coefficients returned a matrix with two rows of coefficients: one for class '1' and one for class '2'. So I'm looking to learn how multinomial logistic regression works. Why do class 1 and 2 have separate sets of coefficients? Does it run logistic regression using class 0 vs 1 and for class 1 vs 2? What about class 0 vs 2? If it compares them all, where are the coefficients for all 3C2 comparisons, instead of just for 2 comparisons?

Tim
  • 108,699
  • 20
  • 212
  • 390
user149050
  • 31
  • 1
  • 2
  • 1
    Since this is about interpreting the coefficients, rather than getting the code to run, I think it might be on-topic here. – Matt Krause Feb 13 '17 at 17:17
  • It would help if you could paste in your output & be more specific regarding what you need help interpreting. As it is, I think you just need a general overview of multinomial logistic regression. – gung - Reinstate Monica Feb 13 '17 at 17:42
  • I think you will find the information you need in the linked thread. Please read it. If it isn't what you want / you still have a question afterwards, come back here & edit your question to state what you learned & what you still need to know. Then we can provide the information you need without just duplicating material elsewhere that already didn't help you. – gung - Reinstate Monica Feb 13 '17 at 17:43

1 Answers1

5

Basically, logistic regression works in terms of log odds of one class ("success") given another ("failure") that servers as a "default" class and translates them to probability using inverse of logit function. Multinomial regression is an extension of logistic regression to case of $K>2$ classes. It works in terms of log odds of some class given some other "default" class. This means that when using multinomial regression we focus on pairwise relations with the "default" class. So for $K$ classes we need $K-1$ sets of linear predictors, since we are looking at $K-1$ comparisons between classes. Yes, this means that we are ignoring other pairwise relations and assume that they are irrelevant given the relation with the "default" class.

Tim
  • 108,699
  • 20
  • 212
  • 390