Skip to content
Prev 4744 / 398506 Next

anova question

I have a probably very naive question about the R anova/aov functions:
I've found in several text books with descriptions of anova procedures
that, in nested anova (specifying the model "X~A/B", B being a factor
specifying treatments, and A groups of samples within each treatment),
the mean square for "among treatments" is divided by the mean square
"within treatment among sample groups"; R seems to divide by the
residual mean square. So, in the following (silly) example I would
have expected a F value of 1.496/0.785=1.905732:

  > test <- data.frame(x=rnorm(12*5), a=rep(1:12,rep(5,12)), b=rep(1:5,rep(12,5)))
  > summary(aov(x ~ factor(a)/factor(b), data=test))
                      Df Sum Sq Mean Sq F value  Pr(>F)  
  factor(a)           11 16.456   1.496  1.8357 0.07647 .
  factor(a):factor(b)  4  3.142   0.785  0.9638 0.43689  
  Residuals           44 35.859   0.815                  

As I am certainly misunderstanding something, I would appreciate a
hint, and maybe a literature recommendation!

Many thanks,
Ulf

P.S.: please CC: me, I'm not on the list at the moment! Thank you!