[R] Post-hoc tests for interactions of between- and within-subject factors

Julius Verrel verrel at mpib-berlin.mpg.de
Tue Jun 12 10:57:15 CEST 2007


Is there a standardized way in R to perform post-hoc comparisons for main
adn interaction effects of between- and within-subject factors?

For instance, I have a data set of performance of adults of different age
groups (20-30, 60-70,70-80) performing a WM task (n-back, with n=1,2,3,4) in
two different conditions (while sitting or walking). The corresponding ANOVA
produces the following output



> gm = aov(cog ~ agegp*nback*cond+Error(id/(cond*nback)),data = g);
> summary(gm)

Error: id
      Df Sum Sq Mean Sq
agegp  1 7.0268  7.0268

Error: id:cond
     Df Sum Sq Mean Sq
cond  1 5.1788  5.1788

Error: id:nback
      Df Sum Sq Mean Sq
nback  2 586.88  293.44

Error: id:cond:nback
           Df Sum Sq Mean Sq
nback:cond  2 2.8901  1.4451

Error: Within
                  Df Sum Sq Mean Sq F value    Pr(>F)
agegp              2 139.29   69.64 45.4349 < 2.2e-16 ***
nback              2 145.40   72.70 47.4288 < 2.2e-16 ***
cond               1   0.38    0.38  0.2495 0.6176019
agegp:nback        4  30.32    7.58  4.9448 0.0006367 ***
agegp:cond         2   1.44    0.72  0.4698 0.6254042
nback:cond         2   0.25    0.12  0.0815 0.9217123
agegp:nback:cond   4   2.22    0.56  0.3621 0.8356007
Residuals        546 836.92    1.53
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
 
 


TukeyHSD does not seem to work for within-person factors. Any suggestions
how to perform post-hoc comparions?

Thanks in advance, 
      Julius



-- 

Julius Verrel (PhD student)
MPI for Human Development
Lentzeallee 94
D-14195 Berlin
+49 30 82406-410



More information about the R-help mailing list