0

Since I have a lot of explanatory variables, I want to perform a penalized estimation of a multinomial logit model. Using the glmnet package, I would proceede as follows:

library(glmnet)
data(MultinomialExample)

cvfit=cv.glmnet(x, y, family="multinomial", type.multinomial = "grouped", parallel = TRUE)
plot(cvfit)
coef(cvfit, s = "lambda.min")

From other packages that perform the multinomial logit regression, I kow that the output K-1 coefficients for a dependent variable with K levels, since one of them is the so called reference category.

However, coef(cvfit, s = "lambda.min") gives me coefficients for each category, which confuses me:

$`1`
31 x 1 sparse Matrix of class "dgCMatrix"
                       1
(Intercept)  0.015885341
V1           0.051848049
V2          -0.340036374
V3           0.421616900
....

$`2`
31 x 1 sparse Matrix of class "dgCMatrix"
                       1
(Intercept) -0.017214370
V1          -0.329369991
V2          -0.145053512
V3          -0.160609561
.......

$`3`
31 x 1 sparse Matrix of class "dgCMatrix"
                       1
(Intercept)  0.001329029
V1           0.277521942
.......

So basically:

  1. Do you know how to interprete the output?

  2. Do you know how I get the coefficients for category 2 & 3 - assuming that 1 is the reference category?

Jogi
  • 304
  • 4
  • 15

1 Answers1

1

Check out the answer by KH Kim here. His/her code shows how you can go between the output from glmnet and the more usual format from e.g. multinom() from nnet.

jruf003
  • 980
  • 5
  • 19
  • Thanks a lot! With KH Kim I could replicate the coeficcients as well as the probabilities. A question remains - event if it is not stated above - how to obtain summary statistics of the fitted glmnet output: standard error, t-statistic and p-values? In terms of interpretation - what do these coeficients represent? – Jogi Aug 21 '17 at 07:16
  • I believe the package – jruf003 Aug 21 '17 at 09:37
  • I believe the package deliberately doesn't provide p-values etc - further explanation here: https://stackoverflow.com/questions/12937331/why-is-it-inadvisable-to-get-statistical-summary-information-for-regression-coef/17725220. P.S. if my answer helped could you please accept it? – jruf003 Aug 21 '17 at 09:45
  • Many thanks for your help! The references cleared all my questions! – Jogi Aug 21 '17 at 10:16