# 13.3: Two-Way ANOVA Summary Table

• • Michelle Oja
• Taft College
$$\newcommand{\vecs}{\overset { \rightharpoonup} {\mathbf{#1}} }$$ $$\newcommand{\vecd}{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}}$$$$\newcommand{\id}{\mathrm{id}}$$ $$\newcommand{\Span}{\mathrm{span}}$$ $$\newcommand{\kernel}{\mathrm{null}\,}$$ $$\newcommand{\range}{\mathrm{range}\,}$$ $$\newcommand{\RealPart}{\mathrm{Re}}$$ $$\newcommand{\ImaginaryPart}{\mathrm{Im}}$$ $$\newcommand{\Argument}{\mathrm{Arg}}$$ $$\newcommand{\norm}{\| #1 \|}$$ $$\newcommand{\inner}{\langle #1, #2 \rangle}$$ $$\newcommand{\Span}{\mathrm{span}}$$ $$\newcommand{\id}{\mathrm{id}}$$ $$\newcommand{\Span}{\mathrm{span}}$$ $$\newcommand{\kernel}{\mathrm{null}\,}$$ $$\newcommand{\range}{\mathrm{range}\,}$$ $$\newcommand{\RealPart}{\mathrm{Re}}$$ $$\newcommand{\ImaginaryPart}{\mathrm{Im}}$$ $$\newcommand{\Argument}{\mathrm{Arg}}$$ $$\newcommand{\norm}{\| #1 \|}$$ $$\newcommand{\inner}{\langle #1, #2 \rangle}$$ $$\newcommand{\Span}{\mathrm{span}}$$$$\newcommand{\AA}{\unicode[.8,0]{x212B}}$$

Factorial designs are designs, not a statistical analysis.  Research designs are about how data are collected, instead of how data are analyzed.  However, factorial designs are often analyzed with ANOVAs, so we will walk through ANOVA Summary Tables for factorial designs with at least two IVs with at least two levels each (“Two-way” means that there are two variables, each with two or more levels.).  The main point of factorials designs is how the different IV’s and their levels are combined, which is a research design issue.

## ANOVA Summary Table Refresher

Remember the ANOVA Summary Table for Between Groups designs (when the groups were independent) shown in Table $$\PageIndex{1}$$?

Table $$\PageIndex{1}$$: ANOVA Table
Source $$SS$$ $$df$$ $$MS$$ $$F$$
Between Groups $$S S_{B}$$ $$k-1$$ $$\frac{S S_{B}}{d f_{B}}$$ $$\frac{MS_{B}}{MS_{W}}$$
Within Groups (Error) $$S S_{W}$$ $$N-k$$ $$\frac{S S_{W}}{d f_{W}}$$ N/A
Total $$S S_{T}$$ $$N-1$$ N/A N/A

Once you had the Sum of Squares (SS) and the Degrees of Freedom (df), you could easily calculate the Mean Square (MS), and then the final F.

What was added for the Repeated Measures ANOVA Summary Table (example shown in Table $$\PageIndex{2}$$)?

Table $$\PageIndex{2}$$- RM ANOVA Summary Table with Formulas for Degrees of Freedom
Source $$SS$$ $$df$$ $$MS$$ $$F$$

Between Groups

formula elsewhere

k-1

Between Groups SS/df

MSBG / MSWG

Participants

formula elsewhere

P-1

N/A

N/A

Within Groups (Error)

SSWG = SST – SSBG – SSP

(k-1)*(P-1)

Within Groups SS/df

N/A

Total

formula elsewhere

N-1

N/A

N/A

Right, we added one more row to account for the variation within each participant.  But just like the BG ANOVA Summary Table, once you had all of the Sums of Squares (SS) and the Degrees of Freedom (df), you could easily calculate the Mean Square (MS), and then the final F.

The good news is that the Two-Way ANOVA Summary Table, the ANOVA Summary Table used when your study has two IVs, has similar properties.  The bad news is that, just like the BG and RM ANOVA Summary Tables, the SS and df have some new formulas.

In sum, whatever the type of ANOVA you have, your general process will be:

1. Calculate the degrees of freedom.
2. Calculate the Sum of Squares.
3. Use SS to calculate the Mean Square (SS/df).
4. Calculate the F as a ratio of the MSBG divided by the MSWG (or MSError, they are the same thing).
1. The only difference with a two-way ANOVA is that you have two Between Group MS’s, one for each variable, and a row for the interaction.
5. Locate a critical value.
6. Determine whether you retain or reject the null hypothesis.

What would that kind of ANOVA Summary Table look like?  Let's look at one in Table $$\PageIndex{3}$$:

Table $$\PageIndex{3}$$- Two-Way ANOVA Summary Table
Source $$SS$$ $$df$$ $$MS$$ $$F$$
IV 1

IV 2

Interaction

Within Groups (Error)

Total

## Sum of Squares and Degrees of Freedom

With independent sample Between Groups ANOVAs, we had three Sums of Squares and three degrees of freedom.

Exercise $$\PageIndex{1}$$

What were the names of the three rows called?  In other words, what were the names of the three Sums of Squares?

1. Between Groups
2. Within-Groups (or Error)
3. Total

With dependent sample Repeated Measures ANOVAs, we needed four Sums of Squares and four degrees of freedom.

Exercise $$\PageIndex{2}$$

What were the names of the four rows called?  In other words, what were the names of the four Sums of Squares?

1. Between Groups
2. Participants
3. Within-Groups (or Error)
4. Total

With two-way ANOVAs you need six Sums of Squares and six degrees of freedom!  If you look at Table 3, though, you’ll only see five rows.  What’s the deal?  There’s an extra calculation called “cells” that allows you to fill in the ANOVA Summary.  So, the Sums of Squares and Degrees of Freedom that are need are:

1. Cells:             This is the SS between all of the groups (This is not listed on the ANOVA Summary Table, but is used to calculate some of the others.)
2. Between group for one variable (IV1)
3. Between group for the other variable (IV2)
4. Interaction
5. Within group
6. Total

The next major section shows how to calculate the Sums of Squares using tables, but it is exceedingly unlikely that you would every calculate a factorial ANOVA by hand.  This page is unmodified from the original source (Dr. Crump's Answering Questions with Data), and uses a statistical analysis software call R.  It's so unlikely that you'll every do this by hand that the page is not updated or formatted for this textbook.  So let’s look at how to calculate each Degree of Freedom.

### Formulas for Degrees of Freedom

The following are the formulas for each Degree of Freedom.

1. Cells:             $$(k_1 \times k_2) – 1$$
1. Remembering that “k” is the number of groups, k1 is the number of levels of the first IV and , k2 is the number of levels of the other IV.
2. Between group for one variable (IV11):           $$k_1 – 1$$
3. Between group for the other variable (IV2):   $$k_2) – 1$$
4. Interaction: $$df_1 \times df_2$$
5. Within group:            $$df_{Total} – df_{Cells}$$
6. Total:             N-1
1. With N being the number of scores.

Dr. MO has been skating around the issue, but a two-factor another can be Between Groups (with all IV levels being independent) or Repeated Measures (with all IV levels being repeated or related) or a combination (some IVs are independent and some IVs are repeated).  To make things easier in our calculations, we’ll just use the Two-Way ANOVA Summary Table as if all of the IVs are independent, even though it’s actually pretty common to have a combination of IVs.  In any case, use the N of the number of scores, which is usually the number of participants.

When we have an example, we’ll replace the subscript numbers with subscript letters that represent the name of the IVs.

## Mean Square

In two-way ANOVAs, you need to four Mean Squares.

### Formulas for Mean Square

Regardless of which Mean Square you are calculating, it will be the same as all of the Mean Squares that we’ve covered in the last couple chapters:

$\text{MS} = \dfrac{SS}{df} \nonumber$

You use the Sum of Squares of the row that you are working with, and divide if by the Degrees of Freedom of the row that you are working with to get the Mean Square for that row.

## Calculated F

In two-way ANOVAs, you end up with three calculated F’s, one for each variable and one for the interaction.  For factorial designs with more IVs, you would end with more calculated F-scores.

### Formulas for Calculated F-Scores

Each F-score is calculated the same was as the F in a Between Groups ANOVA Summary Table or a Repeated Measures ANOVA Summary Table:  MSIV / MS WG or Error

For a two-way ANOVA, that looks like:

Exercise $$\PageIndex{3}$$

What is similar to past F-score calculations?  What is similar amongst all three of these calculations?

As with prior F calculations, the ratio is the Mean Square of the variable that we’re looking and the Mean Square of the within-groups error term.  That is what is similar amongst all three of these calculations, too.

Each calculated F will be compared to a different critical value based on the Degrees of Freedom of the numerator and the denominator.

## Two-Way ANOVA Summary Table with Formulas

Here’s the ANOVA Summary Table for a two-way factorial design with all of the formulas included, other than the Sum of Squares.  The formulas for the Sum of Squares aren't provided because they are beyond the scope of this introduction to statistics (and you'd never do them by hand, anyway).  Note that there will again be three blank cells, labeled "N/A" in Table $$\PageIndex{4}$$.

Table $$\PageIndex{4}$$- Two-Way ANOVA Summary Table
Source $$SS$$ $$df$$ $$MS$$ $$F$$
IV 1

formula elsewhere

$$k_1 - 1$$

$$= \dfrac{SS_1}{df_1}$$

$$= \dfrac{MS_{1}}{MS_{WG}} \nonumber$$

IV 2

formula elsewhere

$$k_2 - 1$$

$$= \dfrac{SS_2}{df_2}$$

$$= \dfrac{MS_{2}}{MS_{WG}} \nonumber$$

Interaction formula elsewhere

$$df_1 * df_2$$

$$= \dfrac{SS_{INT}}{df_{INT}}$$

$$= \dfrac{MS_{Interaction}}{MS_{WG}} \nonumber$$

Within Groups (Error)

formula elsewhere

$$df_{Total} - df_{cells}$$

$$= \dfrac{SS_{WG}}{df_{WG}}$$

N/A

Total

formula elsewhere

N-1

N/A- N/A

To complete the table, you need to need to calculate the degrees of freedom of cells $$(df_{cells} = (k_1 \times k_2) – 1)$$ although there’s no place in the table to include this information.

Normally, we put the variable with fewer levels before (above) the variable with more levels in the notation and in the ANOVA Summary Table.

### Practice with a Two-Way ANOVA Summary Table

Example $$\PageIndex{1}$$

Example 1 Complete the following ANOVA Summary Table with the information provided.  The Sums of Squares are already in Table $$\PageIndex{5}$$.

Participants (N = 48) joined a weight-loss program designed to increase the time people exercised.  The program lasted either one month, two months, or three months.  At the beginning and end of their program, the participants measured their weight to see how many pounds they lost.  Because hormones affect weight loss, the gender of each participant was recorded and used as a variable in this 2x3 factorial design.

8 men & 8 women who exercised 1 month

8 men & 8 women who exercised 2 months

8 men & 8 women who exercised 3 months

Solution

To complete the calculations you'll find:

1. The Mean Square for one IV
2. The Mean Square for the other IV
3. The Mean Square for the interaction of the two groups.
4. The Mean Square for the Error (the denominator of the calculated F-score), which is sometimes called Mean Square for Within-Groups.
5. The F-ratio for one group
6. The F-ratio for the other group
7. The F-ratio for the interaction of the two groups.
8. F for one group:                        $$= \dfrac{MS_1}{MS_{WG}} \nonumber$$
9. F for other group:    $$= \dfrac{MS_2}{MS_{WG}} \nonumber$$
10. F for the interaction:               $$= \dfrac{MS_{Interaction}}{MS_{WG}} \nonumber$$
Table $$\PageIndex{5}$$- Two-Way ANOVA Summary Table
Source $$SS$$ $$df$$ $$MS$$ $$F$$
IV1 (Gender)

330.75

$$k_1 - 1$$ = 2 - 1 = 1

$$= \dfrac{SS_1}{df_1} = \dfrac{330.75}{1} = 330.75$$

$$= \dfrac{MS_{1}}{MS_{WG}} = \dfrac{330.75}{14.79} = 22.36 \nonumber$$

IV2 (Length of Program: 1, 2, or 3 months)

1065.50

$$k_2 - 1$$ = 3 - 1 = 2

$$= \dfrac{SS_2}{df_2} = \dfrac{1065.50}{2} = 532.75$$

$$= \dfrac{MS_{2}}{MS_{WG}} = \dfrac{532.75}{14.79} = 36.02 \nonumber$$

Interaction

350.00

$$df_1 * df_2$$ = 1 * 2 = 2

$$= \dfrac{SS_{INT}}{df_{INT}} = \dfrac{350.00}{2} = 175.00$$

$$= \dfrac{MS_{Interaction}}{MS_{WG}} = \dfrac{175.00}{14.79} = 11.84 \nonumber$$

Within Groups (Error)

621.00

$$df_{Total} - df_{cells}$$ = 47 - 5 = 42

$$= \dfrac{SS_{WG}}{df_{WG}} = \dfrac{621.00}{42} = 14.79$$

leave blank

Total

2367.25

$$N-1 = 48 - 1 = 47$$

leave blank leave blank

$$(df_{cells} = (k_1 \times k_2) – 1) = (2 \times 3) – 1 = 6-1 = 5$$

As before, we can do a Calculation Check to see if we did all of the Degrees of Freedom correctly because they all should add up to the total again!

The rest of the process is the same as we’ve been doing, we just have to do it for each of the calculated F-scores:  compare each of the three calculated F-scores to three critical values from the Critical Values of F Table to decide if we retain or reject the null hypothesis.

Like in the Between Groups ANOVA and the Repeated Measures ANOVA, the null hypothesis says that all of the means are similar.  For factorial designs, this includes the interaction; the null hypothesis is saying that we will find no main effects, and that the means for each combination of IV levels will also be similar.  Just for fun, let’s look at what the combination of IVs would look like in a Punnett’s Square.

Example $$\PageIndex{1}$$

Complete a grid showing the factorial design IVs and DVS for the scenario in Example $$\PageIndex{1}$$.

Solution

 IV2 (Time): 2 Months IV2 (Time): 3 Months IV Levels IV1 (Gender):  Men IV1 (Gender:  Women IV2 (Time): 1 Month 2x3:  Men who exercised for one month 2x3:  Women who exercised for one month 2x3:  Men who exercised for two months 2x3:   Women who exercised for two months 2x3:  Men who exercised for three months 2x3:   Women who exercised for three months

### What would we do next?

For each calculated F, we would determine if the null hypothesis was retained or not.  Let’s do that!

Example $$\PageIndex{1}$$

Find the critical values for each of the calculated F-scores in the Table of Critical F-Scores Table (which can be found in the Common Critical Value Tables page at the end of the book), then determine if you should retain or reject the null hypothesis.

Solution

For the first IV of gender, the calculated F-score was 22.36.  The critical value from the Critical Values of F Table the using the Degrees of Freedom of Gender and the Within-Groups (Error) (Gender df = 1, Within-Groups df = 42) is 4.08 (using the df for the denominator of 40 because that is the closest to 42 or 42 rounding down on the table).  Because the following is still true, we reject the null hypothesis and say that the average pounds lost differed between men and women.

Critical < Calculated == Reject null == At least one mean is different from at least one other mean. == p<.05

Critical > Calculated == Retain null ==  All of the means are similar. == p>.05

For the second IV of length of the exercise program, the calculated F-score was 36.02.  The critical value from the Critical Values of F Table the using the Degrees of Freedom of Gender and the Within-Groups (Error) (Exercise Length df = 2, Within-Groups df = 42) is 3.23 (using the df for the denominator of 40 because that is the closest to 42 or 42 rounding down on the table).  Because the critical value is smaller than the calculated value, we reject the null hypothesis and say that the average pounds lost differed between at least two of the three groups (1 month, 2 months or 3 months.

For the interaction between gender and length of exercise program, the calculated F-score was 11.83.  The critical value from the Critical Values of F Table the using the Degrees of Freedom of Gender and the Within-Groups (Error) (Interaction df = 2, Within-Groups df = 42) is 3.23 (using the df for the denominator of 40 because that is the closest to 42 or 42 rounding down on the table).  Because the critical value is smaller than the calculated value, we reject the null hypothesis and say that the average pounds lost differed between at least two of the combinations of gender and exercise length.

### What about Pairwise Comparisons?

Is your next step pairwise comparisons?  Maybe!

Had we retained any of the null hypotheses, we would not have conducted pairwise comparisons for that variable.  Just like in the other ANOVAs, if we don’t find a differences between the means, we don’t look for where the difference might be.  In this case, though, we could have retained one variable (say, the Interaction), but still rejected the null hypotheses for each IV.  In that case, we would have needed to conduct some pairwise comparisons.  But maybe not as many as you’d think!

If the IV only has two levels and the F-score results in rejecting the null hypothesis, then pairwise comparisons are still not needed.  The ANOVA is enough.  The ANOVA says that at least two means are different from each other, and when we only have two means, we have all we need to know.  So, with our Gender IV, we would not need to conduct pairwise comparisons even though we rejected the null hypothesis.

If the IV has three or more levels and the F-score results in rejecting the null hypothesis, then we would need to conduct pairwise comparisons to find which means are different from each other.  This statistically significant main effect shows that at least two means are different from each other, but we need to figure out which specific means.

If the F-score results in rejecting the null hypothesis for the Interaction, then we would need to conduct pairwise comparisons to find which means are different from each other.  This statistically significant interaction shows that at least two means are different from each other, but we’ll have at minimum four means (a 2x2 factorial design results in four combinations) so we need to figure out which means differ from each other.

Phew, that was a lot!  Next up is looking at calculating Sums of Squares for a two-way ANOVA.  If you are never going to do that by hand, skip that section and start with section on Post-Hoc Pairwise Comparisons.