0

I am doing a projects using glmnet package and have hard time to interpret the result.

The scenario as follows.

There are 7 variables x1, ..., x7.
x3, ... , x7 are scaled to mean 0 and std 1.

I fit a Lasso regression on x3, ... , x7. Lasso selects some variables.

Then I fit a Lasso regression on all variables, i.e., x1, ..., x7, Lasso selects intercept only.

I do not know why this happened and how to fix it.

ikop
  • 1,760
  • 1
  • 12
  • 24
Stella Hu
  • 353
  • 5
  • 9
  • 1
    It would be easier to help you if you provide a [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example). But this sounds more like a model fitting question would might be appropriate for [stats.se]. – MrFlick May 31 '17 at 04:26
  • The selection is conditional on a specific value for the penalty. Are you using the same value for the two setups? – ekstroem May 31 '17 at 06:39
  • @MrFlick Thank you for your advice. I post the same question to cross validated. – Stella Hu May 31 '17 at 15:27
  • @ekstroem No. I used cv.glmnet to fit model, then used lambda.1se to get the estimation of the coefficients. The lambdas chosen are different in the two models. – Stella Hu May 31 '17 at 15:30
  • i think your answer might be here : https://stats.stackexchange.com/questions/319861/how-to-interpret-lasso-shrinking-all-coefficients-to-0 – piaHZERA Jul 14 '21 at 22:29

0 Answers0