I have a huge dataframe (31584 rows) which consists of crop yield data collected over multiple districts and years.
Each district is nested within a State and each State is nested within an ACZ or climate zone.
I want to build a mixed model using yield as response and 11 climate variables (one of which is a drought index)
I also have another grouping variable which classifies the irrigation level as low, medium or high.
I specified my model as follows:
mod <- lmer(crop.yield ~ # 11 climate variables + year + (1|ACZ) + (1|state) + (1 + year|district) + (1 + drought|irrigation), REML = FALSE, data = dat)
If I understand it correctly, I am specifying that the year trend changes from district to district. Simiarly, the effect of drought also changes according to irrigation level. I hope my understanding is correct.
I need some advise on how to make my lme4 fitting faster. When I run the above command, it is taking too much time to run. It's been one hour now and the command is still running. I need some suggestion on how to make it faster?