# How to transform my variables before fitting into linear regression?

I have a game where there are 4 different types of berries to collect, and I am trying to understand how the collection of each of these berries would influence each other. I made kde plots for the distributions, which are the following:

Here, the X-axis is basically the number of berries collected. The question is, what kind of transformation should I do before running the variables through an LMM?

An example model would be of the form:

model <- lmer(berry1 ~ berry2 + berry3 + berry4 + (1|subject))


I apologize for not linking data, but I'm not allowed to do that. Also, each subject has multiple datapoints, hence the random effect there, but I think we can safely ignore that.

• Why do you believe you should transform anything? Commented Jul 24 at 13:42
• Transform to achieve what? Normality? You don't need a Gaussian outcome, and you definitely don't need Gaussian features (otherwise, ANOVA wouldn't work). It can be desirable to have Gaussian errors, but even that is a fairly unimportant assumption due to various convergence theorems.
– Dave
Commented Jul 24 at 16:00
• I think the more important issue is if the question "how the collection of each of these berries would influence each other" leads to regression analysis. Do you plan to run four different regression models each with a different berry as dependent variable? I think you should go back one step and ask what the best approach for your actual question is. (Note that all your berry variables appear to be counts which would suggest a GLMM such as Poisson regression or related distribution families and not transformations, if regression is indeed a suitable approach.) Commented Jul 25 at 5:21
• it doesn't really make sense to use continuous kernel density estimates with a discrete variable. The proportion of observations at each berry-total would be a better way to present the data Commented Jul 25 at 12:25
• Thanks for all your input! First, I'd like to say that GLMM was what I was thinking of using eventually, but wanted to give LMM a try first, and see if I could get something out of it. Considering the way the game is designed and the properties for the berries, I think GLMM would be a good fit. Thanks! As to why I wanted to transform it, the skew in the data caused a skew in the residuals, which was very apparent. Now I realize I should have put in residual plots too, sorry about that. @Dave, thanks for the info! Commented Jul 26 at 13:02