Hello all - I have been teaching myself R and have run into a problem that i
cant seem to find an answer too. I appreciate any advice that can be given.
My Design is a 2 level nested design with Site nested in the interaction of
Region * Habitat
The response variable i have been using are my quadrat counts
The explanatory variables are below
Region (a=2 levels - fixed)
Habitat (b=2 levels - fixed)
Site (c=16 sites - random)
n=20 quadrats at each site
My ANOVA table will look like the following
df
Region 1 (a-1)
Habitat 1 (b-1)
Region*Habitat 1 (a-1)(b-1)
Site(Region*Habitat) 60 ab(c-1)
Residual 1216 abc(n-1)
The code i have been using in R looks like this
Model1 <- lm(Count ~ Region + Habitat + Region*Habitat +
Site%in%(Region*Habitat))
However i can not seem to get the correct degrees of freedom.
Could someone please help me with the correct code to nest a factor within
an interaction term.
Thank you very much
Stephen Cole
Marine Ecology Lab
Saint Francis Xavier University
[[alternative HTML version deleted]]