Skip to content
Prev 30400 / 398513 Next

[OFF] Nested or not nested, this is the question.

"Ronaldo Reis Jr." <chrysopa at insecta.ufv.br> writes:
Neither. First of all, you have numDF = 1 for things that have more
than two levels, so you forgot to make them factors.

reis$plot<-factor(reis$plot)
reis$size<-factor(reis$size)
reis$specie<-factor(reis$specie)

Then you seem to be needing something that describes the replication,
and you're not actually telling us, but if I guess that plots 1-4 is
the 1st replication and 5-8 and 9-12 are the others, then this should
work:

reis$repl <- factor((as.numeric(reis$plot)-1)%/%4+1)
table(reis$plot,reis$repl) # just to check

now you can do 

anova(lme(nsp/tot~size*specie,random=~1|repl/plot,data=reis))

and have

            numDF denDF   F-value p-value
(Intercept)     1     8 207.18935  <.0001
size            3     6  94.58027  <.0001
specie          1     8  57.14293   1e-04
size:specie     3     8  10.28573   4e-03

or, as I'd prefer in a balanced study:

summary(aov(nsp/tot~specie*size+Error(repl+plot),data=reis))

Error: repl
          Df   Sum Sq  Mean Sq F value Pr(>F)
Residuals  2 0.027708 0.013854

Error: plot
          Df   Sum Sq  Mean Sq F value    Pr(>F)
size       3 0.305417 0.101806   94.58 1.927e-05 ***
Residuals  6 0.006458 0.001076
---
Signif. codes:  0 `***' 0.001 `**' 0.01 `*' 0.05 `.' 0.1 ` ' 1

Error: Within
            Df   Sum Sq  Mean Sq F value    Pr(>F)
specie       1 0.041667 0.041667  57.143 6.551e-05 ***
specie:size  3 0.022500 0.007500  10.286   0.00404 **
Residuals    8 0.005833 0.000729
---
Signif. codes:  0 `***' 0.001 `**' 0.01 `*' 0.05 `.' 0.1 ` ' 1

(Error(repl/plot) actually works too because repl:plot is the same as plot)

This gets a little confusin because "repl" is a coarsening of "plot".
It may be easier with a within-repl numbering, which you can get by
noting that plot is equivalent to repl:size

anova(lme(nsp/tot~size*specie,random=~1|repl/size,data=reis))
summary(aov(nsp/tot~specie*size+Error(repl/size),data=reis))