# Logistic regression using Lasso

#### noetsi

##### Fortran must die
Is there any way to do this?

There are many ways to use LASSO in SAS but all assume I think a linear model.

#### GretaGarbo

##### Human
But you have linear model. Add some interaction and square terms if you like. Just try it!

#### hlsmith

##### Less is more. Stay pure. Stay poor.
Why dont you have a linear model? Also, if you do what @GretaGarbo mentioned you need to perform group lasso to ensure it is grabbing dependent variables together.

#### noetsi

##### Fortran must die
I have a logistic regression model. My DV has two levels, 1 and 0. I don't think that is a linear model. My predictors, what GretaGarbo and I have discussed may be linear (they are 4 point Likert data), but the DV is not.

#### GretaGarbo

##### Human
I have a logistic regression model. My DV has two levels, 1 and 0. I don't think that is a linear model.
But of course it is a linear model. It is a generalized linear model. It is a logistic multiple linear regression, like this:

log(p/(1-p)) = beta_0 + beta_1*x_1 + beta_2*x_2

It is linear in the parameter. i.e. the beta:s.

But it has a non-linear link function: the stuff with "log(p/(1-p))". If you solve that equation, that is maninulate it so that you only get "p" on the left hand side, then you will get:

p = (exp(beta_0 + beta_1*x_1 + beta_2*x_2))/(1 + exp(beta_0 + beta_1*x_1 + beta_2*x_2))

If you plot that curve against x_1 (let x_2 be a constant) you will get an S-shaped curve.

You can check if the factor levels of x_1 are approximately on a line:

log(p/(1-p)) = beta_0 + factor(x_1)_i + beta_2*x_2

Anyway, it will maybe be a good enough approximation.

#### noetsi

##### Fortran must die
Thanks GretaGarbo, I always think of linear models as ones that have interval DV I never think of logistic regression as linear, but I understand your point.

But my original point remains. SAS's documentation says that its LASSO function was not designed for Logistic regression results. I will try to find some examples of their comments.

#### GretaGarbo

##### Human
says that its LASSO function was not designed for Logistic regression results.
I just google searched a few of these words and found this.

But don't make it complicated. If Lasso is to complicated at the moment so drop it. Do some linear regressions and choose a model.

#### jamesmartinn

##### Member
I think HPGENSELECT will accomplish LASSO for Logistic Regression (and other GLMz)