Why does my Lasso regression show that the lowest error is achieved with 0 variables? I have a data set with n=199 observations and p=149 variables. I've tried to fit a lasso regression for reducing the number of variables in a logistic regression, but when i used it, I got that the best model have 0 variables. I don't know if my variables need to be standarized, or maybe my data set is too small.
My code is:
library(glmnet) 

set.seed(914) ## number for reproducing
modelfitted<-glmnet(independent,dependent, family = "binomial",alpha = 1) #fitting the lasso regresssion
cv.modelfitted <- cv.glmnet(independent, dependent, type.measure = "class",family="binomial") ## C.V. for getting the best lambda.
coef(modelfitted,s=cv.modelfitted$lambda.min )

The output is
49 x 1 sparse Matrix of class "dgCMatrix"
                                              1
(Intercept)                           -0.567521
capturing_times_on_page                .       
times_on_perfil                        .       
times_on_home                          .       
times_on_faq                           .       
times_on_terminos                      .       
times_on_privacidad                    .       
times_on_acerca                        .       
times_on_lugares_de_pago               .       
times_on_blog                          .       
times_on_contacto                      .       
times_on_libro_de_reclamaciones        .       
capturing_time_on_steps                .       
time_on_step1                          .       
time_on_step2                          .       
time_on_step3                          .       
time_on_step4                          .       
time_on_step5                          .       
time_on_subir_fotos                    .       
time_on_confimado                      .       
time_on_reintentar_subir_fotos         .       
amount_changes                         .       
time_changes                           .       
some rows were omitted.


The minimum miss classification error is for when the number of variables is zero. I hope that someone can help me. Why is this happening?
 A: Your choice for the type.measure parameter might be posing a problem. Although classification error is one way to evaluate the cross-validations, a measure based on an all-or-none dichotomy can pose problems. The default, deviance, or AUC might be more useful. It's also possible that your choice of random-number seed was very unlucky; try a few others. Note that standardization is not the problem in your case as you didn't change the default in glmnet, which is to standardize predictor variables (see the manual page).
Another possibility, which you must consider seriously, is that your predictor variables (at least without some non-linear transformations) add nothing useful to the class predictions. The result of your analysis suggests that simply setting the prediction always to be the most frequent class might be the best, as it is correct with probability = 127/199, or 0.638. With 72 cases evidently in your least frequent class, it should be possible to get a LASSO model with 3 or 4 predictors returned, if you really have useful predictors.
