0
$\begingroup$

I have a repeated measures design, where A and B are within-subjects factors. I tried

m1 <- aov(y ~ A * B + Error(subject/(A*B)))
summary(m1)

But the results came back:

Error: subject
          Df    Sum Sq   Mean Sq F value  Pr(>F)   
A          1 176166607 176166607   20.89 0.00600 **
B          1 143823233 143823233   17.05 0.00909 **
Residuals  5  42166494   8433299                   
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Error: subject:A
      Df  Sum Sq Mean Sq F value Pr(>F)  
A      1 2263122 2263122   4.404 0.0899 .
B      2 1056720  528360   1.028 0.4227  
Residuals  5 2569581  513916                 
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Error: subject:B
              Df    Sum Sq   Mean Sq F value   Pr(>F)    
B              3 2.531e+09 843650464  60.871 6.22e-10 ***
A:B            2 8.212e+07  41060723   2.963   0.0759 .  
Residuals 19 2.633e+08  13859601                     
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Error: subject:A:B
          Df   Sum Sq Mean Sq F value Pr(>F)
A:B        3  2075177  691726   1.152  0.351
Residuals 21 12610432  600497               

Error: Within
           Df    Sum Sq Mean Sq F value Pr(>F)
Residuals 477 442259616  927169 

Why is each effect showing up with so many error terms? Am I misunderstanding something? Or am I doing something wrong?

$\endgroup$
3
  • $\begingroup$ Although asked in terms of R, this is really a question about understanding rmANOVA. I think it should be considered on-topic here $\endgroup$ May 3, 2015 at 12:56
  • 1
    $\begingroup$ A complete answer should probably address your fundamental statistical question but you're also are doing something wrong. I don't think you have one measure of each variable for each subject. Try table(A, B, subject). Every item should be 1. If it's not, fix that first and rerun and repost the results. $\endgroup$
    – John
    May 3, 2015 at 16:21
  • $\begingroup$ Thanks John! that was exactly what I wasn't understanding. I guess I had assumed that R was clever enough to aggregate for me, but I guess in hindsight there's nothing to indicate that it should. $\endgroup$
    – phsyron
    May 3, 2015 at 17:20

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.