The two-way ANCOVA is used to determine whether there is an interaction effect between two independent variables on a continuous dependent variable (i.e., if a two-way interaction effect exists), after adjusting/controlling for one or more continuous covariates. In many ways, the two-way ANCOVA can be considered an extension of the one-way ANCOVA to incorporate a second independent variable or an extension of the two-way ANOVA to incorporate one or more continuous covariates.
Note: It is quite common for the independent variables to be called “factors” or “between-subjects factors”, but we will continue to refer to them as independent variables in this guide. Furthermore, it is worth noting that the two-way ANCOVA is also referred to as a “factorial ANCOVA”.
Important: If you have two or more continuous covariates, there are some additional considerations when carrying out and interpreting the two-way ANCOVA. This guide is designed to help with a single continuous covariate only. Therefore, we will be adding a separate guide for a two-way ANCOVA with multiple continuous variables. If this is of interest, please contact us and we will let you know when the guide becomes available.
A two-way ANCOVA can be used in a number of situations. For example, consider an experiment where two drugs were being given to elderly patients to treat heart disease. One of the drugs was the current drug being used to treat heart disease and the other was an experimental drug that the researchers wanted to compare to the current drug. The researchers also wanted to understand how the drugs compared in low and high risk elderly patients. The goal was for the drugs to lower cholesterol concentration in the blood. The patients were of varying ages and the researchers wanted to control for these differences. Therefore, the two independent variables were drug (i.e., with two groups: “Current” and “Experimental”) and risk (i.e., with two levels: “Low” and “High”). The dependent variable was cholesterol (i.e., cholesterol concentration in the blood) and the continuous covariate was age. The researchers wanted to know: (a) whether the experimental drug was better or worse than the current drug at lowering cholesterol; and (b) whether the effect of the two drugs was different depending on whether elderly patients were classified as at low or high risk. These two aims are entirely typical of a two-way ANCOVA analysis. Importantly, the researchers’ second aim is answered by determining whether there is a statistically significant interaction effect. This is usually given first priority in a two-way ANCOVA analysis because its result will determine whether the researchers’ first aim is misleading or incomplete. Assuming that a statistically significant interaction effect is found, this indicates that the two drugs have different effects in low and high risk elderly patients (i.e., the effect of drug on cholesterol depends on the level of risk), after adjusting for age. Depending on whether you find a statistically significant interaction, and the type of interaction you have, will determine which effects in the two-way ANCOVA you should interpret and any post hoc tests you may want to run. These issues are explained as you work through the guide so that you know what each statistical test is telling you and how to write up your results accurately.
Note: A two-way ANCOVA can be described by the number of groups in each independent variable. For example, if you had a two-way ANCOVA with gender (having two groups: “male” and “female”) and transport type (having three groups: “bus”, “train” and “car”) as the independent variables, and salary as a covariate, you could describe this as a 2 x 3 ANCOVA. Alternatively, a two-way ANCOVA with three groups in one independent variable and five groups in the other independent variable could be described as a 3 x 5 ANCOVA. This is a fairly generic way to describe ANCOVAs with two or more independent variables.
In order to run a two-way ANCOVA, there are 10 assumptions that need to be considered. The first four assumptions relate to your choice of study design and the measurements you chose to make, whilst the remaining six assumptions relate to how your data fits the two-way ANCOVA model. These assumptions are:
- Assumption #1: You have one dependent variable that is measured at the continuous level (i.e., the interval or ratio level). Examples of continuous variables include height (measured in metres and centimetres), temperature (measured in °C), salary (measured in US dollars), revision time (measured in hours), intelligence (measured using IQ score), firm size (measured in terms of the number of employees), age (measured in years), reaction time (measured in milliseconds), grip strength (measured in kg), weight (measured in kg), power output (measured in watts), test performance (measured from 0 to 100), sales (measured in number of transactions per month), academic achievement (measured in terms of GMAT score), and so forth.
Note: You should note that SPSS Statistics refers to continuous variables as Scale variables.
- Assumption #2: You have two independent variables where each independent variable consists of two or more categorical, independent groups. A categorical variable can be either a nominal variable or an ordinal variable, but the two-way ANCOVA does not take into account the ordered nature of an ordinal variable. Examples of nominal variables include gender (with two groups: “male” and “female”), ethnicity (with three groups: “African American”, “Caucasian” and “Hispanic”), transport type (four groups: “cycle”, “bus”, “car” and “train”) and profession (five groups: “consultant”, “doctor”, “engineer”, “pilot” and “scientist”). Examples of ordinal variables include educational level (e.g., with three groups: “high school”, “college” and “university”), physical activity level (e.g., with four groups: “sedentary”, “low”, “moderate” and “high”), revision time (e.g., with five groups: “0-5 hours”, “6-10 hours”, “11-15 hours”, “16-20 hours” and “21-25 hours”), Likert items (e.g., a 7-point scale from “strongly agree” through to “strongly disagree”), amongst other ways of ranking categories (e.g., a 5-point scale explaining how much a customer liked a product, ranging from “Not very much” to “Yes, a lot”). Furthermore, a categorical independent variable with only two groups is known as a dichotomous variable whereas an independent variable with three or more groups is referred to as a polytomous variable. If you are unfamiliar with any of the terms above, you might want to read our Types of Variables guide.
Explanation 1: The “groups” of the independent variable are also referred to as “categories” or “levels”, but the term “levels” is usually reserved for groups that have an order (e.g., fitness level, with three levels: “low”, “moderate” and “high”). However, these three terms – “groups”, “categories” and “levels” – can be used interchangeably. We will mostly refer to them as groups, but in some cases we will refer to them as levels. The only reason we do this is for clarity (i.e., it sometimes sounds more appropriate in a sentence to use levels instead of groups, and vice versa).
Explanation 2: The independent variable(s) in any type of ANCOVA is also commonly referred to as a factor. For example, a two-way ANCOVA is an ANCOVA analysis involving two factors (i.e., two independent variables). Furthermore, when an independent variable/factor has independent groups (i.e., unrelated groups), it is further classified as a between-subjects factor because you are concerned with the differences in the dependent variable between different subjects. However, for clarity we will simply refer to them as independent variables in this guide.
Explanation 3: For the two-way ANCOVA demonstrated in this guide, the independent variables are referred to as fixed factors or fixed effects. This means that the groups of each independent variable represent all the categories of the independent variable you are interested in. For example, you might be interested in exam performance differences between schools. If you investigated three different schools and it was only these three schools that you were interested in, the independent variable is a fixed factor. However, if you picked the three schools at random and they were meant to represent all schools, the independent variable is a random factor. This requires a different statistical test because the two-way ANCOVA is the incorrect statistical test in these circumstances. If you have a random factor in your study design, please contact us and we will add an SPSS Statistics guide to help with this.
- Assumption #3: You have one covariate that is measured at the continuous level (see Assumption #1 for examples of continuous variables). A covariate is simply a continuous independent variable that is added to an ANOVA model to produce an ANCOVA model. This covariate is used to adjust the means of the groups of the categorical independent variables. It acts no differently than in a normal multiple regression, but is usually of less direct importance (i.e., the coefficient and other attributes are often of secondary importance or not at all). In a two-way ANCOVA the covariate is generally only there to provide a better assessment of the differences between the groups of the categorical independent variables on the dependent variable.
Important: You can have more than one continuous covariate in a two-way ANCOVA, but we only show you how to analyse a design with one continuous covariate in this guide. If you would like us to add an SPSS Statistics guide for the two-way ANCOVA with multiple covariates, please contact us.
Note: If your covariate is not measured on a continuous scale (e.g., your covariate is a dichotomous, ordinal or nominal variable), you will need to use a different statistical test. If you would like us to add an SPSS Statistics guide to help with this situation, please contact us, letting us know whether your covariate(s) was measured on a dichotomous, ordinal or nominal scale.
- Assumption #4: You should have independence of observations, which means that there is no relationship between the observations in each group of the independent variables or between the groups themselves. Indeed, an important distinction is made in statistics when comparing values from either different individuals or from the same individuals. Independent groups (in a two-way ANCOVA) are groups where there is no relationship between the participants in any of the groups. Most often, this occurs simply by having different participants in each group.
Note: When we talk about the observations being independent, this means that the observations (e.g., participants) are not related. Specifically, it is the errors that are assumed to be independent. In statistics, errors that are not independent are often referred to as correlated errors. This can lead to some confusion because of the similarity of the name to tests of correlation (e.g., Pearson’s correlation), but correlated errors simply means that the errors are not independent. The errors are at high risk of not being independent if the observations are not independent.
For example, if you split a group of individuals into four groups based on their physical activity level (e.g., a “sedentary” group, “low” group, “moderate” group and “high” group), no one in the sedentary group can also be in the high group, no one in the moderate group can also be in the high group, and so forth. As another example, you might randomly assign participants to either a control trial or one of two interventions. Again, no participant can be in more than one group (e.g., a participant in the the control group cannot be in either of the intervention groups). This will be true of any independent groups you form (i.e., a participant cannot be a member of more than one group). In actual fact, the ‘no relationship’ part extends a little further and requires that participants in different groups are considered unrelated, not just different people. Furthermore, participants in one group cannot influence any of the participants in any other group.
An example of where related observations might be a problem is if all the participants in your study (or the participants within each group) were assessed together, such that a participant’s performance affects another participant’s performance (e.g., participants encourage each other to lose more weight in a ‘weight loss intervention’ when assessed as a group compared to being assessed individually; or athletic participants being asked to complete ‘100m sprint tests’ together rather than individually, with the added competition amongst participants resulting in faster times, etc.). This can occur when you have tested individuals in blocks (e.g., 10 participants at a time) to make life easier for yourself or due to other constraints. However, the participants in each block might provide more similar results than those from other blocks. Participants might also be considered related due to their inherent or preselected attributes. For example, your sample may consist of twins or a husband and wife, and yet you may have considered them to be unrelated when they should be considered related. Alternately, you have repeatedly tested the same participant and not expected him or her to react more similarly than another participant.
Independence of observations is largely a study design issue rather than something you can test for using SPSS Statistics, but it is an important assumption of the two-way ANCOVA. If your study fails this assumption, you will need to use another statistical test instead of the two-way ANCOVA (you can use our Statistical Test Selector to find the appropriate statistical test, but please contact us if you have any difficulty).
- Assumption #5
The covariate should be linearly related to the dependent variable for each combination of groups of the two independent variables (i.e., each cell of the design)
The first assumption you need to test is whether there is a linear relationship between the covariate, weight, and the dependent variable, cholesterol, for each cell of the design (i.e., for each combination of groups of the two independent variables: diet and exercise). In this example, there are six cells of the design, as shown below:
To test this assumption you can plot a grouped scatterplot of the dependent variable, cholesterol, against the covariate, weight, grouped on the two independent variables: diet and exercise. Furthermore, you can add a loess line to each scatterplot to make it easier to interpret whether the relationships are linear.
- Assumption #6
There should be homogeneity of regression slopes
This assumption checks that the relationship between the covariate, weight, and the dependent variable, cholesterol, as assessed by the regression slope, is the same in each cell of the design (i.e., for each combination of groups of the two independent variables: diet and exercise). Simply put, Assumption #5 assessed whether the relationships were linear; this assumption now checks that these linear relationships are the same. Stated another way, the regression lines you will plot for Assumption #5 above must be parallel (i.e., they must have the same slope). However, while the scatterplot you plotted will give you an indication of whether the slopes are parallel, you should test this assumption more formally using a statistical test of significance. One of the reasons for this is that you might not expect the lines of the scatterplot to always be parallel as they are plots of the sample data and the assumption applies to the population regression lines (i.e., you will always expect some deviation in the sample).
Note: If you are unsure about the differences between a sample and the population from which a sample is drawn, or the idea of statistically significance testing, and would like us to add a guide to explain these concepts, please contact us.
In order to test whether the slopes are different, interaction terms between the covariate and the independent variables must be added and a comparison made between the model with interaction terms and the two-way ANCOVA model without interaction terms. This is particularly tricky in SPSS Statistics because there are multiple interaction terms and SPSS Statistics does not allow you to evaluate them all at the same time, which is how this assumption is tested (Huitema, 2011). Please contact us. We will show you how to do this. We also discuss how to interpret this result and what to do if your data fails to meet this assumption.
Interpreting Results
After running the two-way ANCOVA procedures and testing that your data meets the assumptions of a two-way ANCOVA in the previous sections, SPSS Statistics will have generated a number of tables and graphs that contain all the information you need to report the results of your two-way ANCOVA analysis. We show you how to interpret these results.
There are two main steps you can follow to interpret the results of your two-way ANCOVA. First, you need to determine whether a statistically significant two-way interaction effect exists (Step 1). This starts the process of interpreting your results and will determine whether you continue your analysis by interpreting simple main effects (or interaction contrasts) and/or main effects. Both main steps are briefly explained below.
Important: We explain more about terms such as interaction effects, simple main effects, interaction contrasts and main effects in this section.
- Step 1
Do you have a statistically significant two-way interaction effect?
The primary goal of running a two-way ANCOVA is to determine whether there is an interaction effect between the two independent variables in terms of the dependent variable, after controlling for a continuous covariate (i.e., whether there is a two-way interaction effect).
For example, we want to determine whether there is an interaction effect between the two independent variables, diet and exercise, in terms of the dependent variable, cholesterol, after controlling for weight.
Since we are not distinguishing between a focal variable and a moderator variable, but are interested in both independent variables equally, we can consider a statistically significant two-way interaction effect in our example in two ways:
(a) A statistically significant two-way interaction effect indicates that the effect that diet has on cholesterol (after controlling for weight) depends on the level of exercise. In other words, the differences in cholesterol concentration that result from participants dieting or not dieting depend on whether participants also undertook low-, moderate- or high-intensity exercise; and
(b) A statistically significant two-way interaction effect indicates that the effect that exercise has on cholesterol (after controlling for weight) depends on the level of diet. In other words, the differences in cholesterol concentration that result from participants undergoing different levels of exercise-intensity (i.e., low, moderate or high levels of exercise intensity) depend on whether participants also dieted or did not diet.
Therefore:
If yes – you have a statistically significant two-way interaction effect – go to STEP 2A.
If no – you do not have a statistically significant two-way interaction effect – go to STEP 2B. - Step 2A
You have a statistically significant two-way interaction effect. Do you have any statistically significant simple main effects (or interaction contrasts)?
When the two-way interaction term is statistically significant, this indicates that the effect that one independent variable (e.g., exercise) has on the dependent variable (e.g., cholesterol) depends on the level of the other independent variable (e.g., whether a participant is in the “diet” or “no diet” group; the two groups of diet), after controlling for the continuous covariate (e.g., weight). This result is usually followed up using simple effects, more commonly known as simple main effects (Jaccard, 1998; Keppel & Wickens, 2004; Kinnear & Gray, 2010; Maxwell & Delaney, 2004) or interaction contrasts.
Note: We focus on simple main effects in this guide, but briefly discuss interaction contrasts. If you would like us to add a section to the site to show how to carry out and interpret interaction contrasts, please contact us.
In our example, there are five simple main effects. The three simple main effects of diet are:
(a) Low-intensity exercise group: The effect that dieting versus not dieting has on cholesterol concentration (after controlling for weight) in the low-intensity exercise group.
(b) Moderate-intensity exercise group: The effect that dieting versus not dieting has on cholesterol concentration (after controlling for weight) in the moderate-intensity exercise group.
(c) High-intensity exercise group: The effect that dieting versus not dieting has on cholesterol concentration (after controlling for weight) in the high-intensity exercise group.
In terms of exercise, the two simple main effects are:
(d) Diet group: The effect that undertaking low- versus moderate- versus high-intensity exercise has on cholesterol concentration (after controlling for weight) in the diet group.
(e) No diet group: The effect that undertaking low- versus moderate- versus high-intensity exercise has on cholesterol concentration (after controlling for weight) in the no diet group.
You will learn more about simple main effects, as well as when it may also be appropriate to report main effects (i.e., in addition to simple main effects).
Step 2B
You do not have a statistically significant two-way interaction effect. Do you have any statistically significant main effects?
When you do not have a statistically significant two-way interaction effect, this indicates that the effect of an independent variable (e.g., exercise) is the same for each level of the other independent variable (e.g., it is the same for the “diet” and “no diet” groups; the two groups of diet), after controlling for the continuous covariate (e.g., weight). In other words, the simple main effects, mentioned in Step 2A above, are all equal. In such circumstances, it is typical to report main effects (e.g., Howell, 2010), but there are occasions when you may also report simple main effects (Faraway, 2015; Fox, 2008; Searle, 2006).
In our example, if there was not a statistically significant two-way interaction effect, this would mean that the effect of exercise on cholesterol concentration is the same whether participants dieted or did not diet, after controlling for participants’ weight. As such, it might make sense to consider these simple main effects together and come up with an overall measure of the effect of exercise, ignoring (averaging over) diet. In other words, it does not seem to make much sense to separate out the effects for “diet” and “no diet” when they are the same. Instead, we can just consider them together. We can do this by “averaging” the simple main effects, which gives us main effects. If a main effect is statistically significant, you would typically follow up this result with a post hoc analysis (e.g., all pairwise comparisons). Therefore, in our example we have two main effects:
(a) A main effect of diet: A statistically significant main effect of diet indicates that there is a difference in the effect of diet on cholesterol (after controlling for weight) when ignoring (averaging over) the levels of exercise (i.e., taking exercise into account as a whole, but ignoring whether a participant was in the “low-“, “moderate-” or “high-intensity” exercise group). In other words, there is a difference in cholesterol concentration (after adjusting for weight) between participants who underwent the diet and no diet programmes when ignoring which exercise programme participants also underwent. Furthermore, where the independent variable that is the focus of your main effect has just two groups/levels (i.e., the main effect of diet has two groups: “diet” and “no diet”), you do not need to carry out additional pairwise comparisons to understand where the differences between the groups are (e.g., whether cholesterol concentration was higher in the group who dieted compared to the group who did not diet, or vice versa). Since there are only two groups, there can be only one pairwise comparison (i.e., a comparison of the difference in the dependent variable between those two groups, which in our example, is a comparison of the difference in cholesterol concentration between participants who “dieted” and “did not diet”). However, we suggest that you do carry out pairwise comparisons in SPSS Statistics because these provide additional statistics describing the differences between your two groups.
(b) A main effect of exercise: A statistically significant main effect of exercise indicates that there is a difference in the effect of exercise on cholesterol (after controlling for weight) when ignoring (averaging over) the levels of diet (i.e., taking diet into account as a whole, but ignoring whether a participant was in the “diet” or “no diet” group). In other words, there is a difference in cholesterol concentration (after adjusting for weight) between participants who underwent the low-, moderate- or high-intensity exercise programmes when ignoring whether participant also dieted or did not diet. Whilst a statistically significant main effect will tell us that there is a difference, when the independent variable that is the focus of your main effect has three or more groups/levels (i.e., the main effect of exercise has three levels: “low-“, “moderate-” and “high-intensity” exercise), it will not tell us where these differences are (e.g., whether cholesterol concentration was higher in the low-intensity exercise groups compared to the high-intensity exercise group, or vice versa). However, we can use pairwise comparisons to understand where these specific differences between the groups are.