Solved – glmnet, categorical variable, group lasso

categorical datacox-modelglmnetlassosurvival

I am using glmnet for LASSO. My data set contains several continuous variables and one categorical variable (it has four levels). I wondered if I could treat three dummy variables as other continuous variables. Should I use a type of group LASSO approach for the three dummies?

Best Answer

As far as I am aware glmnet doesn't have this feature implemented yet. @Glen_b's suggestion of using type.multinomial is used to group variables across all responses in a multinomial model, but there's no way of grouping independent variables in a model. see

https://cran.r-project.org/web/packages/grplasso/grplasso.pdf

for an alternative.

Related Question