# transformation of response variable which is in percentage

Here's my data.

https://www.dropbox.com/s/puf57efqkdl8zt0/data.csv?dl=0

It's too big, therefore I did not know to use the dput(data) command.

I am using a mixed effect model to model response as a function of 8 climate variables. response is derived from yield of 2 crops yld.lc and yld.nc as follows

response = (yld.lc - yld.nc/yld.nc) * 100

Therefore response is in percentage and can be both negative and positive. In R, the package lme4 can be used to run a mixed model as follows:

library(lme4)
mdl<-lmer(response ~ z.tx + I(z.tx^2) + z.ad + I(z.ad^2) + z.bd + I(z.bd^2) + z.dhs + I(z.dhs^2) + z.nwa + I(z.nwa^2) + z.tr + I(z.tr^2) + z.adr + I(z.adr^2) + z.nhs + I(z.nhs^2) + (1|site.code) + (1|year),data = yd.nc)


I have used the linear as well as quadratic term for all variables.

plot(mdl)
hist(resid(mdl)) # violation of model assumptions
qqnorm(resid(mdl)) # violation of model assumptions
qqline(resid(mdl)) # violation of model assumptions


How do I transform response which is in percentage as well as has both negative and positive percentage values so that my model assumptions are met?

• Why do you think it needs transformation? – Nick Cox Mar 3 '17 at 16:23
• My residuals are not normally distributed and there is some evidence of heteroskedasticity. That is why I am want to transform my data. – user53020 Mar 3 '17 at 16:27
• You mention the least important (normal ...) and the second least important (homo...) ideal conditions for regression. Is there evidence that the linear structure is wrong (most important!)? Backing up, the asymmetry here needs a story. Why not (l - r) / r ? (l - r) / (l + r) might be better behaved. Can you post the data? Looks like you have yld.l yld.r x1 x2 etc. I wouldn't assume that R notation is universally transparent outside an R-specific forum. I confess freely to not knowing what 1|rand1 means. – Nick Cox Mar 3 '17 at 17:21
• I have edited my question with the example data. Hopefully it is a bit more clear now. – user53020 Mar 3 '17 at 18:33
• The model and the notation have changed since the first posting. What's most obvious from a very quick look is massive variability (well over a hundred fold variation between min and max) and a suspicion that analysis on the logarithmic scale might be a good idea. As before full understanding of the model notation requires fluency in R. – Nick Cox Mar 3 '17 at 22:12