Here's my data.
It's too big, therefore I did not know to use the
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.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?