Double selection lasso in and NA's handling

32 Views Asked by At

I work in a team where everyone uses Stata, and I work in R.

I have created an efficient workflow that allows me to export the results quickly.

The problem I ran into was when implementing the double selection of LASSO. glmnet does not let you work with variables that have missing values. I tried to keep only those variables with complete cases, but doing it with many variables left the data frame without observations. Besides, doing it even with three variables can generate a bias if the missings respond to some particular criterion.

My colleagues use dsregress in State which has a special command in that function to ignore the missings (after fitting lassos, ignoremissingvalues in any othervars not selected, and include these observations in the final model). There is an alternative in R?

0

There are 0 best solutions below