# Non normal residuals even after transforming data and generalised linear models

I have data where my x is a categorical variable that I have used dummy variables for (I have 4 categories as my dependent variable) and my y is a continuous variable (height).

Edit: the independent variable is the number of ribosomes (however these are losely grouped, so one group might have 11+ ribosomes), and the dependent variable is the height of a peak the sample generates on my software when I run the sample

I want to see if there is a significant difference between the heights of each group. I did an advanced stats course and they said a Mann-Whitney is outdated (this is what my colleagues use to analyse this kind of data) and that I should do a linear model or generalized linear model.

I have done a linear model and my residuals vs fitted plot shows that my residuals are non-normal. I have tried transforming the data using $$1/y, \ln y, \log y, \sqrt y$$ and I've done a Box Cox transformation which all result in very similar residuals vs fitted plots to the one above so do not help.

I thought a generalised linear model would be the next step but I can't do poisson/negative binomial as my y is non-integer, and Gaussian and Gamma GLMs don't solve my issue either.

I'm not sure if it's because I have 4 different categories, all with separate heights and that's what the residual plots is showing? So how would I overcome that?

This is the residuals vs fitted for the gamma glm with link=log glm(y ~ f, data = my_data, family = Gamma(link = 'log'))

• The scale-location plot would have been better; f in my example is a factor; you should code your categorical variable as a factor and let R take care of creating the appropriate contrasts – Gavin Simpson Jan 21 at 15:54
• I tried just doing it as a factor by data$Number<-as.factor(data$Number) is that what you mean? I get exactly the same result with that – anro3 Jan 21 at 15:56