# How to set up and estimate a multinomial logit model in R?

I ran a multinomial logit model in JMP and got back results which included the AIC as well chi-squared p-values for each parameter estimate. The model has one categorical outcome and 7 categorical explanatory vars.

I then fit what I thought would build the same model in R, using the multinom function in the nnet package.

The code was basically:

fit1 <- multinom(y ~ x1+x2+...xn,data=mydata);
summary(fit1);


However, the two give different results. With JMP the AIC is 2923.21, and with nnet::multinom the AIC is 3116.588.

So my first question is: Is one of the models wrong?

The second thing is, JMP gives chi-squared p-values for each parameter estimate, which I need. Running summary on the multinom fit1 does not - it just gives the estimates, AIC and Deviance.

My second question is thus: Is there a way to get the p-values for the model and estimates when using nnet::multinom?

I know mlogit is another R package for this and it looks like its output includes the p-values; however, I have not been able to run mlogit using my data. I think I had the data formatted right, but it said I had an invalid formula. I used the same formula that I used for multinom, but it seems like it requires a different format using a pipe and I don't understand how that works.

Thanks.

-
You can set the argument Hess=TRUE to get the Hessian back from multinom and then calculate the p-values manually. But I suggest you use the mlogit library (nnet can have convergence issues when the covariates are not scaled correctly). The vignettes for mlogit are pretty good, and should help you get your data set up correctly. The vignettes can be found at the usual place: cran.r-project.org/web/packages/mlogit – Jason Morgan Apr 18 '11 at 23:26

You could also try running a multinomial logit using the glmnet package. I'm not sure how to force it to keep all variables, but I'm sure it's possible.

-