I have collected crop yield data from multiple blocks for multiple years and associated rainfall data. Each block is located within a municipality and each municipality is located within a State. I am interested in knowing the relationship between yield and rainfall while accounting for the effect of location and year. This is how I specified my model:
lmer(yield ~ rainfall + (1 | block) + (1 | muni) + (1 | state) + (1 + year | block))
I am somewhat confused by different way of writing the formula specification and would appreciate if someone could advise me if the above specification is correct? The reason I am asking is because in this post I found a specification which suggests to me that model should be specified like this:
lmer(yield ~ rainfall + (1 | state:muni:block)
What is the difference between the two?