full2.gif (11401 bytes)
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)
wp2an 1.gif (1256 bytes) wp2an 3.gif (1294 bytes) wp2an 4.gif (1281 bytes) wp2an 8.gif (1342 bytes)
Old Dogs
(Row 2)
wp2an 5.gif (1270 bytes) wp2an 6.gif (1292 bytes) wp2an 7.gif (1294 bytes) wp2an 9.gif (1427 bytes)
  wp2an 10.gif (1337 bytes) wp2an 11.gif (1376 bytes) wp2an 12.gif (1396 bytes) wp2an 13.gif (1637 bytes)

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)

wp2an 14.gif (2086 bytes)

    B.  Sums of Squares Rows (SSr)

wp2an 16.gif (3491 bytes)

    C.  Sums of Squares Columns (SSc)

wp2an 15.gif (3725 bytes)

    D.  Sums of Squares Within Groups (SSwg)

wp2an 17.gif (3409 bytes)

    E.  Sums of Squares Interaction (SSrxc)

wp2an 18.gif (2054 bytes)

    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)

            wp2an 20.gif (1396 bytes)

    B.  Mean Square Columns (MSc)

            wp2an 19.gif (1385 bytes)

    C.  Mean Square Interaction (MSrxc)

            wp2an 21.gif (1340 bytes)

    D.  Mean Square Within (MSwg)

            wp2an 22.gif (1318 bytes)

    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)

            wp2an 24.gif (1393 bytes)

    B.  F ratio for Columns (Fc)

            wp2an 23.gif (1395 bytes)

    C.  F ratio for Interaction (Frxc)

            wp2an 25.gif (1341 bytes)

    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

wp2an 26.gif (1713 bytes)

            c.  Compare the column means

wp2an 27.gif (1762 bytes)

         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.   

interaction.gif (6071 bytes) 

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