1
$\begingroup$

I'm trying to perform LASSO regression on a dataset, and the following 2 photos show the histograms of 8 attributes. I'd like to transform them in some way to improve the model. Data transformation is bit of an art so I'd like to hear your thoughts on how you would transform it (if at all), and why. For instance, do you HAVE to transform a skewed data or is it not a deal breaker? So far, I've learned techniques like log transform, binning, and ranking the data putting the ranks into quantiles.

enter image description here

enter image description here

I wouldn't do anything with "Therapy" since that's already a binary attribute with 0 or 1. "Age" and "ORGANNUM" is fairly uniformly or normally distributed so I wouldn't transform them.

"BLIL6" and "BLLBILI" seems like good candidates for binning, or creating categorical variables out of them, since they have extreme values. But what if I don't?

I'm not sure about PRAPACHE, BLLPLAT. Is it okay to leave them be?

Please advise in regards to regression on the best practices and why. Thanks

$\endgroup$
1
  • $\begingroup$ It's a scatter plot matrix that deserves first attention, not a set of histograms. But I agree that the minor modes of your BL* variables might be problematic if they are associated with multlvariate outliers. $\endgroup$
    – Nick Cox
    Sep 26, 2021 at 17:52

1 Answer 1

2
$\begingroup$

You shouldn't necessarily worry too much about the marginal distribution of your variables. The assumptions of linear regression are about the distribution of the residuals.

This is a common source of confusion - see this answer for example.

That being said, it could well be the case that you end up with a better model after transforming some of your variables. The way to figure this out is by fitting different models and seeing what works best for your data (in terms of goodness of fit / residual analysis).

$\endgroup$
1
  • $\begingroup$ What's more important than the residuals is whether the structure you're fitting is about right, e.g. approximately linear if that is the structure you're fitting. However, that's also a chicken and egg question to some extent. Here the occurrence of outliers is more likely to be diagnostic than overall skewness. $\endgroup$
    – Nick Cox
    Sep 26, 2021 at 17:50

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.