R code if my random effect is nested under another random effect
<p>I am trying to do mixed linear model for my study in R. I would like to know if my code is correct or not.
MY design - I have 5 sites, 2 subsites within each site and 2 permanent quadrates within each site. 
So I have 5 sites, 10 subsites and 20 quadrats. I have measured colony size (of corals) at all the quadrats. 
My question is does the size structure vary between sites ? 
In my data quadrats are nested within subsite and subsites are nested within site. 
I will use site as my fixed factor and subsites and quadrats as my random effects. 
I can think of two possible ways of doing this:</p>

<pre><code>library(lme4)
</code></pre>

<p><strong>option 1</strong> 
<code>lmer(size ~ site + (1|subsite) + (1|quadrat)</code></p>

<p><strong>option 2</strong> 
<code>lmer(size ~ site + (1|site:subsite) + (1|subsite:quadrant)</code></p>

<p>which one of these would be correct to use? </p>

<p>Thanks </p>