I have rainfall and temperature data across multiple locations and I want to model yield as a function of these two. I know rainfall and temperature relationship is not linear i.e. there is a gain in yield first and then a decline with these two increasing.
I did this:
dat$temp2 <- temp^2 dat$rain2 <- rain^2 dat.z <- scale(dat[,2:5], center = T) lmer(yield ~ temp + temp2 + rain + rain2 + (1| loc), data = dat.z)
I wanted to ask do I have to standarise temp and rain first and then take the square or the above step is fine?