Solved – How to set up and estimate a multinomial logit model in R

jmplogisticlogitmultinomial-distributionr

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.

Best Answer

Im sure you've already found your solutions as this post is very old, but for those of us who are still looking for solutions - I have found http://youtu.be/-Cp_KP9mq94 is a great source for instructions on how to run a multinomial logistic regression model in R using mlogit package. If you go to the econonometrics academy website she has all the scripts, data for R and SAS and STATA I think or SPSS one of those.

Which kind of explains how/why and what to do about transforming your data into the format of the "long" format vs "wide". Most likely you have a wide format, which requires transformation.

https://sites.google.com/site/econometricsacademy/econometrics-models/multinomial-probit-and-logit-models

Related Question