Login

Two-way repeated measures ANOVA using SPSS Statistics

Introduction

A two-way repeated measures ANOVA (also known as a two-factor repeated measures ANOVA, two-factor or two-way ANOVA with repeated measures, or within-within-subjects ANOVA) compares the mean differences between groups that have been split on two within-subjects factors (also known as independent variables). A two-way repeated measures ANOVA is often used in studies where you have measured a dependent variable over two or more time points, or when subjects have undergone two or more conditions (i.e., the two factors are "time" and "conditions"). The primary purpose of a two-way repeated measures ANOVA is to understand if there is an interaction between these two factors on the dependent variable. Take a look at the examples below:

  • Example #1
  • Example #2

Imagine that a health researcher wants to help suffers of chronic back pain reduce their pain levels. The researcher wants to find out whether one of two different treatments is more effective at reducing pain levels. Therefore, 30 participants take part in the experiment. The two treatments, known as "conditions", are a "massage programme" (treatment A) and "acupuncture programme" (treatment B). Both programmes last 8 weeks. Therefore, the dependent variable is "back pain", whilst the two factors are the "conditions" (i.e., two groups: "treatment A", the massage programme, and "treatment B", the acupuncture programme) and "time" (i.e., back pain at three time points, which are our three groups: "at the beginning of the programme", "midway through the programme" and "at the end of the programme").

All 30 participants undergo treatment A and treatment B. However, the order in which they receive this differs, with the 30 employees being randomly split into two groups: (a) 15 participants first undergo treatment A and then treatment B, whilst (b) the other 15 participants start with treatment B and then undergo treatment A (i.e., this is known as counterbalancing and helps to reduce the bias that could result from the order in which a condition is provided).

At the end of the experiment, the researcher uses a two-way repeated measures ANOVA to determine whether any change in back pain (i.e., the dependent variable) is the result of the interaction between the "type of treatment" (i.e., the massage programme or acupuncture programme, which is one of our two factors) and "time" (i.e., our second factor). Irrespective of whether there is an interaction, follow-up tests can be performed to determine in more detail how the within-subjects factors affected back pain.

Imagine that an online retailer wants to improve productivity amongst packers in their order fulfillment centre. The retailer wants to find out whether providing the packers with background music improves productivity. Therefore, 200 packers take part in the experiment, which has a "control", where "no music" is played, and a "treatment", where "music" is played. However, the retailer also wants to know whether any possible increase in productivity is affected by the time that the music is played (i.e., if there was an increase in productivity when music was provided, is this a long-term increase or perhaps only due to initial novelty?). Therefore, the dependent variable is "productivity" (measured in terms of the average number of packages fulfilled), whilst the two factors are the "conditions" (i.e., two groups: "control" or "treatment") and "time" (i.e., productivity at three time points, which are our three groups: "at the beginning of the experiment", "1 week later" and "4 weeks later").

All 200 employees undergo the treatment and control. However, the order in which they receive this differs, with the 200 employees being randomly split into two groups: (a) 100 packers first undergo the control and then the treatment, whilst (b) the other 100 packers start with the treatment and then undergo the control (i.e., this is known as counterbalancing and helps to reduce the bias that could result from the order in which a condition is provided).

At the end of the experiment, the retailer uses a two-way repeated measures ANOVA to determine whether any change in productivity (i.e., the dependent variable) is the result of the interaction between the use of music (i.e., the "conditions", which is one of our factors) and "time" (i.e., our second factor). Irrespective of whether there is an interaction, follow-up tests can be performed to determine in more detail how the within-subjects factors affected back pain.

Once you have established whether there is a statistically significant interaction, there are a number of different approaches to following up the result. In particular, it is important to realize that the two-way repeated measures ANOVA is an omnibus test statistic and cannot tell you which specific groups within each factor were significantly different from each other. For example, if one of your factors (e.g., "time") has three groups (e.g., the three groups are your three time points: "time point 1", "time point 2" and "time point 3"), the two-way repeated measures ANOVA result cannot tell you whether the values on the dependent variable were different for one group (e.g., "Time point 1") compared with another group (e.g., "Time point 2"). It only tells you that at least two of the groups were different. Since you may have three, four, five or more groups in your study design, as well as two factors, determining which of these groups differ from each other is important. You can do this using post hoc tests, which we discuss later in this guide. In addition, where statistically significant interactions are found, you need to determine whether there are any "simple main effects", and if there are, what these effects are (again, we discuss later in our guide).

If you are unsure whether a two-way repeated measures ANOVA is appropriate, you may also want to consider how it differs from a one-way repeated measures ANOVA and a mixed ANOVA. A two-way repeated measures ANOVA goes further than a one-way repeated measures ANOVA, which only has one factor (i.e., one independent variable). For example, a one-way repeated measures ANOVA could be used when you only wanted to know whether there was a difference in chronic back pain before and after a back rehabilitation course (i.e., you only have one factor, which is "time", where you are comparing two groups, namely the two time points: "before" and "after" the back rehabilitation course). You should also distinguish between the two-way repeated measures ANOVA and the mixed ANOVA. A mixed ANOVA is very similar to a two-way repeated measures ANOVA because both of these statistical tests involve two factors (often "time" and some kind of "condition"), as well as a desire to understand whether there is an interaction between these two factors on the dependent variable. However, the fundamental difference is that in a mixed ANOVA, the subjects that undergo each condition (e.g., a control and treatment) are different, whereas in a two-way repeated measures ANOVA, the subjects undergo both conditions (e.g., they undergo the control and the treatment). Therefore, if you think that the two-way repeated measures ANOVA is not the test you are looking for, you may want to consider a one-way repeated measures ANOVA or mixed ANOVA. Alternately, if neither of these are appropriate, you can use our Statistical Test Selector, which is part of our enhanced content, to determine which test is appropriate for your study design.

In this "quick start" guide, we show you how to carry out a two-way repeated measures ANOVA with post hoc tests using SPSS Statistics, as well as the steps you will need to go through to interpret the results from this test. However, before we introduce you to this procedure, you need to understand the different assumptions that your data must meet in order for a two-way repeated measures ANOVA to give you a valid result. We discuss these assumptions next.

SPSS Statistics

Assumptions

When you choose to analyse your data using a two-way repeated measures ANOVA, part of the process involves checking to make sure that the data you want to analyse can actually be analysed using a two-way repeated measures ANOVA. You need to do this because it is only appropriate to use a two-way repeated measures ANOVA if your data "passes" five assumptions that are required for a two-way repeated measures ANOVA to give you a valid result. In practice, checking for these assumptions requires you to use SPSS Statistics to carry out a few more tests, as well as think a little bit more about your data, but it is not a difficult task.

Before we introduce you to these five assumptions, do not be surprised if, when analysing your own data using SPSS Statistics, one or more of these assumptions is violated (i.e., not met). This is not uncommon when working with real-world data rather than textbook examples. However, even when your data fails certain assumptions, there is often a solution to try and overcome this. First, let’s take a look at these five assumptions:

You can check assumptions #3, #4 and #5 using SPSS Statistics. Just remember that if you do not run the statistical tests on these assumptions correctly, the results you get when running a two-way repeated measures ANOVA might not be valid. This is why we dedicate a number of sections in our enhanced guides to help you get this right. You can find out about our enhanced content as a whole on our Features: Overview page, or more specifically, learn how we help with testing assumptions on our Features: Assumptions page.

In the section, Procedure, we illustrate the SPSS Statistics procedure that you can use to carry out a two-way repeated measures ANOVA on your data. First, we introduce the example that is used in this guide.

Testimonials
TAKE THE TOUR


SPSS Statistics

Example

A researcher was interested in discovering whether a short-term (2-week) high-intensity exercise-training programme can elicit reductions in a marker of heart disease called C-Reactive Protein (CRP). To answer this question, the researcher recruited 12 subjects and had them perform two trials/treatments – a control trial and an intervention trial – which were counterbalanced and with sufficient time between trials to allow for residual effects to dissipate. In the control trial, subjects continued their normal activities, whilst in the intervention trial, they exercised intensely for 45 minutes each day. CRP concentration was measured three times: at the beginning, midway (one week) and at the end of the trials. For the control trial, the two within-subjects factors are time, time, and treatment (i.e., control or intervention), treatment, and the dependent variable is CRP. In variable terms, the researcher wishes to know if there is an interaction between time and treatment on CRP.

SPSS Statistics

Setup in SPSS Statistics

In our enhanced two-way repeated measures ANOVA guide, we show you how to correctly enter data in SPSS Statistics to run a two-way repeated measures ANOVA. You can learn about our enhanced data setup content on our Features: Data Setup page. Alternately, see our generic, "quick start" guide: Entering Data in SPSS Statistics.

SPSS Statistics

Test Procedure in SPSS Statistics

The General Linear Model > Repeated Measures... procedure below shows you how to analyse your data using a two-way repeated measures ANOVA in SPSS Statistics, including which post hoc test to select to determine where any differences lie, when none of the five assumptions in the previous section, Assumptions, have been violated. At the end of these steps, we explain what results you will need to interpret from your two-way repeated measures ANOVA. If you are looking for help to make sure your data meets assumptions #3, #4 and #5, which are required when using a two-way repeated measures ANOVA and can be tested using SPSS Statistics, we show you how to do this in our enhanced content (see our Features: Overview page to learn more).

Since some of the options in the General Linear Model > Repeated Measures... procedure changed in SPSS Statistics version 25, we show how to carry out a two-way repeated measures ANOVA in SPSS Statistics version 25 and above (which includes the subscription version of SPSS Statistics) and version 24 and earlier.

Note: If you are unsure which version of SPSS Statistics you are using, see our guide: Identifying your version of SPSS Statistics.

SPSS Statistics version 25 and above
(which includes the subscription version of SPSS Statistics)
  1. Click Analyze > General Linear Model > Repeated Measures... on the top menu, as shown below:
    Menu for the two-way repeated measures ANOVA in SPSS Statistics

    Published with written permission from SPSS Statistics, IBM Corporation.


    You will be presented with the Repeated Measures Define Factor(s) dialogue box, as shown below:
    'Repeated Measures Define Factor(s)' dialogue box for the two-way repeated measures ANOVA in SPSS Statistics

    Published with written permission from SPSS Statistics, IBM Corporation.

  2. In the Within-Subject Factor Name: box, replace "factor1" with the name of your first within-subject factor. In this example, replace it with the name "treatment" because this reflects the first within-subject factor, treatment. Enter into the Number of Levels: box the number of treatments (i.e., the number of levels of the within-subject factor). In this case, enter "2", which represents the control and intervention trials.

    Note: It does not matter which within-subject factor is entered first.

    'Repeated Measures Define Factor(s)' dialogue box for the two-way repeated measures ANOVA in SPSS. 'treatment' & '2' entered

    Published with written permission from SPSS Statistics, IBM Corporation.


    Click on the add button and you will get the following screen:
    'Repeated Measures Define Factor(s)' dialogue box for the two-way repeated measures ANOVA in SPSS. 'treatment(2)' added

    Published with written permission from SPSS Statistics, IBM Corporation.

  3. Enter a name for the second within-subjects factor into the Within-Subject Factor Name: box. In this example, enter "time", which represents the variable time. Enter into the Number of Levels: box the number of time points (i.e., the number of levels of the within-subject factor). In this case, enter "3", which represents the beginning, midway and end time points. Then, click on the add button. You will end up with the screen below:
    'Repeated Measures Define Factor(s)' dialogue box. Two-way repeated measures ANOVA in SPSS. 'time' & '3' entered & added

    Published with written permission from SPSS Statistics, IBM Corporation.

  4. Click on the define button and you will be presented with the Repeated Measures dialogue box, as shown below:
    'Repeated Measures' dialogue box for a two-way repeated measures ANOVA in SPSS Statistics. Variables on the left

    Published with written permission from SPSS Statistics, IBM Corporation.

  5. Transfer all the variables into the Within-Subjects Variables (treatment,time): box by highlighting all the variables (clicking on them whilst holding down the shift-key) in the left-hand box and clicking on the top right arrow button. You will end up with the following screen:

    Note: The bracketed information – i.e., (treatment,time) – tells you how the variables should be entered. For example, (1,3) means level one of treatment (intervention) and level 3 of time (post), which is represented by the variable int_3.

    'Repeated Measures' dialogue box for a two-way repeated measures ANOVA in SPSS Statistics. Variables transferred on the right

    Published with written permission from SPSS Statistics, IBM Corporation.

  6. Click on the plots button and you will be presented with the Repeated Measures: Profile Plots dialogue box, as shown below:
    'Repeated Measures: Profile Plots' dialogue box. Two-way repeated measures ANOVA in SPSS. 'treatment' & 'time' on the left

    Published with written permission from SPSS Statistics, IBM Corporation.

  7. Transfer treatment from the Factors: box to the Separate Lines: box and time into the Horizontal Axis: box, as shown below:
    'Repeated Measures: Profile Plots' dialogue box. Two-way repeated measures ANOVA in SPSS. 'treatment' & 'time' transferred

    Published with written permission from SPSS Statistics, IBM Corporation.

    Note: This particular setup works well for this example. However, which within-subject factor takes the role of the horizontal axis and which the separate lines for your study is up to you (i.e., whatever makes the most sense to you).

  8. Click on the add button and this will add this plot, labelled "time*treatment", into the Plots: box, as shown below:
    'Repeated Measures: Profile Plots' dialogue box. Two-way repeated measures ANOVA SPSS. 'time*treatment' added to 'Plots' box

    Published with written permission from SPSS Statistics, IBM Corporation.

  9. Click on the Continue button. You will be returned to the Repeated Measures dialogue box.
  10. Click on the EM Means button and you will be presented with the Repeated Measures: Estimated Marginal Means dialogue box, as shown below:
    'Repeated Measures: Estimated Marginal Means' dialogue box for the two-way repeated measures ANOVA in SPSS Statistics

    Published with written permission from SPSS Statistics, IBM Corporation.

  11. Transfer treatment, time and treatment*time from the Factor(s) and Factor Interactions: box to the Display Means For: box by highlighting them and clicking on the right arrow button. This will activate the Compare main effects checkbox (i.e., it will no longer be grayed out). Tick this checkbox and select Bonferroni from the drop-down menu under Confidence interval adjustment:. You will be presented with the following screen:
    'Repeated Measures: Estimated Marginal Means' dialogue box. Two-way repeated measures ANOVA in SPSS. Variables transferred

    Published with written permission from SPSS Statistics, IBM Corporation.

  12. Click on the Continue button. You will be returned to the Repeated Measures dialogue box.
  13. Click on the Save button and you will be presented with the Repeated Measures: Save dialogue box, as shown below:
    'Repeated Measures: Save' dialogue box for the two-way repeated measures ANOVA in SPSS. No options selected by default

    Published with written permission from SPSS Statistics, IBM Corporation.

  14. Select Studentized from the –Residuals– area, as shown below:
    'Repeated Measures: Save' dialogue box. Two-way repeated measures ANOVA in SPSS. 'Studentized' selected in 'Residuals' area

    Published with written permission from SPSS Statistics, IBM Corporation.

  15. Click on the Continue button. You will be returned to the Repeated Measures dialogue box.
  16. Click on the Options button and you will be presented with the Repeated Measures: Options dialogue box, as shown below:
    'Repeated Measures: Options' dialogue box for the two-way repeated measures ANOVA in SPSS Statistics

    Published with written permission from SPSS Statistics, IBM Corporation.

  17. In the –Display– area, tick the Descriptive statistics and Estimates of effect size checkboxes, as shown below:
    'Repeated Measures: Options' dialogue box. Two-way repeated measures ANOVA in SPSS Statistics. Options selected

    Published with written permission from SPSS Statistics, IBM Corporation.

  18. Click on the Continue button. You will be returned to the Repeated Measures dialogue box.
  19. Click on the OK button.

Now that you have run the General Linear Model > Repeated Measures... procedure to carry out a two-way repeated measures ANOVA, go to the Interpreting Results section. You can ignore the section below, which shows you how to carry out a two-way repeated measures ANOVA if you have SPSS Statistics version 24 or earlier.

Join the 10,000s of students, academics and professionals who rely on Laerd Statistics.TAKE THE TOUR
SPSS Statistics version 24 and earlier
  1. Click Analyze > General Linear Model > Repeated Measures... on the top menu, as shown below:
    Menu for the two-way repeated measures ANOVA in SPSS Statistics

    Published with written permission from SPSS Statistics, IBM Corporation.


    You will be presented with the Repeated Measures Define Factor(s) dialogue box, as shown below:
    'Repeated Measures Define Factor(s)' dialogue box for the two-way repeated measures ANOVA in SPSS Statistics

    Published with written permission from SPSS Statistics, IBM Corporation.

  2. In the Within-Subject Factor Name: box, replace "factor1" with the name of your first within-subjects factor. In this example, replace it with the name "treatment", as this reflects the first within-subjects factor, treatment. Enter into the Number of Levels: box the number of treatments (i.e., the number of levels of the within-subjects factor). In this case, enter "2", which represents the control and intervention trials.

    Note: It does not matter which within-subjects factor is entered first.

    'Repeated Measures Define Factor(s)' dialogue box for the two-way repeated measures ANOVA in SPSS. 'treatment' & '2' entered

    Published with written permission from SPSS Statistics, IBM Corporation.


    Click on the Add button and you will get the following screen:
    'Repeated Measures Define Factor(s)' dialogue box for the two-way repeated measures ANOVA in SPSS. 'treatment(2)' added

    Published with written permission from SPSS Statistics, IBM Corporation.

  3. Enter a name for the second within-subjects factor into the Within-Subject Factor Name: box. In this example, enter "time", which represents the variable time. Enter into the Number of Levels: box the number of time points (i.e., the number of levels of the within-subject factor). In this case, enter "3", which represents the beginning, midway and end time points. Then, click on the Add button. You will end up with the screen below:
    'Repeated Measures Define Factor(s)' dialogue box. Two-way repeated measures ANOVA in SPSS. 'time' & '3' entered & added

    Published with written permission from SPSS Statistics, IBM Corporation.

  4. Click on the Define button and you will be presented with the Repeated Measures dialogue box, as shown below:
    'Repeated Measures' dialogue box for a two-way repeated measures ANOVA in SPSS Statistics. Variables on the left

    Published with written permission from SPSS Statistics, IBM Corporation.

  5. Transfer all the variables into the Within-Subjects Variables (treatment,time): box by highlighting all the variables (clicking on them whilst holding down the shift-key) in the left-hand box and clicking on the top Right arrow button. You will end up with the following screen:

    Note: The bracketed information – i.e., (treatment,time) – tells you how the variables should be entered. So, for example, (1,3) means group one of treatment (intervention) and group 3 of time (post) which is represented by the variable int_3.

    'Repeated Measures' dialogue box for a two-way repeated measures ANOVA in SPSS Statistics. Variables transferred on the right

    Published with written permission from SPSS Statistics, IBM Corporation.

  6. Click on the Plots button and you will be presented with the Repeated Measures: Profile Plots dialogue box, as shown below:
    'Repeated Measures: Profile Plots' dialogue box. Two-way repeated measures ANOVA in SPSS. 'treatment' & 'time' on the left

    Published with written permission from SPSS Statistics, IBM Corporation.

  7. Transfer treatment from the Factors: box to the Separate Lines: box and time into the Horizontal Axis: box, as shown below:
    'Repeated Measures: Profile Plots' dialogue box. Two-way repeated measures ANOVA in SPSS. 'treatment' & 'time' transferred

    Published with written permission from SPSS Statistics, IBM Corporation.

    Note: This particular setup works well for this example. However, which within-subjects factor takes the role of the horizontal axis and which the separate lines for your study is up to you (i.e., whatever makes the most sense to you).

  8. Click on the Add button and this will add this plot, labelled "time*treatment", into the Plots: box, as shown below:
    'Repeated Measures: Profile Plots' dialogue box. Two-way repeated measures ANOVA SPSS. 'time*treatment' added to 'Plots' box

    Published with written permission from SPSS Statistics, IBM Corporation.

  9. Click on the Continue button. You will be returned to the Repeated Measures dialogue box.
  10. Click on the Save button and you will be presented with the Repeated Measures: Save dialogue box, as shown below:
    'Repeated Measures: Save' dialogue box for the two-way repeated measures ANOVA in SPSS. No options selected by default

    Published with written permission from SPSS Statistics, IBM Corporation.

  11. Select Studentized from the –Residuals– area, as shown below:
    'Repeated Measures: Save' dialogue box. Two-way repeated measures ANOVA in SPSS. 'Studentized' selected in 'Residuals' area

    Published with written permission from SPSS Statistics, IBM Corporation.

  12. Click on the Continue button. You will be returned to the Repeated Measures dialogue box.
  13. Click on the Options button and you will be presented with the Repeated Measures: Options dialogue box, as shown below:
    'Repeated Measures: Options' dialogue box for the two-way repeated measures ANOVA in SPSS Statistics

    Published with written permission from SPSS Statistics, IBM Corporation.

  14. Transfer treatment, time and treatment*time from the Factor(s) and Factor Interactions: box to the Display Means For: box by highlighting them and clicking on the Right arrow button. This will activate the Compare main effects checkbox (i.e., it will no longer be grayed out). Tick this checkbox and select Right arrow from the drop-down menu under Confidence interval adjustment:. Then, in the –Display– area, tick the Descriptive statistics and Estimates of effect size checkboxes. After you have done all this, you will be presented with the following screen:
    'Repeated Measures: Options' dialogue box. Two-way repeated measures ANOVA in SPSS. Variables transferred & options selected

    Published with written permission from SPSS Statistics, IBM Corporation.

  15. Click on the Continue button. You will be returned to the Repeated Measures dialogue box.
  16. Click on the OK button. This will generate the output.
Testimonials
TAKE THE TOUR


SPSS Statistics

Analysing the Output from a Two-Way Repeated Measures ANOVA

The output generated by SPSS Statistics is quite extensive and can provide a lot of information about your analysis. However, if there was not a statistically significant interaction between your two factors on the dependent variable, you will need to carry out some additional steps in SPSS Statistics. Below we briefly explain the main steps that you will need to follow to interpret your two-way repeated measures ANOVA results, and where required, perform additional analysis in SPSS Statistics. If you want to be taken through all these sections step-by-step, together with the relevant SPSS Statistics output, we do this in our enhanced two-way repeated measures ANOVA guide. You can learn more about our enhanced content in general on our Features: Overview page. First, take a look through these steps:

If you are unsure how to interpret your two-way repeated measures results, or how to check for the assumptions of the two-way repeated measures ANOVA, carry out transformations using SPSS Statistics, or conduct additional SPSS Statistics procedures to run simple main effects on your data (see Step #3a), we show you how to do this in our enhanced two-way repeated measures ANOVA guide. We also show you how to write up the results from your assumptions tests and two-way repeated measures ANOVA output if you need to report this in a dissertation/thesis, assignment or research report. We do this using the Harvard and APA styles. You can learn more about our enhanced content on our Features: Overview page.

Join the 10,000s of students, academics and professionals who rely on Laerd Statistics.TAKE THE TOUR
1