5.3.3 Two Way ANOVA

Summary

In some cases, we want to examine the relationship between two factors (categorical variables) and a continuous outcome variable. The effects on the outcome of the change in one factor may depend on the level of the other factor, so we need to consider the interactions between two factors. Two way ANOVA is an appropriate method to analyze the main effects of and interactions between two factors.

Minimum Origin Version Required: Origin 2016 SR0

What you will learn

This tutorial will show you how to:

  • Perform Two-way ANOVA
  • Interpret results from Two-Way ANOVA
  • Make the Interaction Plot

Steps

Researchers are interested in the effects of sex and dietary group on systolic blood pressure (SBP) The "dietary group" factor includes three groups: strict vegetarians (SV) who eat no animal products of any kind; lacto vegetarians (LV) who eat dairy products but no other animal products; and "normal" (NOR) subjects who eat a standard American diet. Sex and dietary group may be independent or they may interact with each other. One approach to solve this problem is to construct a two-way ANOVA model predicting mean SBP level.

Indexed data mode

Perform Two Way ANOVA

  1. Start with a new workbook and import the file \Samples\Statistics\SBP_Index.dat.
  2. Open the Two-Way ANOVA dialog by choosing the menu item Statistics: ANOVA: Two-Way ANOVA, then in the Input tab, set the Input Data mode as Indexed.
  3. Also in the Input tab, select column A,B and C for Factor A,Factor B and Data, respectively. Check the Interactions box.
    DOC-2411 TwoANOVA06a Magenta.png
  4. In the Descriptive statistics tab, check all boxes.
  5. In the Means Comparison tab, set Significance Level to 0.05, and check the box beside Tukey to select this test as the means comparison method.
    DOC-2411 TwoANOVA06b Magenta.png
  6. Click the OK button to perform Two-Way ANOVA.

Interpreting Results

TwoANOVA13.png

From the "Overall ANOVA" table in the Two-Way ANOVA result sheet, we can see that Dietary and Sex are both significant factors, but the interaction between them is not significant. So we can say that the main effects of both Dietary groups and Sex are significant, yet the effect on the outcome of the change in Dietary doesn't depend on the level of Sex.

The Interaction Plot

To further detect interaction, we can make an "Interaction Plot" using the following steps.

  1. Right-click on the title of the "Interaction" table and select Create Copy as a new sheet from the context menu.
    TwoANOVA07.png
  2. Go to the new sheet and right-click on column B and select Set As Categorical from the fly-out menu.
  3. Select the first three cells in column D and then press the Ctrl key and select the other cells in column D.
    TwoANOVA08.png
  4. Click the Button Line And Symbol.png button on the 2D Graphs toolbar to create a graph.
  5. Right-click on the graph legend and select Properties from the context menu. In the Object Properties dialog box, edit the text as shown below. Click the OK button to close the dialog box and update the legend. We now have an Interaction Plot which can show the interaction between two factors.
\l(1) Male
\l(2) Female
TwoANOVA11.png

The data plots in the chart above suggest only a weak interaction between Sex and Dietary, so we should recalculate the effects of the two factors without interaction.

Recalculate

  1. Click on the green lock in the ANOVA2Way1 result sheet, and select Change Parameters to open the dialog again.
    TwoANOVA12.png
  2. In the Input tab in the open dialog, clear the interactions box and click the OK button.
DOC-2411 TwoANOVA17a Magenta.png

We can see that the Dietary and Sex are significant factors from the "Overall ANOVA" table. The mean of Nor is significantly greater than that of LV and SV for factor Dietary. The mean of Male is significantly greater than that of Female, from the "Dietary" table.

TwoANOVA14.png
TwoANOVA15.png

Raw Data Mode

  1. Start with a new workbook and import the file \Samples\Statistics\SBP_Raw.dat
  2. Highlight all columns and select menu item Statistics : ANOVA : Two-Way ANOVA to bring up the ANOVATwoWay dialog box. In the Input tab, choose Raw as the Input Data mode.
  3. Also in the Input tab, set Number of levels of Factor A as 2 and type Sex ,Male and Female for Name,Level1 Name and Level2 Name in Factor A branch ,respectively.
  4. Also in the Input tab, set Number of levels of Factor B as 3, and type Dietary Group ,SV ,LV and Nor for Name,Level1 Name, Level2 Name and Level3 Name in Factor A branch, respectively.
    DOC-2411 TwoANOVA05a Magenta.png
  5. In the Means Comparison tab, set Significance Level to 0.05, and check the box beside Tukey to use it as the means comparison method.
  6. Click the OK button to perform Two-Way ANOVA.