One-Way Within-Subjects ANOVA with SPSS Download the data file Headache.sav from my SPSS data page. The data are those from the migraine-headache study described in your text book (David Howell's Fundamental Statistics for the Behavioral Sciences, 6th ed., page 459). The dependent variable is duration of headaches (hours per week), measured five times. The within-subjects factor is weeks, when the measurement was taken, during the third or fourth week of baseline recording (levels 1 and 2 of week) or during the fourth, fifth, or sixth week of relaxation training (levels 3, 4, and 5 of week). Bring the data file into SPSS. To do the analysis click Analyze, General Linear Model, Repeated Measures. In the Repeated Measures Define Factor window, replace "factor1" with "week" in the Within-Subject Factor Name box. Enter "5" in the Number of Levels box. Click Add. Highlight "week(5)" and click Define. The Repeated Measures window appears. Highlight variables week1 through week5 and scoot them into the Within-Subjects Variables Box. WS-ANOVA1-SPSS.docx 2 Click Plots and scoot "week" into the Horizontal Axis box. Click Add, Continue. Click Options. Check Display Descriptive Statistics and Estimates of Effect Size. Click Continue. Click OK. 3 At the top of the output are the descriptive statistics. Note that the scores are much more variable during weeks 1 and 2 than during weeks 3, 4, and 5. Is this a problem? Yes, but Howell ignored it, so I shall too. The multivariate tests reveal that mean duration of headaches changed significantly across the five weeks, F(4, 5) = 12.55, p = .008. This is the multivariate analysis of which I spoke in my document "An Introduction to Within Subjects Analysis of Variance." Remember that this analysis does not require sphericity. Just below the presentation of the Multivariate Tests is Mauchly's Test of Sphericity. This test is significant (p = .009) for our data, which indicates that we have violated the sphericity assumption. Using the multivariate procedure, rather than the procedure used in our textbook, would be a good idea! The statistics included under the heading "Tests of Within-Subjects Effects" are those using the traditional method taught in our textbook. With the assumption of sphericity, the effect is significant, with F(4, 32) = 21.463, p < .001, just as reported in our text book. However, this test is not valid, given the violation of the sphericity assumption. One can still use the traditional test when there are problems with the sphericity assumption, but the degrees of freedom need to be adjusted. There are two different adjustments available, the Greenhouse-Geisser adjustment and the Huynh-Feldt adjustment. Howell (in his intermediate level statistics textbook, Statistical Methods for Psychology) has suggested using the Huynh-Feldt correction rather than the more conservative Greenhouse-Geisser correction when there is reason to believe that the true value of epsilon (the factor by which the df is multiplied to obtained the corrected df) is near or above 0.75. For our data, the epsilon is estimated to be between .250 (lower bound) and .522 (Huynh-Feldt), so I recommend using the Greenhouse-Geisser correction. With that correction, the effect is still statistically significant, F(1.69, 13.50) = 21.46, p < .001. As you can imagine, some so-called “expert” reviewers of manuscripts still think that df can only come in integer units, so you might want to round the df to integers to avoid distressing such experts. SPSS may give you polynomial contrasts (a trend analysis), even if you did not ask for them. Such an analysis adds little to our understanding of these data, so I shall ignore that part of the output. The "Tests of Between-Subjects Effects" can also be ignored. Since we have no between subjects effects in this set of data, the test here is of the null hypothesis that the grand mean duration of headaches is zero, a hypothesis of no interest. The plot is probably the most useful part of the output. When you look at the plot, it is clear that the duration of headaches dropped as soon as the patients started the treatment on week 3. Effect Size Estimates Eta-Squared. As you know, I prefer eta-squared over partial eta-squared. To compute eta-squared all we need do is divided the sums of squares for week by the total sum of squares. Unfortunately, SPSS does not give us the total sum of squares. If we could get the subjects sum of squares, we could simply add together the sums of squares for week, error, and subjects to get the total sum of squares, but SPSS does not give us the subjects sum of squares either. Here is how we can get the subjects sum of squares: 4 Create a new variable, Subject_Mean, that is, for each subject, the mean across the five weeks. I have done this for you, this way: Ask SPSS to compute the variance of this new variable: Descriptive Statistics N Mean Subject_Mean 9 Valid N (listwise) 9 12.4667 Std. Deviation 4.56508 Variance 20.840 The mean square for subjects will be n times the variance of the subject means, where n is the number of score going into each mean. That is, 5(20.84) = 104.2. The sum of squares for subjects is the mean square times degrees of freedom. Since there are nine subjects, the degrees of freedom is 8. The subjects sum of squares is 8(104.2) = 833.6. The total sum of squares in the sum of the sums of squares for week, subjects, and error = 1934.533 + 833.6 + 721.067 = 3489.2 Eta-squared is 1934.533/3489.2 = .55. Why couldn’t SPSS just tell us that? Wilks’ Lamba. This multivariate statistic is, for the multivariate analysis, the ratio of error variance to total variance. Accordingly, if you subtract it from one you get an etasquared-like statistic. This is what SPSS reports in the Multivariate tests table, with a value of .909. Notice that there is a considerable difference between this statistic and the traditional eta-squared statistic. Partial Eta-Squared. This is reported in the Tests of Within-Subjects Effects table. Here is how it is computed: p2 SSWeek 1934.5 .728 . SSWeek SSError 1934.5 721.1 While this certainly looks even more impressive than the .55 eta-squared, I don’t really think this statistic is appropriate. The question it answers is “if subjects did not differ on the duration of their migraine headaches, what proportion of the variance in duration of migraine headaches would be explained by changes across weeks?” – but subjects DO differ on the duration of their migraine headaches, so I do not think it is appropriate to exclude the variation due to subjects from the denominator of the variance explained ratio. Pairwise Comparisons If you wish to make pairwise comparisons among the means, the easiest way to do so in SPSS is to employ correlated t tests to make such comparisons. If you are one of those persons who is paranoid about ever making a Type I error, you can employ the Bonferroni procedure to adjust the criterion of statistical significance for those correlated t 5 tests. Here I show the Paired Samples T-Test window for comparing each mean with each other mean. Frankly, I think that making all ten of these pairwise comparisons adds little to our understanding of the data, but some researchers would do this. In some other situations such pairwise comparisons might be a good idea. If we wanted to hold the familywise error rate at 5% here, we would require p to be .05/10 = .005 or less for a comparison to be significant. Presenting the Results As shown in Table 1, the duration of headaches during the third, fourth, and fifth weeks of relaxation training was considerably less than during the third and fourth week of baseline recording. Table 1. Duration of headaches before and during relaxation training. M SD Baseline 1 20.78A 7.17 Baseline 2 20.00A 10.22 Training 3 9.00B 3.12 Training 5 6.78BC 4.12 Training 4 5.78C 3.42 Week Note. Means sharing a letter in their superscripts do not differ significantly. A Bonferroni correction was applied to hold familywise error rate at a maximum of .05. A repeated-measures ANOVA, with Greenhouse-Geisser correction, indicated that duration of headaches differed significantly across weeks, F(1.69, 13.50) = 21.46, p < .001, 2 = .73. Pairwise comparisons revealed that by the third week of relaxation training the mean duration of headaches was reduced significantly from baseline levels, with some additional reduction during the fourth week of training. 6 Return to Wuensch’s SPSS Lessons Page Do it with SAS – Warning: The data for the SAS lesson are not identical to those used in this lesson, although both were kindly provided by David Howell. Karl L. Wuensch, Dept of Psychology, East Carolina University, Greenville, NC, USA November, 2015