[R] AOV with repeated measures

Berton Gunter gunter.berton at gene.com
Thu Oct 27 00:27:32 CEST 2005


As you have not yet received an **authoritative** answer, I'll attempt a
nonauthoritative one. Caveat emptor.

1. If strain is a fixed effect and you have but one exemplar of each strain
in species (which I assume is fixed) that is measured twice, measurement
error is all you have and a straightforward specification:

aov(y~species + strain %in% species) 

will do. It will also give a far too high false positive rate -- i.e. true
significance is much lower than advertised because measurement error is only
one small part of the true variability. You're missing the individual to
individual within strain*species component (if this is meaningful in your
context). In other words, the study design is flawed and the data analysis
will be too.

2. If strain is random

aov(trait~species + Error(species/strain))

is what you need. The within,replicate error is automatically added. 

Or even more simply: reduce the data to the average of the two measurements
and simply run aov(trait~species) on that, a oneway anova. Even with a few
missing replicates, this should be about right.

I would agree that documentation on the use of Error in aov seems
essentially nonexistent (AFAIK). Section 10.2 of Mass4 by Venables and
Ripley is about the best resource I know of. However, as the aov docs say,
if you're really in case 2, you're probably better off doing this with lme()
anyway. Partitioning SS is soooo 1960's when we have Doug Bates and friends
noodling away writing sophisticated likelihood optimization code for us.
Don't let his efforts be in vain, I say (or was that Abe? ...) .


-- Bert Gunter
Genentech Non-Clinical Statistics
South San Francisco, CA
 
"The business of the statistician is to catalyze the scientific learning
process."  - George E. P. Box
 
 

> -----Original Message-----
> From: r-help-bounces at stat.math.ethz.ch 
> [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of 
> Christian Landry
> Sent: Wednesday, October 26, 2005 12:10 PM
> To: r-help at stat.math.ethz.ch
> Subject: [R] AOV with repeated measures
> 
> Dear R user,
> 
> I have a question on using R to analyze data with repeated 
> measurements. I 
> have 2 species with several strains (12) per species, each of 
> which has 
> been measured twice with for a given trait. No particular 
> covariance, just 
> two measures. Now I want to analyze the data with an ANOVA (aov) 
> considering these repeated measures to get the MSq and SSq 
> for the species 
> and strain level. I would like to know how to write the ANOVA 
> model in R. I 
> have done the following:
> 
> aov(trait ~ species + strain/replicate)
> 
> Is it accurate?
> 
> Thanks a lot,
> 
> Christian
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! 
> http://www.R-project.org/posting-guide.html
>




More information about the R-help mailing list