I am doing multinomial logistic regression model for iris
data set,
library(VGAM)
mlog1 <- vglm(Species ~ ., data=iris, family=multinomial())
coef(mlog1)
and the coefficients are:
(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 multinom()
function and do the same thing:
library(nnet)
mlog2 <- multinom(Species ~ ., data=iris)
Coefficients:
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
It seems to be a big gap between these two results? Where did I do wrong? How can I fix them and get the similar result?