I have recently realised that the way I thought the multinom function in nnet was running is not actually the way it is coded. I have looked high and low for information on how the models are actually created with regards to baseline, continuous etc. I thought it worked on the baseline method, by creating a reference category, and then comparing the different categories to the reference one by one, but this is not the case, as several of my model should have been over determined but they are not. The vignette doesn't help, and I have spent a long time scouring the net for information. Does anyone know exactly how it works?
Asked
Active
Viewed 2,259 times
3
-
Many years ago, I found that it got different estimates to my own implementation (and my own implementation was fitting the data better). I appreciate that this is not a lot to go on, but I am just confirming that in my view it is not a great algorithm. – Tim Mar 02 '17 at 06:42
-
Below we use the multinom function from the nnet package to estimate a multinomial logistic regression model. There are other functions in other R packages capable of multinomial regression. We chose the multinom function because it does not require the data to be reshaped (as the mlogit package does) and to mirror the example code found in Hilbe’s Logistic Regression Models http://stats.idre.ucla.edu/r/dae/multinomial-logistic-regression/ Does this help? – Ferdi Mar 02 '17 at 07:26
-
@Ferdi Thanks for the link. I have seen that one. Unfortunately it doesn't go into enough depth. Basically I need something that outlines the degrees of freedom for the model A parameter that is annoyingly not returned in this program. I have run it on a couple of other functions and am finding similar coefficients, but with much larger degrees of freedom than expected. Hence the head scratching. – PeteKaz Mar 02 '17 at 09:17
-
@PeteKaz. Okay, here is one more link which treats the baseline issue. http://data.princeton.edu/wws509/notes/c6s2.html The most indepth package for multinomial logits is the **mlogit** package. Alternatively you can have a look at other multinomial classifiers such as multinomial probit, neural net and naive bayes. – Ferdi Mar 02 '17 at 09:41
-
1@Ferdi Cheers mate. I may have to switch to the mlogit package. I was just trying to avoid having to re-do a couple hundred lines of code. The burning question is.....what is multinom using, because it can't be baseline. I thought it was, but it just can't be. – PeteKaz Mar 02 '17 at 10:58
-
Type into the RConsole 'nnet::multinom' and you will see the source code. It includes an if-loop for each level a Hessian matrix and a cummulative product. – Ferdi Mar 02 '17 at 12:22