I have data from a field survey. The objective of the study is to relate number of seedling (respond variable, count data), flood duration (exploratory variable, categorical variable with 3 levels) and percent canopy coverage (exploratory variable, quantitative).
In each flooding duration, I have data from five 25x25 meter plots. The plots were randomly placed throughout study site, so I do not think they are dependent. Within each plot I used three 2x2 meter subplots nested within the bigger plot, and number of seedlings were count from these subplots. Total number of observations is 45; 3 flood levels x 5 plots x 3 subplots.The data looks like this.
I am new to mixed effect model, and from my understanding the subplots nested within plots. I would like to do this using lmer as follows.
Model <- lmer(seedling ~ flood duration * canopy + (1|plot/subplots), data = mydata)
I am not sure about the
(1|plot/subplots) term. Is the term correct?
Just a bit about syntax, as @Dimitris Rizopoulos mentioned that because in mydata, the sub-plots index numbers are not the same within each plot (in my case subplots 1-1, 1-2, and 1-3 are within plot 1 only), I could use glmer (seedling ~ flood duration * canopy + (1 | plot) + (1 | subplots), data = mydata, family = poisson()). From my understanding that I might be wrong the “(1 | plot) + (1 | subplots)” is a way to tell R that these are crossed random effect. However, because my sub-plots index numbers are not the same within each plot, R will know that these are nested effect, and this syntax will give the same result as glmer (seedling ~ flood duration * canopy + (1 | plot/subplots), data = mydata, family = poisson()). Is this understanding correct?