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?