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:
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.
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 here, or more specifically, learn how we help with testing assumptions here.
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.
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.
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 here. Alternately, we have a generic, "quick start" guide to show you how to enter data into SPSS Statistics, available here.
The 16 steps below show 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 16 steps, we show you how to interpret the results 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 help you do this in our enhanced content (see here).
Click Analyze > General Linear Model > Repeated Measures... on the top menu, as shown below:
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:
Published with written permission from SPSS Statistics, IBM Corporation.
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 groups 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, just keep your eyes peeled later on when transferring the variables.
Published with written permission from SPSS Statistics, IBM Corporation.
Click the button and you will get the following screen:
Published with written permission from SPSS Statistics, IBM Corporation.
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 "3" into the Number of Levels: box, which represents the pre-, mid- and post-trial time points. Then, click the button. You will end up with the screen below:
Published with written permission from SPSS Statistics, IBM Corporation.
Published with written permission from SPSS Statistics, IBM Corporation.
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 the top 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.
Published with written permission from SPSS Statistics, IBM Corporation.
Published with written permission from SPSS Statistics, IBM Corporation.
Transfer treatment from the Factors: box to the Separate Lines: box and time into the Horizontal Axis: box, as shown below:
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).
Published with written permission from SPSS Statistics, IBM Corporation.
Published with written permission from SPSS Statistics, IBM Corporation.
Select Studentized from the –Residuals– area, as shown below:
Published with written permission from SPSS Statistics, IBM Corporation.
Published with written permission from SPSS Statistics, IBM Corporation.
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 the 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:. 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:
Published with written permission from SPSS Statistics, IBM Corporation.
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 here. 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 here.