title: Nested Anova in R
body: <p>I want to show that seeds of different species display different length due to the factor Species.
  For each species, I have several trees and for each tree, I have several seeds measured.</p>
  
  <p>Using R, I did an ANOVA:</p>
  
  <pre><code>summary(aov(Length ~ Species))
  </code></pre>
  
  <p>However, the reviewer noticed a problem of independence because seeds may provide from the same tree. (and this is indeed a real problem !)</p>
  
  <p>To answer this issue, I think that I should do a nested ANOVA. Is that right ?</p>
  
  <p>However, there are plenty of ways to write the code:</p>
  
  <pre><code>summary(aov(Length ~ Species*Tree))
  summary(aov(Length ~ Tree*Species))
  summary(aov(Length ~ Species/Tree))
  summary(aov(Length ~ Species+Error(Tree)))
  </code></pre>
  
  <p>I believe this is the last possibility listed that will allow me to show that the length of seeds is different due to the species and taking into account that the seeds may come from the same tree.</p>
  
  <p>Can you confirm ?</p>
  
  <p>When I run the command, I obtain this:</p>
  
  <pre><code>Error: Tree
  Df Sum Sq Mean Sq F value   Pr(&gt;F)     
  Species 12  320.6  26.715   14.98 4.96e-15 ***
  Residuals  71  126.6   1.784                     
  ---
  Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 
  
  Error: Within
  Df Sum Sq  Mean Sq F value Pr(&gt;F)
  Residuals 1541  11.92 0.007733 
  </code></pre>
  
  <p>Which indeed means that species have a significative impact on the seed length, is that right ?</p>
  
  <p>Thanks so much for your help !!</p>
  
  <p>Muriel</p>