Research Methods II: Spring Term 2001

Using SPSS: Two-way Mixed-design ANOVA


Suppose we have performed an experiment investigating sex differences in the effects of caffeine on memory. We have two independent variables. On one of these, caffeine consumption, we have repeated measures (i.e. it is a within-subjects variable). There are three levels of caffeine consumption, low, medium and high, and each subject does all three conditions. On the other IV, sex of subject, we have independent measures (i.e. it is a between-subjects variable): there are two levels of this IV, male and female. A two-way mixed-design ANOVA (with independent measures on sex and repeated measures on caffeine consumption) is the appropriate test in these circumstances.

1. Entering the Data:

As with the previous repeated-measures ANOVA's in SPSS, we have to use a separate column for each condition of the repeated-measures variable (caffeine consumption in this example),. We also have to include a column containing code-numbers that tell SPSS which group of the independent-measures variable each subject belongs to. In this example, our data might look like this:

see screen one

The first column, "subject", is merely to remind you there is one row per subject. The next three columns, "lowcaff", "medcaff" and "highcaff", contain each subject's memory-test score for the low-, medium- and high-caffeine consumption conditions respectively. The final column, "sex", tells SPSS the sex of each subject, (I've used "1" to signify "male" , and "2" to designate "female").

Running the ANOVA:

Having entered your data, do the following.

(a) Click on "Analyze"; then click on "General Linear Models"; then click on "Repeated Measures". The "Repeated Measures Define Factor(s) dialog box appears (the same one as you used to perform one-way and two-way repeated measures ANOVA's).

(b) For each of your repeated-measures IV's, you have to make entries in this box. You have to tell SPSS the name of each repeated-measures IV, and how many levels it has, in just the same way as you would for previous repeated-measures ANOVA's.

In our example, we have just one repeated-measures IV: caffeine consumption. Replace the words "factor 1" with a more meaningful name that describes the variable - for example, "caffeine". Then enter the number of levels in the next box down. We have three levels of caffeine consumption, so we enter a "3" in the box. Now click on the button labelled "Add", and SPSS will put a brief summary of this IV into the box beside the button. In this case, SPSS will put "caffeine(3)" into the box.

(c) Now we have to tell SPSS which columns contain the data needed for the repeated-measures variable in our ANOVA. Click on the button labelled "Define". The "Repeated Measures Define Factor(s)" dialog box disappears, and is replaced with the "Repeated Measures " dialog box.

On the left-hand side of the dialog box is a box containing the names of the columns in your SPSS data-window. On the right-hand side, is a box which contains empty slots (shown as _?_[1] for example).. Move each of the column names for your repeated-measures variable, on the left, into its correct slot on the right.

Take the top slot in the right-hand box: it's got [1] next to it. This means that this is the slot for the name of the column that contains the data for the first level of your repeated-measures IV. In our example, this means the column labelled "lowcaff", which contains the data for " low caffeine consumption".The next slot, [2], is for "medcaff", as this contains the data for " medium caffeine consumption". The third slot, [3]. is for "highcaff" (the data for high caffeine consumption). For each highlighted slot, click on the appropriate column name; then click on the arrow-button between the boxes, to enter the column name into the slot. Do this for each slot in turn. All this is pretty much as in previous repeated-measures ANOVA's.

(d) Now we have to deal with the independent-measures IV: "sex" in this case. Click on the name of the independent-measures IV , in the list in the left-hand box. Then click on the arrow-button next to the box labelled "Between-Subjects Factor(s)", to move the label into that box.

(e) If your between-subjects factor (sex) had more than two levels you could have asked SPSS to perform a Student-Newman Keuls post hoc test by clicking on "Post hoc…". But in this case, we do not need post hoc tests for sex so we do not click here.

(f) To produce some post hoc tests for our repeated measures factor, we click on "Contrasts…", and then the arrow to select "Repeated". Then "Change" and "Continue".

(g) Next we click on "Options…", "Descriptive Statistics", "Continue".

(h) Finally, click "OK" for SPSS to run the analysis.

The SPSS Output:

General Linear Model

[You can ignore this table of multivariate tests.]

[Next we get the sphericity test for any repeated measures factor. It is non-significant for our repeated measures variable, so the sphericity assumption is satisfied, and we do not have to worry about the Huyn-Feldt correction.]

[Here's the interesting bit: the effects of the repeated-measures IV as a main effect, and in interaction with the independent-measures IV. We use the rows labelled "Sphericity Assumed". Here, we have a highly significant effect of caffeine consumption. There is no significant interaction between sex of subject and caffeine consumption.


[Next, post hoc tests for the repeated measures effects. Ignore the rows to do with the interaction. For the main effect of caffeine, the low and medium doses did not differ significantly, but the medium dose differed from the high dose.]

[Finally, the results for the independent-measures IV, which in this case was sex of subject. In this example, there is a highly significant main effect of sex of subject. "Intercept" refers to whether the overall mean for the memory score is above zero.]


Overall, females scored higher on the memory test than males (main effect of subjects' sex: F(1, 10) = 15.33, p=0.003). Increased caffeine consumption improved memory scores for both males and females (main effect of caffeine consumption: F(2, 20) = 12.84, p<0.0005). The interaction between sex and caffeine consumption failed to reach statistical significance, F(1, 20) = 3.12, p =.066.

Post hoc tests

In this type of mixed design, as for the pure between subjects and pure repeated measures cases, one may wish to conduct post hoc tests to explore the pattern of significant main effects or interactions.

(a) Main effects. For the main effect of gender, post hoc tests do not apply because it only has two levels. For the main effect of caffeine, we could, as before, perform all possible pair-wise comparisons if we wanted more than the tests provided by SPSS above. That is, averaging over gender, we could compare low with medium, low with high, and medium with high. To compare low with medium, run a two-way mixed ANOVA, following the same procedure as above, but entering only two levels for caffeine, namely the low and the medium. Enter sex as a between-subjects variable as before. In the output you are ONLY interested in the main effect of caffeine, you IGNORE all other effects. Repeat the procedure to test low against high, and then again to compare medium against high.

(b) Interaction effect. A significant interaction could be broken down in two ways: (1) The simple effect of caffeine for males and the simple effect of caffeine for females; or (2) the effect of sex for low doses of caffeine, the effect of sex for medium doses, and the effect of sex for high doses.

For the first way, go to the "Data" menu on the main menu bar at the top of the screen. Click on "Select cases". Click on "If condition is satisfied". The "If…" below it will then turn from faded to bold. Click on "If…". Enter "sex = 1" in the dialog box. Click "Continue", then "OK". Now any further analyses by SPSS will only be on the data where sex = 1; i.e. only for the males. Now if you run a one-way repeated measures ANOVA with caffeine as your independent variable, it will be the simple effect of caffeine for males. Change the selection in "select cases" to females to find the simple effect of caffeine for females.

For the second way of breaking down the interaction, perform either an unrelated t-test or a between-subjects one-way ANOVA (as per the first module) using LOWCAFF as your dependent variable and sex as your independent variable. Repeat using MEDCAFF as your dependent variable, and then finally HIGHCAFF.