2
$\begingroup$

I'm considering using LASSO regression for variable selection in R using the "lars" package. One of the arguments in this package "normalizes" the variables so their coefficients can be examined on the same scale by the lars package (If TRUE, each variable is standardized to have unit L2 norm, otherwise it is left alone). With this automated normalization, I'm not sure how my data are being normalized. If I don't normalize the variables, the package selects for variables with high values instead of adjusting the variables equally (my data span five orders of magnitude and are all positive).

My question is this: Is there a transformation that I can use before inputting my data into the lars package so that the algorithm examines the variables equally and I can back calculate to apply the coefficients to make my model with the raw values of the data?

$\endgroup$
2
$\begingroup$

The LARS algorithm has been superseded by the cyclical gradient descent algorithm implemented in the glmnet package. There is a nice vignette here explaining how to fit a LASSO (which is the default in the glmnet function). You can also fit a ridge regression (alpha=0) or elastic net (alpha between 0 and 1) which is useful when you have very correlated data, because the Lasso will only select one predictor out of a set of very correlated features.

The glmnet function standardizes your data by default and then returns the coefficients on the original scale.

For more background and some examples of these models, I suggest the Introduction to Statistical Learning book by James, Witten, Hastie and Tibshirani.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.