[R] repeated anova

John Fox jfox at mcmaster.ca
Tue Jul 22 19:14:57 CEST 2014


Dear Lynn,

On Tue, 22 Jul 2014 13:59:39 +0200
 Lynn Govaert <lynn.govaert at gmail.com> wrote:
> Hi,
> 
> I have a problem with doing a repeated measures ANOVA. I will first give
> you an idea of what my dataset looks like. We have 20 ponds, and for each
> pond we took some individuals (waterfleas), say 10 and tested them along
> two treatments (A and B). Now, for each pond we also know the fish
> background (Fish versus No Fish) and Land use intensity (High versus Low).
> 
> Now, we measure the offspring of the first clutch and second clutch of each
> individual, and we want to see if there is an effect of each of the other
> factors (treatment, background, land use), so we need to do a repeated
> measurement.
> 
> So I rearranged my data where I put the first and second clutch in one
> column, something like this:
> 
> Ponds        Treatment     Background            LandUse          Clutch
>           SizeClutch
> Pond1         A                    Fish                      High
>       1                        10
> Pond1         B                    Fish                      High
>       1                         15
> Pond2         A                    NoFish                  High
>     1                         8
> Pond2         B                    NoFish                  High
>     1                         11
> etc
> Pond20        B                   Fish                      Low
>      1                          12
> Pond1         A                    Fish                      High
>       2                          15
> Pond1         B                    Fish                      High
>       2                           17
> Pond2         A                    NoFish                  High
>     2                          16
> Pond2         B                    NoFish                  High
>     2                           18
> etc
> Pond20       B                    Fish                      Low
>      2                            11
> 
> So I made the Clutch variable myself, to separate between the different
> clutches.
> 
> I then performered the following analysis
> 
> summary(aov(SizeClutch ~ Treatment*Background*LandUse +
> Error(Clutch/Treatment*Background*LandUse) + Ponds , random = ~ Ponds|
> Background*LandUse/Ponds))
> 
> This gives me something, but not exactly what I thought I would get.
> I want to have results for
> Ponds
> LandUse
> Background
> Treatment
> LandUse*Background
> LandUse*Treatment
> LandUse*Background*Treatment
> 
> Clutch
> Clutch*Ponds
> Clutch*LandUse
> Clutch*Background
> Clutch*Treatment
> Clutch*LandUse*Background
> Clutch*LandUse*Treatment
> Clutch*LandUse*Background*Treatment
> 
> and p values for all of the effects.
> Now, I don't know if it is possible to come to these results and if I'm
> doing the repeated measure ANOVA correctly. Also, are there other ways to
> do a repeated measurements in R?

For another approach to repeated-measures ANOVA (and MANOVA), see the section on repeated measures in the R Journal paper at <http://journal.r-project.org/archive/2013-1/fox-friendly-weisberg.pdf>.

I hope this helps,
 John

------------------------------------------------
John Fox, Professor
McMaster University
Hamilton, Ontario, Canada
http://socserv.mcmaster.ca/jfox/

> 
> Thanks in advance.
> Lynn
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list