
Two-Way Analysis of Variance
(A worked Problem: Procedure explained in more detail in Chapter 14)
As a budding psychologist, you wonder whether you can teach old dogs new tricks. So you go to the pound and adopt 15 old dogs and 15 puppies. Then you attempt to teach each of the 30 dogs one of the standard dog tricks, "sit", "stay", and "roll over." Teaching only one trick to each dog, you keep a record of how many days it takes before they learn the tricks. The results of your experiment are listed in the table below. Use that data to conduct a two-way analysis of variance to determine if old dogs can learn new tricks.
| Type of Trick | ||||
| "Sit" (Column 1) |
"Shake" (Column 2) |
"Roll Over" (Column 3) |
||
| Puppies (Row 1) |
2 1 3 1 2 |
4 5 4 6 7 |
6 9 7 8 10 |
|
| Old Dogs (Row 2) |
2 5 2 4 3 |
9 10 11 13 7 |
13 12 15 17 13 |
Because there are 2 rows and 3 columns this makes this problem a 2 by 3 two-way analysis of variance. To begin any two-way analysis of variance we must first compute all the means and all the sums for the cells, rows, and columns. To make the table easier to read and use I have replaced the data in each cell with the appropriate sums and means. (Refer to the table at the top of the problem if you want to see the actual data rather than the sums.)
| Type of Trick | ||||
| "Sit" (Column 1) |
"Shake" (Column 2) |
"Roll Over" (Column 3) |
||
| Puppies (Row 1) |
![]() |
![]() |
![]() |
![]() |
| Old Dogs (Row 2) |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
I. We always begin by stating our Null and Research Hypotheses for all three F ratios
A. Rows
H0:
There is no difference between the time it takes an old dog to learn a trick and a puppy
to learn a trick.
H1:
There is a difference between the time it takes an old dog to learn a trick and a puppy to
learn a trick.
B. Columns
H0:
There will be no difference between the time it takes to learn the different types of
tricks.
H1:
There will be a difference between the time it takes to learn the different types of
tricks.
C. Interaction
H0:
There is no interaction
H1:
There is an interaction
II. The Source Table.....To complete the two-way analysis of variance we will fill out the following source table:
Source of Variation |
Sums of Squares |
Degrees of Freedom |
Mean Square | F | p |
| Rows | |||||
| Columns | |||||
| Interaction | |||||
| Within | |||||
| Total |
III. Compute Sums of Squares
A. Sums of Squares Total (SStotal)

B. Sums of Squares Rows (SSr)

C. Sums of Squares Columns (SSc)

D. Sums of Squares Within Groups (SSwg)

E. Sums of Squares Interaction (SSrxc)
![]()
F. Copy the Sums of Squares to the source table
Source of Variation |
Sums of Squares |
Degrees of Freedom |
Mean Square | F | p |
| Rows | 124.034 | ||||
| Columns | 366.067 | ||||
| Interaction | 28.466 | ||||
| Within | 62.4 | ||||
| Total | 580.967 |
IV. Compute degrees of freedom
A. Degrees of Freedom Total (dftotal)
dftotal = Ntotal
- 1 = 30 -1 = 29
B. Degrees of Freedom Rows (dfr)
dfr = nr
- 1 = 2-1 = 1
C. Degrees of Freedom Columns (dfc)
dfc = nc
- 1 = 3-1 = 2
D. Degrees of Freedom Interaction (dfrxc)
dfrxc = dfr
· dfc = 1 · 2 = 2
E. Degrees of Freedom Within (dfwg)
dfwg = Ntotal - Number of Cells = 30-6 = 24
F. Copy Sums of Squares to the Source Table
Source of Variation |
Sums of Squares |
Degrees of Freedom |
Mean Square | F | p |
| Rows | 124.034 | 1 | |||
| Columns | 366.067 | 2 | |||
| Interaction | 28.466 | 2 | |||
| Within | 62.4 | 24 | |||
| Total | 580.967 | 29 |
V. Compute Mean Squares
A. Mean Square Rows (MSr)
![]()
B. Mean Square Columns (MSc)
![]()
C. Mean Square Interaction (MSrxc)
![]()
D. Mean Square Within (MSwg)
![]()
E. Copy Mean Squares to the Source Table
Source of Variation |
Sums of Squares |
Degrees of Freedom |
Mean Square | F | p |
| Rows | 124.034 | 1 | 124.034 | ||
| Columns | 366.067 | 2 | 183.034 | ||
| Interaction | 28.466 | 2 | 14.233 | ||
| Within | 62.4 | 24 | 2.600 | ||
| Total | 580.967 | 29 |
VI. Compute the F ratios
A. F ratio for Rows (Fr)
![]()
B. F ratio for Columns (Fc)
![]()
C. F ratio for Interaction (Frxc)
![]()
D. Copy F ratios to the Source Table
Source of Variation |
Sums of Squares |
Degrees of Freedom |
Mean Square | F | p |
| Rows | 124.034 | 1 | 124.034 | 47.705 | |
| Columns | 366.067 | 2 | 183.034 | 70.398 | |
| Interaction | 28.466 | 2 | 14.233 | 5.474 | |
| Within | 62.4 | 24 | 2.600 | ||
| Total | 580.967 | 29 |
VII. Conclusions and Significance of the F ratios
A. Fr
1. Critical value with (1,24) degrees of
freedom = 4.26
2. Fr = 47.705 this is greater
than the critical value. Therefore we reject the H0 for Rows.
The probability of this F ratio happening just by chance is <.05.
3. The puppies learned significantly
faster than the old dogs.
B. Fc
1. Critical value with (2,24) degrees of
freedom = 3.40
2. Fc = 70.398 this is greater
than the citical value. Therefore we reject H0 for Columns.
The probability of this F ratio happening just by chance is <.05.
3. Because there are three different
columns we must now compare the means
from each column with each of the other column means using the HSD.
a. Find the value
of q in table Q with k, the number of groups being compared,
equal to 3 and the degrees of freedom within groups equal to 24.
q = 3.53
b. Compute the
HSD
![]()
c. Compare the column means
4. Because all the
comparisons are greater than the HSD all the different types of tricks
are significantly different from one another.
C. Frxc
1. Critical value with (2,24) degrees of
freedom = 3.40
2. Frxc = 5.474 this is
greater than the critical value. Therefore we reject H0 for Interaction.
The probability of this F ratio happening just by chance is <.05.
3. Because the interaction is significant
we must now graph the cell means.
Remember that when creating this graph use the dependent variable as the Y axis label
and either rows or columns, which ever has the most groups, as the X axis label.
You can see from the graph that the puppies learn at a much faster rate overall than the old dogs. And you can also see that the sit, shake, and roll over tricks are progressively more difficult for the old dogs, but there seems to be very little difference between shake and roll over for the younger dogs.
VII. The final completed Source Table
Source of Variation |
Sums of Squares |
Degrees of Freedom |
Mean Square | F | p |
| Rows | 124.034 | 1 | 124.034 | 47.705 | <.05 |
| Columns | 366.067 | 2 | 183.034 | 70.398 | <.05 |
| Interaction | 28.466 | 2 | 14.233 | 5.474 | <.05 |
| Within | 62.4 | 24 | 2.600 | ||
| Total | 580.967 | 29 |
Copyright © 2004 by Mark W. Vernoy