I have a response variable with four categories, I meant to make the first to be a reference category. I analyzed the category using Lasso in R (glmnet package). The lasso uses a more symmetric approach rather than the traditional K-1 parameterization. So at the Output will show the lasso coefficient for all four categories of my response. I wanted my Lasso analysis to show only three categories, as I mentioned earlier, I want to use the first category as reference.

This is my code for finding the coefficient of Multinomial Logistic Regression using lasso:

cvfit = cv.glmnet(X,Y,type.measure="class",alpha=1,family="multinomial")
coef(cvfit, s = "lambda.min")

My question is, how can I modify my code so that the coefficient present the K-1 parameterization as the common Multinomial Logistic Regression mode?

Any help would be appreciated. I'll be even more thank full if you add the code.

  • $\begingroup$ why do you want to do that? Something is telling me that the coefficients might not be as meaningful if they are all against the reference category. But if you really want to do that, just run 3 binary logistic regressions against your reference. $\endgroup$ – rep_ho Sep 28 '17 at 8:41
  • $\begingroup$ Well my thesis use 2 methods: Common Multinomial and Lasso. In common multinomial, it used reference category. My professor want me to present both in K-1. By the way, if I used 3 binary logistics, does it mean that I must remove some of my data before analyzing? $\endgroup$ – Hafid W. Ramadhan Sep 29 '17 at 1:57
  • $\begingroup$ if you just want to use multinomial logistic regression, that trains k-1 models, you can use nnet package and multinom function (i think), but that is without lasso regularization. $\endgroup$ – rep_ho Oct 2 '17 at 13:02

Glmnet uses Poisson likelihood to do multinomial logistic regression, so it generates coefficients that differ from what you expect. A good explanation of how to transform the coefficients back to the more conventional form is in section 6.2.5 of this.

| cite | improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.