So the background is that the I collected yield data for past 5-6 decades and location from where I collected yield data had high yielding varieties introduced over time. I am looking at the relationship between yield and rainfall but this introduction of HYV might affect the true impact of monsoon on yield and therefore I am detrending the data to remove the effect of HYV.
I did a linear regression of yield against time in R:
mdl1 <- lm(yield ~ time, data=data)
and then removed the linear trend by taking the residuals of the above regression:
yield.res <- resid(mdl1)
Now I am using these residuals for my subsequent analysis. For example, the relationship between yield and rainfall is:
mdl2 <- lm(yield.res ~ rain, data=data)
In this case, do my yield.res
have to be normally distributed before I do this regression? If yes, what sort of transformation do I need to use? Since yield.res
consists of both negative and positive numbers, I am slightly confused how to go about it.