[R-sig-eco] nested anova and multiple comparisons

Ruben Roa Ureta rroa at udec.cl
Sun Apr 27 18:50:28 CEST 2008

> I am not sure if this is the rigth place to post this but i am working
in ecology and my project is ecological so here goes.  Thanks in advance
> My problem is with a nested anova.  I have read the r-help and it has
answered some of my questions but i still need some help on this one. I
have also posted for help on this data set before, so i apologize in
advance for any repetition.
> My design is as follows:
> response: Quadrat Counts (individuals per quadrat)
> Explanatory:
> Region (3 regions)
> Locations (4 locations nested within each regionfor a total of 1 Site (4
sites nested within each location withineach region for a total
> 48)
> I want to analyse this data set as an observational study where i am
interested if
> 1) There is significant variation at each scale in thestudy
> 2) partition the variancecomponents for each scale.
> 3) Conduct multiplecomparisons at the highest level in the study
> I have managed to accomplish my first two goals by analyzing the data as
a 3 level nested Anova with the following code
> mod1 <- aov(Count~Region/Location/Site, data=data)

You may want to consider a change in the general approach of your
analysis. Your response variable is counts, so it would be more
appropriate to take it as a Poisson random variable. So instead of a
Gaussian linear model (the aov function) you could fit a generalized
linear model. Furthermore, since you have a nested sampling design, you
may need to treat the Location and Site factors as random factors (so you
do not have to estimate 12+48 coefficients, or 12*48 coeff.) and focus on
Region as a fixed effect. As recommended by Kingsford Jones, consider
using the lmer function in the lme4 package.

More information about the R-sig-ecology mailing list