12

I am having problems with defining the error terms for a two way repeated measures ANOVA in R. My data consists of wood density estimates for three radial positions (inner, middle, and outer) along a core extracted from a tree. There are a total of 20 tree species, 6 individuals of each species, and two cores from each tree.

To test the effect of radial position on wood density, I use the following two way ANOVA model with an error term that accounts for variability across individuals:

radpos.aov <- aov(WD ~ Species*Radialposition + Error(Individual), data=Radpos)

However, I am not sure if my specification of the error term is adequate. Am I also supposed to account for the variability within a core? To me this variability is the same as that due to radial position which is the main factor I am interested in.

Although I have devoted some time to reading about specifying the error term in Repeated measures ANOVA, I still have problems with practically specifying the error term. I will appreciate some help with this.

amoeba
  • 93,463
  • 28
  • 275
  • 317
atawewe
  • 151
  • 1
  • 1
  • 5

1 Answers1

9

It would be

 radpos.aov <- aov(WD ~ Species*Radialposition + Error(Individual/(Radialposition)), data=Radpos)
 summary(radpos.aov, type=3)

That accounts for the within subject error of Radialposition. If you have other within-subject factors, throw them in (in an interaction) with Radialposition in the Error denominator, like + Error(Individual/(Radialpostion*wiFactorA)). That's my understanding of it. That matches up with SPSS's repeated measures GLM if you have no missing data.

jtth
  • 131
  • 6
  • 2
    +1. See the detailed cheat sheet here: http://dwoll.de/rexrepos/posts/anovaMixed.html. And also here: http://personality-project.org/r/r.guide/r.anova.html – amoeba Jun 21 '17 at 09:48