# How to fit Multinomial Logistic Regression using Lasso into K-1 in R? [closed]

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:

library(glmnet)
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.

• 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. – rep_ho Sep 28 '17 at 8:41
• 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? – Hafid W. Ramadhan Sep 29 '17 at 1:57
• 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. – rep_ho Oct 2 '17 at 13:02