SPSS » Analysis with SPSS » Two-way ANOVA

Two-way ANOVA using SPSS

Introduction

The two-way ANOVA compares the mean differences between groups that have been split on two independent variables (called factors). You need two independent, categorical variables and one continuous, dependent variable (see our guide on Types of Variable).

Assumptions

  • Dependent variable is either interval or ratio (continuous) (see our guide on Types of Variable)
  • The dependent variable is approximately normally distributed for each combination of levels of the two independent variables (see our Testing for Normality guide, which deals specifically with the two-way ANOVA).
  • Homogeneity of variances of the groups formed by the different combinations of levels of the two independent variables.
  • Independence of cases (this is a study design issue and is not addressed by SPSS).

Example

A researcher was interested in whether an individual's interest in politics was influenced by their level of education and their gender. They recruited a random sample of participants to their study and asked them about their interest in politics, which they scored from 0 - 100 with higher scores meaning a greater interest. The researcher then divided the participants by gender (Male/Female) and then again by level of education (School/College/University).

Setup in SPSS

In SPSS we separated the individuals into their appropriate groups by using two columns representing the two independent variables and labelled them "Gender" and "Edu_Level". For "Gender", we coded males as "1" and females as "2", and for "Edu_Level", we coded school as "1", college as "2" and university as "3". The participants interest in politics was entered under the variable name, "Int_Politics". To know how to correctly enter your data into SPSS in order to run a two-way ANOVA, please read our Entering Data in SPSS tutorial, where there is a specific example. The data setup can be seen in the diagram below (click image to see full data set). We have given our data text labels (see our Working with Variables guide).

Data setup for a two-way ANOVA in SPSS

Published with written permission from SPSS Inc, an IBM Company.

Testing of Assumptions

To determine whether your dependent variable is normally distributed for each combination of the levels of the two independent variables see our Testing for Normality guide that runs through how to test for normality using SPSS using a specific two-way ANOVA example. In SPSS, homogeneity of variances is tested using Levene's Test for Equality of Variances. This is included in the main procedure for running the two-way ANOVA, so we get to evaluate whether there is homogeneity of variances at the same time as we get the results from the two-way ANOVA.

Test Procedure in SPSS

  1. Click Analyze > General Linear Model > Univariate... on the top menu as shown below:
    Two-way ANOVA Menu

    Published with written permission from SPSS Inc, an IBM Company.

  2. You will be presented with the "Univariate" dialogue box:
    Two-way ANOVA Dialogue Box

    Published with written permission from SPSS Inc, an IBM Company.

  3. You need to transfer the dependent variable "Int_Politics" into the "Dependent Variable:" box and transfer both independent variables, "Gender" and "Edu_Level", into the "Fixed Factor(s):" box. You can do this by drag-and-dropping the variables into the respective boxes or by using the SPSS Continue Button button. If you are using older versions of SPSS you will need to use the former method. The result is shown below:

    [For this analysis you will not need to worry about the "Random Factor(s):", "Covariate(s):" or "WLS Weight:" boxes.]

    Two-way ANOVA Dialogue Box

    Published with written permission from SPSS Inc, an IBM Company.

  4. Click on the SPSS Plots Button button. You will be presented with the "Univariate: Profile Plots" dialogue box:
    Two-way ANOVA Plots Dialogue Box

    Published with written permission from SPSS Inc, an IBM Company.

  5. Transfer the independent variable "Edu_Level" from the "Factors:" box into the "Horizontal Axis:" box and transfer the "Gender" variable into the "Separate Lines:" box. You will be presented with the following screen:

    [Tip: Put the independent variable with the greater number of levels in the "Horizontal Axis:" box.]

    Two-way ANOVA Plots Dialogue Box

    Published with written permission from SPSS Inc, an IBM Company.

  6. Click the SPSS Add Button button.
  7. Two-way ANOVA Plots Dialogue Box

    Published with written permission from SPSS Inc, an IBM Company.

    You will see that "Edu_Level*Gender" has been added to the "Plots:" box.

  8. Click the SPSS Continue Button button. This will return you to the "Univariate" dialogue box.
  9. Click the SPSS Post-Hoc Button button. You will be presented with the "Univariate: Post Hoc Multiple Comparisons for Observed..." dialogue box as shown below:
    Two-way ANOVA Post-hoc Dialogue Box

    Published with written permission from SPSS Inc, an IBM Company.

    Transfer "Edu_Level" from the "Factor(s):" box to the "Post Hoc Tests for:" box. This will make the "Equal Variances Assumed" section become active (loose the "grey sheen") and present you with some choices for which post-hoc test to use. For this example, we are going to select "Tukey", which is a good, all-round post-hoc test.

    [You only need to transfer independent variables that have more than two levels into the "Post Hoc Tests for:" box. This is why we do not transfer "Gender".]

    You will finish up with the following screen:

    Two-way ANOVA Post-hoc Dialogue Box

    Published with written permission from SPSS Inc, an IBM Company.

    Click the SPSS Continue Button button to return to the "Univariate" dialogue box.
  10. Click the SPSS Options Button button. This will present you with the "Univariate: Options" dialogue box as shown below:
    Two-way ANOVA Options Dialogue Box

    Published with written permission from SPSS Inc, an IBM Company.

  11. Transfer "Gender", "Edu_Level" and "Gender*Edu_Level" from the "Factor(s) and "Factor Interactions:" box into the "Display Means for:" box. In the "Display" section, tick the "Descriptive Statistics" and "Homogeneity tests" options. You will presented with the following screen:
    Two-way ANOVA Options Dialogue Box

    Published with written permission from SPSS Inc, an IBM Company.

    Click the SPSS Continue Button button to return to the "Univariate" dialogue box.

  12. Click the SPSS OK Button button to generate the output.

Go to the next page for the SPSS output, simple effects analysis and an explanation of the output.

Share to Facebook Email to a Friend Share to Twitter Stumble It Delicious Digg This Yahoo MySpace Reddit More...
Other Laerd Websites Laerd Mathematics Laerd Referencing Laerd Dissertation