I am trying to specify a formula for a linear mixed effect model (with
lme4) for my experimental design, but I'm not sure I'm doing it right.
The design: basically I'm measuring a response parameter on plants. I have 4 levels of treatment, and 2 irrigation levels. The plants are grouped in 16 plots, within each plot I sample 4 sub-plots. In each sub-plot I take between 15 and 30 observations (depending on the number of plants found). That is, there are a total of 1500 rows.
Initially the subplot level was just here for sampling purposes, but I thought I'd like to take it into account in the model (as a 64-level variable) because I saw there was a lot of variability from one sub-plot to another, even inside the same plot (greater than the variability between whole plots).
My first idea was to write:
library(lme4) fit <- lmer(y ~ treatment*irrigation + (1|subplot/plot), data=mydata)
fit <- lmer(y ~ treatment*irrigation + (1|subplot) + (1|plot), data=mydata)
Is that correct? I'm not sure if I must keep both plot/subplot levels in my formula. No fixed effect is significant but the random effects are very significant.