Huge difference between vglm () and polynomial () for mlogit

I am doing a multi-minimal logistic regression model for a dataset iris,

library(VGAM)
mlog1 <- vglm(Species ~ ., data=iris, family=multinomial())
coef(mlog1)

and coefficients:

 (Intercept):1  (Intercept):2 Sepal.Length:1 Sepal.Length:2  Sepal.Width:1 
     34.243397      42.637804      10.746723       2.465220      12.815353 
 Sepal.Width:2 Petal.Length:1 Petal.Length:2  Petal.Width:1  Petal.Width:2 
      6.680887     -25.042636      -9.429385     -36.060294     -18.286137 

Then I use the function multinom()and do the same:

library(nnet)
mlog2 <- multinom(Species ~ ., data=iris)

Odds:

Coefficients:
           (Intercept) Sepal.Length Sepal.Width Petal.Length Petal.Width
versicolor    18.69037    -5.458424   -8.707401     14.24477   -3.097684
virginica    -23.83628    -7.923634  -15.370769     23.65978   15.135301

There seems to be a big gap between the two results? Where am I wrong? How can I fix them and get a similar result?

+4
source share
1 answer

: (1) multinomial() VGAM , multinom() nnet . (2) , . , , , .

, - (1994-2002 .) AER:

data("GSOEP9402", package = "AER")
library("nnet")
m1 <- multinom(school ~ meducation + memployment + log(income) + log(size),
  data = GSOEP9402)
m2 <- vglm(school ~ meducation + memployment + log(income) + log(size),
  data = GSOEP9402, family = multinomial(refLevel = 1))

:

coef(m1)
##                (Intercept) meducation memploymentparttime memploymentnone
## Realschule   -6.366449  0.3232377           0.4422277       0.7322972
## Gymnasium   -22.476933  0.6664295           0.8964440       1.0581122
##            log(income) log(size)
## Realschule   0.3877988 -1.297537
## Gymnasium    1.5347946 -1.757441

coef(m2, matrix = TRUE)
##                     log(mu[,2]/mu[,1]) log(mu[,3]/mu[,1])
## (Intercept)                 -6.3666257        -22.4778081
## meducation                   0.3232500          0.6664550
## memploymentparttime          0.4422720          0.8964986
## memploymentnone              0.7323156          1.0581625
## log(income)                  0.3877985          1.5348495
## log(size)                   -1.2975203         -1.7574912
+6

Source: https://habr.com/ru/post/1584733/


All Articles