Chapter 15 AppendixTwo-Way Analysis of Variance with Excel, JMP, Minitab, SPSS, CrunchIt!, R, and TI-83/-84 Calculators

TA15-1

Two-way analysis of variance (ANOVA) extends one-way ANOVA to two factors. It is more efficient to study the effects of two possible factors when combined than to do two separate one-way studies. For one, combining levels of the factors into treatments allows us to determine whether they interact.

The assumptions and conditions are the same as for one-way ANOVA; check that the standard deviations of all treatment groups are within a factor of two and that each treatment combination shows a roughly Normal shape. One way to understand the (possible) structure of the data is through means plots to show whether the two factors are (relatively) independent or interact.

Means Plots and Two-Way ANOVA

image

To create the means plot, as with one-way ANOVA, copy and paste the data so each treatment combination is in a separate column.

Use Data ➔ Data Analysis ➔ Descriptive Statistics.

  1. Select the data columns with the treatment combinations as the input range. Check the box labeled “Labels” in first row (you’ll want to use those labels in your graph). Make sure the box for “Summary statistics” is checked and click “OK.”
  2. Copy and paste the group means (and labels) into a contiguous area in the spreadsheet in the form of a two-way table with levels of one factor as rows and the other as columns.
  3. image Drag to select the means table just created and Select Insert ➔ Line Plot. You can further format the chart (add titles, and so on) if you wish.

To perform the ANOVA, use Data ➔ Data Analysis ➔ ANOVA: Two-Factor with Replication (each treatment group has more than one individual in it). Here you will need another layout of the data. One factor should be in columns and the second grouped into rows. The first row should be labels for the levels of factor A. Labels for the levels of factor B should be in the first column of the data. Further, each treatment combination must contain the same number of observations.

  1. Select the input range of interest.
  2. Enter the number of observations for each group into the Rows per Sample box.
  3. Click “OK.”

For more information and examples, see the Excel Video Video Technology Manuals, Means Plots and Two-Way ANOVA.

TA15-2

image

To create a means plot, click Graph ➔ Graph Builder.

  1. Click and drag the response variable into the y axis area.
  2. Click and drag one of the factors to the x axis area.
  3. Click and drag the other factor variable into the “Overlay” area.
  4. At this point, you should see data point dots in different colors.
  5. At the left, use the drop-down to select “Mean” as the summary statistic. You should have one dot for each treatment combination.
  6. Select “Line” using the “Connect” drop-down at left. This completes the Means plot (with the possible exception of adding titles, and so on). Click “Done” when finished.

To perform the ANOVA, select Analyze ➔ Fit Model.

  1. Select and enter the response variable into the “Y” box.
  2. Select each factor and click “Add” to add them into the “Construct Model Effects” box.
  3. To add the interaction, click (use CTRL if needed) to select both factors, then click “Cross” to add that term into the “Effects.”
  4. Click “Run.” The ANOVA summary table is given just below the Summary of Fit. For the F tests on the individual factors and interaction, click the triangle next to “Effect Tests” to expand that section.

For more information and examples, see the JMP Video Technology Manuals, Means Plots and Two-Way ANOVA.

image

To create the means plot, use Stat ➔ ANOVA ➔ Interaction Plot. Click to enter the response variable and the two factor variables into their respective boxes. Use Options if you want to add a graph title or use specific axis scaling. Click “OK.”

To perform the ANOVA, use Stat ➔ ANOVA ➔ Balanced ANOVA (assuming there are the same number of observations in each treatment group).

  1. Click to enter the response variable and the two factors into their respective boxes.
  2. To add the interaction into the model enter one factor, type * (the asterisk) and enter the second factor.
  3. If you want residuals plots, select those by clicking on “Graphs.”
  4. Click “OK.”

The Minitab Video Technology Manual, Two-Way ANOVA gives more information and an example.

TA15-3

image

SPSS must have numeric group identifiers. If the grouping variables are categorical, you will have to create numeric versions. Use Transform ➔ Recode into Different Variables.

  1. Select and enter the original variable into the box.
  2. Give the new variable a name in the box labeled “Name” and click “Change.”
  3. Click “Old and New Values.”
  4. For each value of the original variable, type it into the “Old Value” box (exactly as entered) and enter a numeric value into the “New Value” box. Click “Add.” Repeat until you have assigned numeric labels to all the groups. Click “Continue” and “OK.”

To create a means plot (this can use either form of the categorical variables), use Graphs ➔ Chart Builder.

  1. Click on “image Chart Style Line” and select the plot with multiple lines. Drag it into the chart area.
  2. Drag the response variable into the y axis region.
  3. Drag one of the factor variables into the x axis region.
  4. Drag the second factor variable into the “Set color region” at upper right. At this point, you should have the basic means plot created.
  5. If desired, use Titles/Footnotes to annotate the plot. When finished, click “OK.”

To perform the ANOVA, use Analyze ➔ General Linear Model ➔ Univariate.

  1. Select and enter the response variable into the “Dependent variable” box and the two factor variables into the “Fixed Factor” box.
  2. You can also create the means plot here by clicking “Plots.” Select one factor to be on the x axis and the second factor to be represented by different lines.
  3. Click “OK” in the main dialog.

The SPSS Video Technology Manuals, Means Plots and Two-Way ANOVA, give more information and examples.

image

To create the interaction plot, use Graphics ➔ Means Plot. Use the drop-downs to select the two factors and the response (Values) variable. If desired, add a title and y axis labeling. Click “Calculate.”

To perform the ANOVA, use Statistics ➔ ANOVA ➔ Two-Way. Use the drop-downs to select the two factors and the response (Values) variable. If desired, add a title and y axis labeling. Click “Calculate.”

image

TI calculators cannot do two-way ANOVA.

TA15-4

image

The following command form will create the interaction (means) plot:

> interaction.plot(factor1, factor2, response)

To create the ANOVA model and obtain the table of results, use the following commands:

> model=aov(Response ~ factor1 + factor2 + factor1*factor2)

> Summary(model)

The R Video Technology Manuals, Means Plots and Two-Way ANOVA, give more information and examples.