252anovaex4 10/25/07 (Open this document in 'page layout' view.) Example of 3-way ANOVA We have measurements that describe the mpg gotten by 8 drivers (Factor 1), using 6 cars (Factor 2) during 4 seasons (Factor C). For each combination of factors there are 10 measurements. The SS1 is 700, SS2 is 400, and SS3 is 300. For the interactions SS12 = 50, SS13 = 60 and SS23=70. The within (error or residual) sum of squares is 100 and the total sums of squares is 1700. Set up an ANOVA table showing all interactions. Assume a 5% significance level. Solution: The sums of squares have been copied into the table below. If we multiply the levels of the factors together and then multiply by the number of measurements per cell, we find a total of 8 6 4 10 1920 measurements. There are a total of 1920 – 1 = 1919 degrees of freedom. Since drivers has 8 levels there are 7 degrees of freedom. Similarly for cars there are 6 – 1 = 5 degrees of freedom and for seasons there are 3 degrees of freedom. These are also shown below. Source SS DF MS F.05 F Driver (1) 700 7 Car (2) 400 5 Season (3) 300 3 Interaction (12) 50 Interaction (13) 60 Interaction (23) 70 Interaction (123) Within 100 . Total 1700 1919 Since the sums of squares must add up, to get the missing sum of squares, subtract the sum of the numbers above the line (1680) from the total sum of squares (1700) and get 20. To get the degrees of freedom for interactions multiply the degrees of freedom for the factors. For example DF12 DF1 DF 2 7 5 35. This is shown below. Source Driver (1) Car (2) Season (3) Interaction (12) Interaction (13) Interaction (23) Interaction (123) Within Total SS DF 700 400 300 50 60 70 20 100 1700 7 5 3 35 21 15 105 . 1919 MS F.05 F Since the degrees of freedom must add up, add the degrees of freedom above the line to get 191 and subtract from the total degrees of freedom to get 1919 – 191 = 1728. To get the mean squared column, divide the items in the SS column by the corresponding items in the MS column. Source Driver (1) Car (2) Season (3) Interaction (12) Interaction (13) Interaction (23) Interaction (123) Within Total SS 700 400 300 50 60 70 20 100 1700 DF MS 7 5 3 35 21 15 105 1728 1919 100.00 80.00 100.00 1.4286 2.8571 4.6667 0.1905 0.05787 F F.05 To get the items in the column for computed Fs, divide the mean squares by the within mean square. 1 252anovaex4 10/25/07 (Open this document in 'page layout' view.) Source Driver (1) Car (2) Season (3) Interaction (12) Interaction (13) Interaction (23) Interaction (123) Within Total SS 700 400 300 50 60 70 20 100 1700 DF MS F 7 5 3 35 21 15 105 1728 1919 100.00 80.00 100.00 1.4286 2.8571 4.6667 0.1905 0.05787 1728 1382 1728 24.68 49.37 80.64 3.29 F.05 Now look up values of F.05 on the F table. The degrees of freedom for the numerator are given in the DF column. The degrees of freedom for the denominator are 1728. MS F F.05 7 100.00 1728 F 7,1728 .05 400 5 80.00 1382 300 3 100.00 1728 Interaction (12) 50 35 1.4286 24.68 Interaction (13) 60 21 2.8571 49.37 Interaction (23) 70 15 4.6667 80.64 Interaction (123) 20 105 0.1905 3.29 Source SS Driver (1) 700 Car (2) Season (3) DF F 5,1728 .05 F 3,1728 .05 F 35,1728 .05 F 21,1728 .05 F 15,1728 .05 F 105,1728 .05 Within 100 1728 0.05787 Total 1700 1919 Look up the table values of F. I have used the parts of the table where the denominator degrees of freedom are 1000 and have come as close as possible for the numerator. We have tested seven null hypotheses. The first three of these are that there are no significant differences between driver, car and season means, and the remaining four are that there is no interaction of the type described. In every case, the null hypothesis was rejected because the computed F exceeded the table F, so the computed F was labeled with an ‘s.’ MS F F.05 7 100.00 1728s F 7,1728 .05 =2.02 400 5 80.00 1382s 300 3 100.00 1728s Interaction (12) 50 35 1.4286 24.68s Interaction (13) 60 21 2.8571 49.37s Interaction (23) 70 15 4.6667 80.64s Interaction (123) 20 105 0.1905 3.29s 100 1700 1728 1919 0.05787 Source SS Driver (1) 700 Car (2) Season (3) Within Total DF F 5,1728 .05 = 2.22 F 3,1728 .05 = 2.61 F 35,1728 .05 =1.44 F 21,1728 .05 = 1.58 F 15,1728 .05 = 1.70 F 105,1728 .05 = 1.26 2