0

I was executing anova model for my data and observed that sum of squares (and mean squares, resp.) for one of the effects are not equal in the 1-way anova and 2-way anova.

#             Df Sum Sq Mean Sq F value Pr(>F)
# b            2   18.1   9.047   0.736  0.485
# Residuals   44  540.5  12.285         

summary(aov(x~a,dat))
#             Df Sum Sq Mean Sq F value Pr(>F)
# a            1    1.0   1.001   0.081  0.778
# Residuals   45  557.6  12.392  

summary(aov(x~a+b,dat))
#             Df Sum Sq Mean Sq F value Pr(>F)
# a            1    1.0   1.001   0.080  0.779
# **b          2   20.1  10.027   0.802  0.455**
# Residuals   43  537.6  12.502         

summary(aov(x~a*b,dat))
#             Df Sum Sq Mean Sq F value   Pr(>F)    
# a            1    1.0    1.00   0.113 0.738815    
# **b          2   20.1   10.03   1.129 0.333084**    
# a:b          2  173.6   86.78   9.773 0.000338 ***
# Residuals   41  364.0    8.88 

As you see for b effect Sum Sq are not equal throughout different anova models.

user20650
  • 24,654
  • 5
  • 56
  • 91
  • Welcome to SO. It is advisable that you provide a minimally [reproducible example](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) so that the community can best help you. Dummy data is okay. – alexwhitworth Aug 30 '15 at 22:08
  • 2
    Also, the reason you are seeing this result is because of the order in which you enter the terms into the ANOVA. – alexwhitworth Aug 30 '15 at 22:11

0 Answers0