= Manual computation for pairwise comparisons involving three or more groups in a repeated measures ANOVA = From Boniface (p.42-3) using what he calls 'reliability' the SS(error) from a one-way repeated measures ANOVA is SS(subjects x group) = $$ \sum_text{ij} (X_text{ij} - (\bar{X}_text{group} - \bar{X}) - \bar{X}_text{sub})^2 ^ $$ = $$ \sum_text{ij} (X_text{ij} - \bar{X}_text{group} - \bar{X}_text{sub} + \bar{X})^2 ^ $$ MS(error) = SS(subjects x group) / ((N-1)(Ngroup-1)) for N subjects each in Ngroup groups. The (uncorrected) t statistic on (N-1)(Ngroup-1) degrees of freedom between a pair of means is $$\frac{\mbox{difference in means}}{\sqrt{\frac{\mbox{2MS(error)}}{\mbox{N}}}}$$. Using Tukey's test for all pairwise comparisons we can use (difference in means) / Sqrt{MS(error)/N = Sqrt(2)t and compare to the studentised range statistic, q(Ngroup,(N-1)(Ngroup-1)), at 0.05 and 0.01 levels (Tables in Howell, 1997). This can be done computationally using [[FAQ/aovmtb| SPSS as here.]] __Example of showing how the above manual calculation relates to computation of Tukey's HSD test in SPSS__ ||||||||||<25% style="VERTICAL-ALIGN: top; TEXT-ALIGN: center"> X || Sub mean || group mean || GM || (X-Xsub mean - Xgroup mean+ GM)^2 || ||||||||||<25% style="VERTICAL-ALIGN: top; TEXT-ALIGN: center"> 5 || 6 || 5.67 || 6 || 0.45 || ||||||||||<25% style="VERTICAL-ALIGN: top; TEXT-ALIGN: center"> 6 || 6 || 6 || 6 || 0 || ||||||||||<25% style="VERTICAL-ALIGN: top; TEXT-ALIGN: center"> 7 || 6 || 6.33 || 6 || 0.45 || ||||||||||<25% style="VERTICAL-ALIGN: top; TEXT-ALIGN: center"> 4 || 5 || 5.67 || 6 || 0.45 || ||||||||||<25% style="VERTICAL-ALIGN: top; TEXT-ALIGN: center"> 5 || 5 || 6 || 6 || 0 || ||||||||||<25% style="VERTICAL-ALIGN: top; TEXT-ALIGN: center"> 6 || 5 || 6.33 || 6 || 0.45 || ||||||||||<25% style="VERTICAL-ALIGN: top; TEXT-ALIGN: center"> 8 || 7 || 5.67 || 6 || 1.77 || ||||||||||<25% style="VERTICAL-ALIGN: top; TEXT-ALIGN: center"> 7 || 7 || 6 || 6 || 0 || ||||||||||<25% style="VERTICAL-ALIGN: top; TEXT-ALIGN: center"> 6 || 7 || 6.33 || 6 || 1.77 || Suppose we do an experiment on three (within subject) groups with means of 5.67, 6.00 and 6.33 each on three subjects. Using the formula above for SS(subjects by group) equates to adding up the terms in the rightmost column of the above table. Doing this we find that the subjects sum of squares = 5.33 with a Mean Square Error of 5.33/[(3-1)(3-1)] = 1.33 as given in the SPSS output. We can then use the mean square error to work out the Tukey test p-value for assessing the difference between, say, the first two means (5.67-6.00= -0.33). Note that we need to input the absolute value of this difference (0.33) into the studentised range function in SPSS: {{{ COMPUTE PV=1 - CDF.SRANGE(SQRT(2)*0.3333/SQRT(2*1.33/3),3,(3-1)*(3-1)). }}} giving p=0.935 as given in the SPSS 'Multiple Comparisons' output for this meane difference since by the above formulae t(2) = -0.3333/$$\sqrt{\mbox{2*1.33/3}}$$, the studentised range statistic q = $$\sqrt(2)$$t and Tukey compares the sample q to a critical value of q(group, df(error)). __References__ Boniface DR (1995) Experiment design and statistical methods for behavioural and social research. Chapman and Hall:London. Howell DC (1997) Statistical methods for psychologists. Fourth Edition. Wadsworth, Belmont,CA. the studenised range table are also probably in Howell's 2002 edition.