I collected crop yield and rainfall data from multiple counties and year ( > 30 years). Each county can only belong to one province and each province can only belong to one region. I am interested in knowing the relationship between crop yield and rainfall.
Which of the two is the right way to specify the nested structure ( I guess it's the first one):
mod1 <- lmer(yield ~ rainfall + (1|region/province), data = dat)
mod2 <- lmer(yield ~ rainfall + (1|region) + (1|province), data = dat)
Building on this, if I am also interested in including the time trend of each county, is the following specification correct:
mod3 <- lmer(yield ~ rainfall + year + (1|region/province) + (1 + year|county), data = dat)
Lastly if I am interested in fitting a model just based on year and location (i.e. no rainfall), is it the right way to specify yield as a function of year and location and year trend is allowed to vary by county?:
mod4 <- lmer(yield ~ year + (1|region/province) + (1 + year|county), data = dat)