[R-sig-eco] Question About Syntax For Complex ANOVA Design

Joe Simonis jls468 at cornell.edu
Fri Nov 7 16:53:36 CET 2008


Hey Everyone,

    I'm helping a friend out with analyzing some of her data, and I 
haven't run an ANOVA like this in a while, and especially not in R.  I'm 
having a bit of trouble figuring out the correct syntax and so I was 
hoping to get feedback.  Any input would be welcomed.  As of now, I also 
don't have the data, but I've been told that sample size should be equal 
for all of the combinations (although that may not be true).  In any 
case, for now, let's assume all sample sizes are equal.

    The basics of the mensurative experiment are as follows:

    The study was looking at variation in physiological values (HSP) of 
intertidal mussels across a few different sites at three different times 
of year.  The sampling was done in New Zealand, with 2 sites sampled on 
each of the East and West coasts, and within each site, there were two 
sampling points (mussel bed location, MBL), one low in the intertidal 
one high in the intertidal.  There are two levels of MBL (low and high) 
at each site and there are two sites for each cost.  I see this as MBL 
nested in site, nested in coast.  However, it seems to me that only site 
is a random factor.  Both MBLs were picked specifically at that site and 
were done so in a way to compare high to low locations, so that seems 
fixed to me.  Site was picked more to look at site-to-site variation 
(i.e random factor).  And coasts were explicitly being compared (i.e. 
fixed factor). 

    So, I see that as a fixed factor nested in a random factor  nested 
in a fixed factor.  Does that make sense?  And then there's the bit 
about repeated measures, since they sampled mussels from each MBL 3 
times.  I don't think that necessarily complicates things too much, but 
maybe it does?  I can put together the ANOVA table on paper in the way 
I'd like to analyze the data (working off of examples in Quinn and 
Keough on pg 314, but with an additional level of nestedness).  However, 
I am pretty lost on how to code the syntax for the analysis in R.  I've 
had a few different ideas, but none of them really seem correct to me.  
I think the biggest problem for me is figuring out how to keep the 
structure of the nestedness in tact despite the fact that some factors 
are fixed and some are random. 

    The best I could come up with so far is     lme(HSP~MBL, random= 
~time|coast/site)     

    But it doesn't seem really right to me.  I have MBL in the fixed 
part of the model, but when it's like that, I think the nestedness gets 
lost (since there's no cost/site/MBL anywhere). 

    Again, I would appreciate any insights into the syntax or the 
general way I am approaching this analysis.  I've been trying to piece 
the stuff together from nested analyses and time-series analyses in 
Crawley's book, but I'm just not getting it.

    Thanks a bunch in advance!!

--Joe

-- 
Joseph L. Simonis

Cornell University
Department of Ecology & Evolutionary Biology
E231 Corson Hall
Ithaca, NY 14853 USA
email:  jls468 at cornell.edu

http://www.people.cornell.edu/pages/jls468/



More information about the R-sig-ecology mailing list