THE TWO-WAY CLASSIFICATION WITHOUT INTERACTION 373 In matrix format we can write H as [ 1 −1 1 1 ] K′b = 0 12 12 12 1 0 −1 1 4 1 0 −1 b = 0. −1 0 1 −1 4 4 44 With b◦ of (11) and G of (47) 23 have K′b◦ = [ −7.5 ] , K′GK = 1 [ 7 3] and [ 9 −3 ] (K′GK)−1 = 2 . −9 12 3 9 9 −3 7 Hence, Q = (K′b◦)′(K′GK)−1K′b◦ = [ −9 ] 2 [ 9 −3 ] [ −7.5 ] −7.5 9 −3 7 −9 = 148.5 = R(������|������) of Table 7.2c. □ In Example 6, we have demonstrated that F(������|������) = R(������|������)∕(b − 1)���̂���2. This is true in general. The F-statistic having R(������|������) of Table 7.2b as its numerator sum of squares, F(������|������), tests a hypothesis analogous to that in (48a), namely, H: ������i + 1 ∑b equal for all i. (48b) ni. nij������j j=1 The importance of these results is that F(������|������) is not a statistic for testing the equality of the ������’s. The statistic to be used for this test is F(������|������, ������). The hypothesis that is tested by F(������|������) is the equality of the ������’s plus weighted averages of the ������’s, the weights being the nij. Similarly, F(������|������) does not test the equality of the ������’s. It tests equality of the ������’s plus weighted averages of the ������’s, as in (48a). When using SAS, the relevant p- values for testing equality of the ������’s or the ������’s are with the type III sum of squares. To test the hypothesis in (48a), use the type I sum of squares fitting ������ first. Likewise, to test the hypothesis in (48b), again, use the type I sum of squares fitting ������ first. h. Models that Include Restrictions fimSa1nuiconn∑ldccuteediialo=e.���n���1sWs+���t���hhai◦���ene���+tidrh+ete���s���hrj◦t���e���rt,jiihrcteihtbsier.oleen.ssusattt.rimehim.ca’ettasiboa∑gslnievt,∑aieh=sne1oaii���=bn���i.i1sl(.=���4u������i4.���0e=)+., sot0tha1ifleils∑���n���app+���a���iap=r+lt1a1yo.������∑������fTji t+ihhsaiu=e���es1���mjs,.���t������oi���iTmi◦d+he−aelb������ro���lje���erh◦finonwirostiethts,,hettiihlbfule.nltt.hheruesee.tseibtm.mr.l���io.���cau◦dtb.eele+del.
374 THE TWO-WAY CROSSED CLASSIFICATION oinfc���l���uid−es������thheanrdest���r���j◦ic−tio���n���k◦∑is bjt=h1e������bj .=l.u0.e. . of ������j − ������k. Similar results hold if the model The hypothesis of equality of ������j + , b discussed 1 ∑a nij������i for all j = 1, 2, … n.j i=1 in Section 1g might hint at the possibility of using a model that included the restriction ∑a (49) nij������i = 0 for all j = 1, 2, … , b. i=1 Any value to this suggestion is lost whenever b ≥ a. Then, equations (49) can be solved for the ������’s. In fact, ������i = 0 for all i, regardless of the data. When b < a, equations (49) could be used as restrictions on the model. However, then only a – b linear functions of the ������’s would be estimable from the data. Furthermore, since equations (49) are data-dependent, in that they are based on the nij, they suffer from the same deficiencies as do all such restrictions as explained at the end of Section 2h of Chapter 6. i. Balanced Data The preceding discussion uses nij as the number of observations in the ith row (level of the ������ factor) and the jth column level (level of the ������ factor) with all nij = 0 or 1. Later, we will show that much of that discussion applies in toto to discussions where nij can be any non-negative integers and hence to nij = n. However, here we consider the simplest case of balanced data where nij = 1 for all i and j. These data are like that of Table 7.1, only without missing observations. As one might expect, there is great simplification of the foregoing results when nij = 1 for all i and j. Of course, the simplifications lead exactly to the familiar calculations in this case (e.g., see p. 72 of Kempthorne (1952), pp. 244–248 of Gruber (2014)). One may obtain a variety of solutions to the normal equations under these conditions. Using the procedure already given for unbalanced data which involves solving equations (14) and (15) (See Exercises 21 and 22), we obtain ������◦ = 0, and ������i◦ = yi. − y.. + y.b for all i; and ������b◦ = 0, and ������j◦ = y.j − y.b for j = 1, 2, … , b − 1. By use of the “usual constraints” ∑a ������i◦ = 0 = ∑b ������j◦, i=1 j=1
THE TWO-WAY CLASSIFICATION WITHOUT INTERACTION 375 we obtain another set of solutions. They are ������◦ = y.., ������i◦ = yi. − y.. for all i and ������j◦ = y.j − y.. for all j. In either case, the b.l.u.e.’s of differences between ������’s and ������’s are ������̂i − ������h = yi. − yh., with v(������̂i − ������h) = 2������2 b and ���̂���j − ������k = y.j − y.k, with v(���̂���j − ������k) = 2������2 . a D∑ifaif=e1re���n���ic=es0o=f t∑hisbj=n1at���u���jrepaarraellealliwngaytsheesutismuaalblceo.nIsftrtahientms, othdeenl includes restrictions ������, the ������i and ������j are also estimable with ���̂��� = y.., ���̂���i = yi. − y.., and ������̂j = y.j − y... The most noteworthy consequence of balanced data (all nij = 1) is that Tables 7.3b and 7.3c become identical for all data. This is the most important outcome of balanced data. It means that the distinction between R(������|������) and R(������|������, ������) made in Tables 7.2 and 7.3 no longer occurs, because these two terms both simplify to be the same. Likewise, in these tables, there is no longer a distinction between R(������|������) and R(������|������, ������). They too simplify to be identically equal. The type I and type III sum of squares in SAS are equal for balanced data. Thus, when all nij = 1, R(������|������) = R(������|������, ������) = ∑a yi2. − y.2. = b ∑a yi2. − aby.2. = ∑a ∑b − y..)2 (50a) b ab (yi. i=1 i=1 i=1 j=1 and R(������|������) = R(������|������, ������) = ∑b y2.j − y2.. = a ∑b y.2j − aby2.. = ∑a ∑b − y..)2. (50b) a ab (y.j j=1 j=1 i=1 j=1 The analysis of variance table becomes as shown in Table 7.5. When computing the sums of squares using a hand-held calculator, it is best to use the first of the three equivalent formulae in (50a) or (50b) to reduce round-off error. The sums of squares in (50a) and (50b) are well-known familiar expressions. Furthermore, they each have a simple form. They are easily calculated. They do not involve any matrix manipulations
376 THE TWO-WAY CROSSED CLASSIFICATION TABLE 7.5 Analysis of Variance for a Two-Way Classification with No Interaction with Balanced Data, all nij = 1. (Tables 7.3b and 7.3c Both Simplify to This Form When All nij = 1) Source of Variation d.f. Sum of Squares Mean 1 R(������) = R(������) = aby2.. ������ after ������ a−1 ������ after ������ b−1 R(������|������) = R(������|������, ������) = ∑a ∑b (yi. − y..)2 Residual error (a − 1)(b − 1) Total ab i=1 j=1 R(������|������, ������) = R(������|������) = ∑a ∑b (y.j − y..)2 i=1 j=1 SSE = SSE = ∑a ∑b (yij − yi. − y.j + y..)2 i=1 j=1 SST = SST = ∑a ∑b yi2j i=1 j=1 like those previously described for unbalanced data (e.g., for R(������|������, ������)). In addition, because there is no longer any distinction between, for example, R(������|������) and R(������|������, ������), there is no need to distinguish between fitting “������ after ������” and “������ after ������ and ������.” Our sole concern is with fitting “������ after ������” and similarly “������ after ������.” There is only one analysis of variance table, as shown in Table 7.5 where R(������|������) measures the efficacy of having the ������-effects in the model and R(������|������) measures the efficacy of having the ������ effects in it. The convenience of a single analysis of variance table (Table 7.5) compared to having two analyses (Tables 7.3b and 7.3c) is obvious. For example, Table 7.4 is no longer pertinent. Unfortunately, however, this convenience that occurs with balanced data can easily result in a misunderstanding of the analysis of unbalanced data. Usually students encounter balanced data analysis first, such as that in Table 7.5. Explanation in terms of sums of squares of means yi. (and y.j) about the general mean y.. has much intuitive appeal.However, unfortunately it does not carry over to unbalanced data. It provides, for example, no explanation as to why there are two analyses of variance for unbalanced data for a two-way classification. These two analyses have different meanings and are calculated differently (see Tables 7.3b and 7.3c). Furthermore, the calculations are quite different from those for balanced data. The manner of interpreting results is also different. In one analysis, we fit “������ after ������ and ������.” In the other, we fit “������ after ������.” Small wonder that a student may experience disquiet when he views this state of affairs in the light of what has been arduously learned about balanced data. The changes to be made in the analysis and its interpretation appear so large in relation to the cause of it all—having unbalanced instead of balanced data—that the relationship of the analysis for unbalanced data to that for balanced data might, at least initially seem at all clear. The relationship is that balanced data are special cases of unbalanced data, and not vice versa. Example 7 A Two-Way Analysis of Variance for Balanced Data The data below consist of the number of speeding-related fatalities, divided by the number of licensed
THE TWO-WAY CLASSIFICATION WITHOUT INTERACTION 377 drivers in each of the listed states. These statistics were obtained from the Department of Transportation Highway Statistics. State/Speed limit (mph) 55 50 45 40 35 < 35 California 17.52 2.56 6.27 4.72 7.74 6.89 Florida Illinois 6.20 1.01 11.62 3.80 6.20 5.81 New York Washington 28.1 0.372 2.73 5.84 8.57 10.93 15.59 0.881 2.03 2.64 2.03 7.04 3.63 8.92 3.40 4.08 12.03 9.76 We have that, y1. = 45.7, y2. = 34.64, y3. = 56.543, y4. = 30.211, y5. = 41.52, y.. = 208.613, y.1 = 71.04, y.2 = 13.443, y.3 = 26.05, y.4 = 21.08, y.5 = 36.57, y.6 = 40.43, SSM = 208.6132 = 1450.646 30 and the total sum of squares corrected for the mean is 981.43. Furthermore, SS(States) = 45.72 + 34.642 + 56.5422 + 30.2112 + 41.522 − 1450.646 = 69.693 6 and SS(Speeds) = 71.042 + 13.4432 + 26.052 + 21.082 + 36.572 + 40.432 − 1450.646 5 = 413.817. The residual error is SSE = 981.430 – 413.817 – 69.693 = 497.920. The analysis of variance table is below. Source d.f. Sum of Squares Mean Square F-Statistic States 4 69.693 17.4231 0.70 < 3.38 Speed limits 5 413.817 82.7634 3.32 > 2.71 Residual error 20 497.920 24.8960 Total 29 981.430
378 THE TWO-WAY CROSSED CLASSIFICATION We conclude that there is not a significant difference in fatalities/per million drivers between states but there is amongst speed limits at the 5% level of significance. Notice, in the R output below, that the order of fitting the two factors is unimportant for this balanced model. Analysis of variance table Response: fatal Df Sum Sq Mean Sq F value Pr(>F) speed 5 413.82 82.763 3.3244 0.02399 * state 4 69.69 17.423 0.6998 0.60111 Residuals 20 497.92 24.896 -Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1- - Response: fatal Df Sum Sq Mean Sq F value Pr(>F) state 4 69.69 17.423 0.6998 0.60111 speed 5 413.82 82.763 3.3244 0.02399 * Residuals 20 497.92 24.896 --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 □ Example 8 Using the Rank Transformation for Speeding Fatalities Example If we suspect the data are not normally distributed, we may use a rank transformation. The numbers in the table below in parenthesis are the relative ranks. State/Speed Limit (mph) 55 50 45 40 35 <35 California 17.52 (29) 2.56 (6) 6.27 (18) 4.72 (13) 7.74 (21) 6.89 (19) Florida 6.20 (16.5) 1.01 (3) 11.62 (26) 3.80 (11) 6.20 (16.5) 5.81 (14) Illinois 28.1 (30) 0.372 (1) 2.73 (8) 5.84 (15) 8.57 (22) 10.93 (25) New York 15.59 (28) 0.881 (2) 2.03 (4.5) 2.64 (7) 2.03 (4.5) 7.04 (20) Washington 3.63 (10) 8.62 (23) 4.08 (12) 12.03 (27) 9.76 (24) 3.40 (9) The R output for analysis of variance on the ranks follows. Analysis of Variance Table Response: rank Df Sum Sq Mean Sq F value Pr(>F) state 4 190.33 47.583 0.8104 0.53323 speedy 5 881.80 176.360 3.0035 0.03505 * Residuals 20 1174.37 58.718 --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
THE TWO-WAY CLASSIFICATION WITHOUT INTERACTION 379 The results and conclusions are similar to those obtained above using analysis of variance on the observations. □ Example 9 Analysis of Variance for Data of Table 4.11 (Two-Way Without Interaction) The SAS System The GLM Procedure Class Level Information Class Levels Values refinery 3 123 source 4 1234 Number of Observations Read 25 Number of Observations Used 25 The SAS System The GLM Procedure Dependent Variable: percent Source DF Sum of Squares Mean Square F Value Pr > F Model 5 287.086338 57.417268 0.97 0.4631 Error 19 1129.473662 59.445982 Corrected Total 24 1416.560000 R-Square Coeff Var Root MSE percent Mean 0.202664 20.70387 7.710122 37.24000 Source DF Type I SS Mean Square F Value Pr > F refinery 2 20.9627778 10.4813889 0.18 0.8397 source 3 266.1235602 88.7078534 1.49 0.2486 Source DF Type III SS Mean Square F Value Pr > F refinery 2 25.5346713 12.7673357 0.21 0.8087 source 3 266.1235602 88.7078534 1.49 0.2486 The SAS System The GLM Procedure Class Level Information Class Levels Values refinery 3 123 source 4 1234 Number of Observations Read 25 Number of Observations Used 25
380 THE TWO-WAY CROSSED CLASSIFICATION The SAS System The GLM Procedure Dependent Variable: percent Source DF Sum of Squares Mean Square F Value Pr > F Model 5 287.086338 57.417268 0.97 0.4631 Error 19 1129.473662 59.445982 Corrected Total 24 1416.560000 R-Square Coeff Var Root MSE percent Mean 0.202664 20.70387 7.710122 37.24000 Source DF Type I SS Mean Square F Value Pr > F source 3 261.5516667 87.1838889 1.47 0.2553 refinery 2 25.5346713 12.7673357 0.21 0.8087 Source DF Type III SS Mean Square F Value Pr > F source 3 266.1235602 88.7078534 1.49 0.2486 refinery 2 25.5346713 12.7673357 0.21 0.8087 Analysis of Variance Table Response: percent Df Sum Sq Mean Sq F value Pr(>F) refinery 2 20.96 10.481 0.1763 0.8397 source 3 266.12 88.708 1.4922 0.2486 Residuals 19 1129.47 59.446 > anova(res2) Analysis of Variance Table Response: percent Df Sum Sq Mean Sq F value Pr(>F) source 3 261.55 87.184 1.4666 0.2553 refinery 2 25.53 12.767 0.2148 0.8087 Residuals 19 1129.47 59.446 □ As can be seen from the computer printouts, neither the source nor the refinery is statistically significant. 2. THE TWO-WAY CLASSIFICATION WITH INTERACTION Suppose a plant-breeder carries out a series of experiments with three different fertilizer treatments on each of four varieties of grain. For each treatment-by-variety combination of plants, he plants several 4′ × 4′ plots. At harvest time, he finds out that many of the plots have been lost due to having been wrongly plowed up. As a result, all he is left with is the data of Table 7.6. With four of the treatment-variety combination, there are no data at all. With the others, there are varying numbers of plots, ranging from one to four, with a total of 18 plots in all. Table 7.6 shows the yield of each plot, the total yields, the number of plots in each total, and the corresponding mean, for each treatment variety combination having data. Totals,
THE TWO-WAY CLASSIFICATION WITH INTERACTION 381 TABLE 7.6 Weighta of Grain (Ounces) from 4′ × 4′ Trial Plots Variety Treatment 1 2 3 4 Total 18 12 7 60 (6) 10b y1.. (n1.) y1.. 13 11 44 (4) 11 9 1̄2̄ (1) 12 1̄8̄ (2) 9 y2.. (n2.) y2.. 30 (3) 10b y13. (n13) y13. y14. (n14) y14. y11. (n11) y11. 26 12 12 14 18 (2) 9 26 (2) 13 y21. (n21) y21 y22. (n22) y22 3 9 14 10 7 16 14 11 1̄6̄ (2) 8 3̄0̄ (2) 15 48 (4) 12 94 (8) 11.75 y32. (n32) y32. y33. (n33) y33. y34. (n34) y34. y3.. (n3.) y3.. Total 48 (5) 9.6 42 (4) 10.5 42 (3) 14 66 (6) 11 198 (18) 11 y.1. (n.1) y.1. y.2. (n.2) y.2. y.3. n.3 y.3. y.4. n.4 y.4. y... n.. y... (a) nij-values of Table 7.6 j=2 j=3 j=4 Total: ni. i j=1 13 0 1 2 6 22 2 0 0 4 30 2 2 4 8 Total: nj 5 4 3 6 n = 18 aThe basic entries in the table are weights from individual plots. bIn each triplet of numbers, the first is the total weight, the second (in parentheses) is the number of plots in the total, and the third is the mean. numbers of observations (plots), and means are shown for the three treatments, the four varieties, and for all 18 plots. The symbols for the entries in the table in terms of the model (see below) are also shown. a. Model The equation of a suitable linear model for analyzing data of the kind in Table 7.6 is, as discussed in Chapter 4. yijk = ������ + ������i + ������j + ������ij + eijk. (51) The yijk represents the kth observation in the ith treatment and jth variety. In (51), ������ is a mean, ������i is the effect of the ith treatment, ������j is the effect of the jth variety, ������ij is the interaction effect, and eijk is the error term. In general, we have ������i as the effect due to the ith level of the ������-factor, ������j is the effect due to the jth level of the ������-factor, and ������ij is the interaction effect due to the ith level of the ������-factor and the jth level of the ������-factor.
382 THE TWO-WAY CROSSED CLASSIFICATION In the general case, there are a levels of the ������-factor with i = 1, … , a and b levels of the ������-factor, with j = 1, … , b. In the example of Table 7.6, a = 3 and b = 4.With balanced data, every one of the ab cells in a table such as Table 7.6 would have n observations. Furthermore, there would be ab levels of the ������-factor (interaction factor) in the data. However, in unbalanced data, where some cells have no observations, as is the case in Table 7.6, there are only as many ������-levels in the data as there are non-empty cells. Let the number of such cells be s. In Table 7.6 s = 8. Then, if nij is the number of observations in the (i, j)th cell (treatment i and variety j), s is the number of cells for which nij ≠ 0 meaning that nij > 0 or nij ≥ 1. For these cells, ∑nij yij. = yijk k=1 is the total yield in the (i, j)th cell, and yij. = yij. nij is the corresponding mean. Similarly, ∑b ∑b yi.. = yij. and ni. = nij j=1 j=1 are the total yield and the number of observations in the ith treatment. Corresponding values for the jth variety are ∑a ∑a y.j. = yij. and n.j = nij. i=1 i=1 The total yield for all plots is given by ∑a ∑b ∑a ∑b ∑a ∑b ∑nij yijk . y... = yi.. = y.j. = yij. = i=1 j=1 i=1 j=1 i=1 j=1 k=1 The number of observations (plots) therein are ∑a ∑b ∑a ∑b nij. n.. = ni. = n.j = i=1 j=1 i=1 j=1 Examples of these symbols are shown in Table 7.6. The nij notation used here is entirely parallel with that of the previous section, except that there nij = 1 or 0. Here nij ≥ 1 or nij = 0. The model equation y = Xb + e for the data of Table 7.6 is given in (52). Equation (52) follows.
THE TWO-WAY CLASSIFICATION WITH INTERACTION 383 ������ ������1 ������2 ������3 ������1 ������2 ������3 ������4 ������11 ������13 ������14 ������21 ������22 ������32 ������33 ������34 ⎡ 8 ⎤ ⎡ y111 ⎤ ⎡ 1 1 0 0 1 0 0 0 1 0 0 0 0 0 0 0 ⎤ ⎡ e111 ⎤ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ 13 ⎥ ⎢ y112 ⎥ ⎢ 1 1 0 0 1 0 0 0 1 0 0 0 0 0 0 0 ⎥⎡ ������ ⎤ ⎢ e112 ⎥ ⎢ 9⎥ ⎢ y113 ⎥ ⎢1 1 0 0 1 0 0 0 1 0 0 0 0 0 0 0 ⎥⎢ ������1 ⎥ ⎢ e113 ⎥ ⎢ ⎥ ⎢ y131 ⎥ ⎢ 1 0 0 0 0 1 0 0 1 0 0 0 0 0 0 ⎥⎢ ������2 ⎥ ⎢ e131 ⎥ ⎢ 12 ⎥ ⎢ ⎥ ⎢ 1 ⎥⎢ ⎥ ⎢ ⎥ ⎢ 7 ⎥ ⎢ y141 ⎥ ⎢ 1 1 0 0 0 0 0 1 0 0 1 0 0 0 0 0 ⎥⎢ ������3 ⎥ ⎢ e141 ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥⎢ ⎥ ⎢ ⎥ ⎢ 11 ⎥ ⎢ y142 ⎥ ⎢ 1 1 0 0 0 0 0 1 0 0 1 0 0 0 0 0 ⎥ ⎢ ������1 ⎥ ⎢ e142 ⎥ ⎢ ⎥ ⎢ y211 ⎥ ⎢ ⎥⎢ ⎥ ⎢ e211 ⎥ ⎢ 6 ⎥ ⎢ ⎥ ⎢ 1 0 1 0 1 0 0 0 0 0 0 1 0 0 0 0 ⎥⎢ ������2 ⎥ ⎢ ⎥ ⎢ 12 ⎥ ⎢ y212 ⎥ ⎢ 1 0 1 0 1 0 0 0 0 0 0 1 0 0 0 0 ⎥⎢ ������3 ⎥ ⎢ e212 ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥⎢ ⎥ ⎢ ⎥ ⎢ 12 ⎥ ⎢ y221 ⎥ ⎢ 1 0 1 0 0 1 0 0 0 0 0 0 1 0 0 0 ⎥ ⎢ ������4 ⎥ ⎢ e221 ⎥ ⎢ ⎥ = ⎢ y222 ⎥ = ⎢ 1 0 1 0 0 1 0 0 0 0 0 0 1 0 0 0 ⎥ ⎢ ������11 ⎥ + ⎢ e222 ⎥ ⎢ 14 ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ 9 ⎥ ⎢ y321 ⎥ ⎢ 1 0 0 1 0 1 0 0 0 0 0 0 0 1 0 0 ⎥ ⎢ ������13 ⎥ ⎢ e321 ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ 0 0 1 0 1 0 0 0 0 0 0 0 1 0 0 ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ 7⎥ ⎢ y322 ⎥ ⎢1 ⎥ ⎢ ������14 ⎥ ⎢ e322 ⎥ ⎢ 14 ⎥ ⎢ y331 ⎥ ⎢ 1 0 0 1 0 0 1 0 0 0 0 0 0 0 1 0 ⎥ ⎢ ������21 ⎥ ⎢ e331 ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ 1 0 0 1 0 0 1 0 0 0 0 0 0 0 1 0 ⎥ ⎢ ������22 ⎥ ⎢ ⎥ ⎢ 16 ⎥ ⎢ y332 ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ e332 ⎥ ⎢1 ⎥ ⎢ ⎥ ⎢ 10 ⎥ ⎢ y341 ⎥ 0 0 1 0 0 0 1 0 0 0 0 0 0 0 1 ������32 ⎢ e341 ⎥ ⎢ 14 ⎥ ⎢ y342 ⎥ ⎢ 1 0 0 1 0 0 0 1 0 0 0 0 0 0 0 1 ⎥ ⎢ ������33 ⎥ ⎢ e342 ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ 0 0 1 0 0 0 1 0 0 0 0 0 0 0 1 ⎥ ⎢⎣ ������34 ⎦⎥ ⎢ ⎥ ⎢ 11 ⎥ ⎢ ⎥ ⎢1 ⎥ ⎢ ⎥ ⎣⎢ 13 ⎥⎦ ⎢⎣ y343 ⎥⎦ ⎣⎢ 1 0 0 1 0 0 0 1 0 0 0 0 0 0 0 1 ⎥⎦ ⎢⎣ e343 ⎥⎦ y344 e344 (52) b. Normal Equations The normal equations X′Xb◦ = X′y corresponding to y = Xb + e are shown in (53). ������◦ ������1◦ ������2◦ ������3◦ ������1◦ ������2◦ ������3◦ ������4◦ ������1◦1 ������1◦3 ������1◦4 ������2◦1 ������2◦2 ������3◦2 ������3◦3 ������3◦4 ⎡ ������◦ ⎡ 18 6 4 8 5 4 3 6 3 1 2 2 2 2 2 4 ⎤ ⎤ ⎡ y... ⎤ ⎡ 198 ⎤ ⎢ 6 0 0 3 0 1 2 3 1 2 0 0 0 0 0 ⎥ ⎢ ������1◦ ⎥ ⎢ y1.. ⎥ ⎢ ⎥ ⎢ 6 0 4 0 2 2 0 0 0 0 0 2 2 0 0 0 ⎥ ⎢ ������2◦ ⎥ ⎢ ⎥ ⎢ 60 ⎥ 0 0 8 0 2 2 4 0 0 0 0 0 2 2 4 ⎥ ⎢ ������������13◦◦ ⎥ ⎥ ⎢4 3 2 0 5 0 0 0 3 0 0 2 0 0 0 0 ⎥ ⎢ ������2◦ ⎥ ⎢ y2.. ⎥ ⎢ 44 ⎥ ⎢ 0 2 2 0 4 0 0 0 0 0 0 2 2 0 0 ⎥ ⎢ ������3◦ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ 8 1 0 2 0 0 3 0 0 1 0 0 0 0 2 0 ⎥ ⎢ ������������1◦4◦1 ⎥ ⎢ y3.. ⎥ ⎢ 94 ⎥ 2 0 4 0 0 0 6 0 0 2 0 0 0 0 4 ⎥ ⎢ ������1◦3 ⎥ ⎥ ⎢5 3 0 0 3 0 0 0 3 0 0 0 0 0 0 0 ⎥ ⎢ ������1◦4 ⎥ ⎢ y.1. ⎥ ⎢ 48 ⎥ ⎢ 1 0 0 0 0 1 0 0 1 0 0 0 0 0 0 ⎥ ⎢ ������2◦1 ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ 4 2 0 0 0 0 0 2 0 0 2 0 0 0 0 0 ⎥ ⎢ ⎥ ⎢ y.2. ⎥ ⎢ 42 ⎥ 0 2 0 2 0 0 0 0 0 0 2 0 0 0 0 ⎥ ⎢ ⎥ ⎥ ⎢3 ⎥ ⎢ ⎥ ⎢ y.3. ⎥ ⎢ 42 ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ 6 ⎥ ⎢ ⎥ = ⎢ y.4. ⎥ = ⎢ 66 ⎥ ⎥ ⎢ ⎥ ⎥ ⎢3 ⎥ ⎢ ⎥ ⎢ y11. ⎥ ⎢ 30 ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ 1 ⎢ y13. ⎢ 12 ⎥ ⎢2 ⎢ y14. ⎢ 18 ⎥ ⎢ ⎢ ⎢ ⎥ ⎢ 2 ⎢ y21. ⎢ 18 ⎥ ⎢2 0 2 0 0 2 0 0 0 0 0 0 2 0 0 0 ⎥ ⎢ ������2◦2 ⎥ ⎢ y22. ⎥ ⎢ 26 ⎥ ⎢ 0 0 2 0 2 0 0 0 0 0 0 0 2 0 0 ⎥ ⎢ ������3◦2 ⎥ ⎢ y32. ⎥ ⎢ ⎥ ⎢ 2 ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ 16 ⎥ ⎢2 0 0 2 0 0 2 0 0 0 0 0 0 0 2 0 ⎥ ⎢ ������3◦3 ⎥ ⎢ y33. ⎥ ⎢ 30 ⎥ ⎣⎢ 4 0 0 4 0 0 0 4 0 0 0 0 0 0 0 4 ⎥⎦ ⎢⎣ ������3◦4 ⎦⎥ ⎢⎣ y34. ⎥⎦ ⎣⎢ 48 ⎦⎥ (53)
384 THE TWO-WAY CROSSED CLASSIFICATION Properties of normal equations described in Section 4 of Chapter 6 are evident here. The first row of X′X corresponding to the ������-equation, has n.. and the ni.-, n.j-, and nij-values as does the first column and the diagonal. The remaining elements of X′X, other than zeros are the nij-elements. The elements of X′y on the right-hand side are all the totals y..., yi.., y.j., and yij. shown in Table 7.6. As before, the partitioning of X′X highlights its form. c. Solving the Normal Equations The normal equations typified by (53) are easily solved. In (53), the number of equations is p = 1 + a + b + s = 1 + 3 + 4 + 8 = 16. The sum of the ������-equations (the three after the first) is identical to the ������-equation. The sum of the ������-equations enjoys the same property. Thus, there are two linear relationships among the rows of X′X. Furthermore, in the ������-equations, the sum of those pertaining to ������i′j summed over j equals the ������i′ -equation. For example, the ������11-, ������13-, and ������14-equations sum to the ������1-equation. This holds true for all i′ = 1, 2, … , a, representing further linear relationships, a of them, among rows of X′X. Similarly, in summing the ������ij′ -equations over i, the ������j′ -equation is obtained for all j′ = 1, … , b. However, of the b relationships represented here, only b – 1 are linearly independent of those already described. Thus, the total number of linearly independent relationships is 1 + 1 + a + b − 1 = 1 + a + b. Hence the rank of X′X is r = 1 + a + b + s − (1 + a + b) = s. Therefore, in terms of solving the normal equations by the procedure described in (4) of Chapter 6, we set p − r = 1 + a + b + s − s = 1 + a + b elements of b◦ equal to zero. The easiest elements for this purpose are ������◦, all ������i◦(a of them) and all ������j◦(b of them). Setting these equal to zero leaves, from (53), the s = 8 equations 3������1◦1 = 30, 2������2◦2 = 26 ������1◦3 = 12, 2������3◦2 = 16 2������1◦4 = 18, 2������3◦3 = 30 2������2◦1 = 18, 4������3◦4 = 48. In general, the reduced equations are nij������i◦j = yij. with solution ������i◦j = yij., (54) for all the (i, j) cells for which nij ≠ 0, all s of them. Then, the solution for b◦ has the first 1 + a + b elements zero and the rest of the elements given by (54). Thus, we have the solution expressed as [] (55) b◦′ = 01×(1+a+b) y′ where (y′)1×s = a vector of all yij.′s for which nij ≠ 0.
THE TWO-WAY CLASSIFICATION WITH INTERACTION 385 In our example, writing out all of the components of the vector (55), b◦′ = [ 0 0 0 0 0 0 0 y11. y13. y14. y21. y22. y32]. y33. ] 0 y34. [ = 0 0 0 0 0 0 0 0 10 12 9 9 13 8 15 12 (56) from Table 7.6. The simplicity of this solution means that it is virtually unnecessary to derive the generalized inverse of X′X that corresponds to b◦. From (55) and the normal equations (53), [ ] (57) G = 0(1+a+b)×(1+a+b) 0(1+a+b)×s 0s×(1+a+b) D{1∕nij} where D{1∕nij} is a diagonal matrix of order s of the values 1∕nij for the non-zero nij. d. Analysis of Variance (i) Basic Calculations. The analysis of variance for the two-way classification model with interaction is similar to that for the two-way classification without inter- action discussed in Section 1. Indeed, the analysis of variance tables are just like those of Tables 7.2 and 7.3, except for the inclusion of an interaction line corresponding to the sum of squares R(������|������, ������, ������). Calculation of R(������), R(������, ������), R(������, ������), and R(������, ������, ������) is the same except for using y..., yi.., y.j., andyij. respectively in place of y.., yi., y.j, andyij used in the no-interaction model. Thus, similar to (24), (25), and (36), R(������) = n..y2... = y2... , (58) n.. R(������, ������) = ∑a ni.y2i.. = ∑a y2.i. , (59) n.i i=1 i=1 and R(������, ������) = ∑b n.jy2.j. = ∑b y.2j. . (60) n.j j=1 j=1
386 THE TWO-WAY CROSSED CLASSIFICATION The model (51) involves the terms ������, ������i, ������j, and������ij. The sum of squares for fitting it is therefore denoted by R(������, ������, ������, ������). Its value, as usual, is b◦′X′y. With X′y of (53) and b◦′ of (55), this gives R(������, ������, ������, ������) = b◦′X′y = y′(column vector ofyij total) ∑a ∑b (61) = yij.yij. i=1 j=1 = ∑a ∑b nijyi2j. = ∑a ∑b yi2j. . nij i=1 j=1 i=1 j=1 In the last expression of (61), the terms y2ij∕nij are defined only for non-zero values of nij in the data. The other term that we need for the analysis is R(������, ������, ������). This is the sum of squares due to fitting the reduced model yijk = ������ + ������i + ������j + eijk. (62) (63) This is derived exactly as in equation (26). Thus, R(������, ������, ������) = ∑a ni.yi2.. + r′C−1r i=1 where, C = {cjj′ } for j, j′ = 1, 2, … , b − 1 (64) (65) with cjj = n.j − ∑a ni2j , cjj′ = − ∑n nijnij′ for j ≠ j′, and ni. i=1 ni. i=1 { ∑a } for j = 1, 2, … , b − 1. r = {rj} = y.j. − nijyi.. i=1 These are the same calculations as in (16)–(18) using yi.. and y.j. in place of yi. and y.j.
THE TWO-WAY CLASSIFICATION WITH INTERACTION 387 Example 10 Sums of Squares for Data in Table 7.6 Calculation of (58)–(61) for the data of Table 7.6 is as follows R(������) = 1982 = 2178, 18 R(������, ������) = 602 + 442 + 942 = 2188.5, 648 R(������, ������) = 482 + 422 + 422 + 662 = 2215.8, (66) 5436 R(������, ������, ������, ������) = 302 + 122 + ⋯ + 302 + 482 = 2260. 31 24 As usual, the total sum of squares is ∑ ∑a ∑b ∑nij y2 = y2ijk = 82 + 132 + ⋯ + 112 + 132 = 2316. (67) i=1 j=1 k=1 To facilitate calculation of R(������, ������, ������), we use the table of nij’s shown in Table 7.6a. Using the values given there, C of (64) is () ⎡ 32 + 22 2(2) 1(3) ⎤ ⎢ 5 − 64 − − ⎥ − 2(2) 4 ⎥ ⎢ ( 22 + 22 ) 6 ⎥ 4 2(2) ⎥ C = ⎢ 4 − 48 − ⎥ ⎢ (8 ⎦⎥ ⎢ 12 + ) ⎣⎢ − 1(3) − 2(2) 6 22 6 8 3 − 8 ⎡ 15 −6 −3 ⎤ ⎢ ⎥ = 1 ⎢ −6 15 −3 ⎥ . 6 ⎢⎣ −3 −3 14 ⎥⎦ Its inverse is ⎡ 67 31 21 ⎤ ⎢ ⎥ C−1 = 1 ⎢ 31 67 21 ⎥ . 126 ⎢⎣ 21 21 63 ⎦⎥ From Table 7.6 and (65), ⎡ 48 − 3(10) − 2(11) ⎤ ⎡ −4 ⎤ ⎢ ⎥ ⎢ ⎥ r = ⎢ 42 − 2(11) − 2(11.75) ⎥ = ⎢ −3.5 ⎥ . ⎣⎢ 42 − 1(10) − 2(11.75) ⎥⎦ ⎣⎢ 8.5 ⎥⎦ □
388 THE TWO-WAY CROSSED CLASSIFICATION TABLE 7.7 Analyses of Variance for Two-Way Classification with Interaction (Data of Table 7.6) Source of Variation d.f. Sum of Squares Mean Square F-Statistic (a) For fitting ������, and ������, ������, ������|������ Mean: ������ 1=1 R(������) = 2, 178 2178 F(M) = 388.9 R(������, ������, ������|������) = 82 11.71 F(Rm) = 2.1 ������, ������, and ������ after s–1=7 SSE = 56 5.60 ������: ������,������,������|������ SST = 2316 Residual error N – s = 10 Total N = 18 (b) For fitting ������, then ������, then ������ and then ������: that is, for fitting ������, (������|������), (������|������, ������) and (������|������, ������, ������). Mean: ������ 1=1 R(������) = 2, 178 2178 F(M) = 388.9 ������ after ������: ������|������ a–1=2 R(������|������) = 10.5 5.25 F(������|������) = 0.9 ������ after ������ and ������: ������|������, ������ b – 1 = 3 R(������|������, ������) = 36.79 12.26 F(������|������, ������) = 2.2 ������ after ������,������, and s – a – b + 1 R(������|������, ������, ������) = 17.36 F(������|������, ������, ������) = 3.1 ������:������|������, ������, and ������ =2 34.71 Residual error N – s = 10 SSE = 56 5.60 Total N = 18 SST = 2316 (c) For fitting ������, then ������, then ������, and then ������: that is, for fitting ������, (������|������), (������|������, ������) and (������|������, ������, ������). Mean: ������ 1=1 R(������) = 2, 178 2178 F(M) = 388.9 ������ after ������: ������|������ b–1=3 R(������|������) = 37.8 12.60 F(������|������) = 2.3 ������ after ������ and ������: ������|������, ������ a – 1 = 2 R(������|������, ������) = 9.49 4.75 F(������|������, ������) = 0.8 ������ after ������, ������, and ������: s – a – b + 1 R(������|������, ������, ������) = 17.36 F(������|������, ������, ������) = 3.1 ������|������, ������, and ������ =2 34.71 Residual error N – s = 10 SSE = 56 5.6 Total N = 18 SST = 2316 Therefore, (63), using R(������, ������) from (66), gives [ ] ⎡ 67 31 21 ⎤ ⎡ −4 ⎤ R(������, ������, ������) = 2188.5 + −4 ⎢ ⎥ ⎢ ⎥ −3.5 −8.5 1 ⎢ 31 67 21 ⎥ ⎢ −3.5 ⎥ = 2225.29 126 ⎢⎣ 21 21 63 ⎦⎥ ⎣⎢ −8.5 ⎥⎦ (68) If, quite generally, one wishes to fit the model (62) from the beginning to data of the type illustrated in Table 7.6, the procedure just outlined yields the sum of squares for doing so, namely R(������, ������, ������). Thus, the procedure as described in Section 1 for calculating R(������, ������, ������) for the no-interaction model with nij = 0 or 1, is also the basis for calculating R(������, ������, ������) whenever the data are unbalanced. This is the case both when R(������, ������, ������) is needed as part of the analysis of variance for the interaction model and when the prime interest lies in R(������, ������, ������) itself as the reduction in the sum of squares due to fitting the no-interaction model (62).
THE TWO-WAY CLASSIFICATION WITH INTERACTION 389 (ii) Fitting Different Models. Analyses of variance derived from the sums of squares in (66), (67), and (68) are shown in Table 7.7. Their form is similar to that of Table 7.2. Table 7.7a shows the partitioning of the sum of squares R(������, ������, ������, ������) into two parts. They are R(������) and R(������, ������, ������|������) for fitting the ������-, ������-, and ������-factors after the mean. For the data of Table 7.6, R(������) is as shown in (66). This yields R(������, ������, ������|������) = R(������, ������, ������, ������) − R(������) = 2260 − 2178 = 82. In the usual manner, the residual sum of squares is ∑ SSE = y2 − R(������, ������, ������, ������) = 2316 − 2260 = 56. These are the terms shown in Table 7.7a. The corresponding F-statistics are also shown in Table 7.7a. We have that F(M) = 388.9 is significant because it exceeds 4.96, the 5% value of the F1,10-distribution. Hence we reject the hypothesis H: E(y) = 0. On the other hand, F(Rm) = 2.1 is less than the value of the F7,10- distribution, namely, 3.14. As a result, we conclude that the ������-, ������-, and ������-factors in the model are not effective in explaining the variation in the y’s over and above that explained by fitting a mean. The data in Table 7.6 are hypothetical. In the analysis of variance in Table 7.7a, F(Rm) = 2.1 is not significant. Therefore, calculation of the analyses of variance shown in Tables 7.7b and 7.7c is therefore, not necessary. Nevertheless, it is instructive to examine the format of the analyses to see how similar they are to Tables 7.2b and 7.2c. Were F(Rm) of Table 7.7b significant, we would be led to examine whether it was the ������-factor, ������-factor, ������-factor, or some combination thereof that was contributing to this significance. After fitting ������, we could do this in one of two ways. We could either fit ������ and ������, and then ������, ������, and ������, or fit ������ and ������, and then fit ������, ������, and ������. Either way, ������ would be fitted after having fitted ������, ������, and ������. The choice lies in the first fitting after ������, either ������ or ������. This is exactly the situation discussed when describing Tables 7.2. Therefore, Tables 7.7b and 7.7c are similar in format to Tables 7.2b and 7.2c. Table 7.7b shows the partitioning of R(������, ������, ������, ������) for fitting ������, then ������, then ������ and then ������, with lines in the analysis of variance for ������, ������ after ������, ������ after ������ and ������, and finally ������ after ������, ������, and ������. The only difference between Table 7.2 and Table 7.7b is that Table 7.7b contains the sum of squares R(������|������, ������, ������). Of course, this corresponds to the ������-factor which is additional in the interaction model to the ������-and ������-factors that are present in both the interaction and the no-interaction models. Using (68) and (69), we see that the sums of squares of Table 7.7b are R(������) = R(������) = 2178 = 2178, R(������|������) = R(������, ������) − R(������) = 2188.5 − 2178 = 10.5 R(������|������, ������) = R(������, ������, ������) − R(������, ������) = 2225.29 − 2188.5 = 36.79 and R(������|������, ������, ������) = R(������, ������, ������, ������) − R(������, ������, ������) = 2225.29 − 2188.5 = 34.79.
390 THE TWO-WAY CROSSED CLASSIFICATION With a slight error due to rounding off,2 these sums do indeed add to 2260. Thus, they are a partitioning of this sum of s∑quares. These results are shown in Table 7.7b. Nat- urally, R(������) = 2178 and SSE = y2 − R(������, ������, ������, ������) = 56 are the same throughout Table 7.7. Moreover, the middle three entries of Table 7.7b add up to R(������, ������, ������|������) = 82, the middle entry of Table 7.7a, as do the middle entries of Table 7.7c. In this way, Tables 7.7b and 7.7c are partitionings not only of R(������, ������, ������, ������) but also of R(������, ������, ������|������), the sum of the squares due to fitting the model over and above the mean. The analogy between Tables 7.7b and Table 7.2b is repeated in Tables 7.7c and 7.2c. Thus, Table 7.7c has lines in the analysis of variance for ������, (������|������), (������|������, ������), and (������|������, ������, ������). The only difference from Table 7.7b is that R(������|������) and R(������|������, ������) in Table 7.7b are replaced by R(������|������) and R(������|������, ������) in Table 7.7c. Observe that R(������|������) = R(������, ������) − R(������) = 2215.8 − 2178 = 37.8 and R(������|������, ������) = R(������, ������, ������) − R(������, ������) = 2225.29 − 2215.8 = 9.49. Of course, the sum of these, except for a slight round-off error, is the same as the sum of R(������|������) and R(������|������, ������) in Table 7.7b. Observe that R(������|������) + R(������|������, ������) = R(������, ������, ������) − R(������, ������) = R(������|������) + R(������|������, ������). Using values from Table 7.7 we have 37.8 + 9.49 = 2225.29 – 2178 = 10.5 + 36.79 = 47.29. The sum in the above equation both for symbols and substituted numbers is R(������, ������, ������) − R(������) = R(������, ������|������).We now give an R output and program for computation of Tables 7.7b and 7.7c. weight<-c(8,13,9,12,7,11,6,12,12,14,9,7,14,16,10,14,11,13) > treatment<-c(\"ta\",\"ta\",\"ta\",\"ta\",\"ta\",\"ta\",\"tb\",\"tb\",\"tb\",\"tb\", \"tc\",\"tc\",\"tc\",\"tc\",\"tc\",\"tc\",\"tc\",\"tc\") > variety<-c(\"va\",\"va\",\"va\",\"vc\",\"vd\",\"vd\",\"va\",\"va\",\"vb\",\"vb\",\"vb\", \"vb\",\"vc\",\"vc\",\"vd\",\"vd\",\"vd\",\"vd\") > result1<-lm(weight~treatment*variety) > result2<-lm(weight~variety*treatment) > anova(result1) Analysis of Variance Table Response: weight Df Sum Sq Mean Sq F value Pr(>F) treatment 2 10.500 5.250 0.9375 0.42348 variety 3 36.786 12.262 2.1896 0.15232 treatment:variety 2 34.714 17.357 3.0995 0.08965. Residuals 10 56.000 5.600 --- 2 In the first edition, the first author used fractions. The second author chose to use decimals in revising the manuscript.
THE TWO-WAY CLASSIFICATION WITH INTERACTION 391 Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 > anova(result2) Analysis of Variance Table Response: weight Df Sum Sq Mean Sq F value Pr(>F) variety 3 37.800 12.6000 2.2500 0.14507 treatment 2 9.486 4.7429 0.8469 0.45731 variety:treatment 2 34.714 17.3571 3.0995 0.08965. Residuals 10 56.000 5.6000 --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 The SAS output and program follows. The SAS System The GLM Procedure Class Level Information Class Levels Values treatment 3 123 variety 4 1234 Number of Observations Read 18 Number of Observations Used 18 The SAS System The GLM Procedure Dependent Variable: weight Source DF Sum of Squares Mean Square F Value Pr > F Model 7 82.0000000 11.7142857 2.09 0.1400 Error 10 56.0000000 5.6000000 Corrected Total 17 138.0000000 R-Square Coeff Var Root MSE weight Mean 0.594203 21.51302 2.366432 11.00000 Source DF Type I SS Mean Square F Value Pr > F treatment 2 10.50000000 5.25000000 0.94 0.4235 variety 3 36.78571429 12.26190476 2.19 0.1523 treatment*variety 2 34.71428571 17.35714286 3.10 0.0897 Source DF Type III SS Mean Square F Value Pr > F treatment 2 12.47058824 6.23529412 1.11 0.3659 variety 3 34.87213740 11.62404580 2.08 0.1672 treatment*variety 2 34.71428571 17.35714286 3.10 0.0897
392 THE TWO-WAY CROSSED CLASSIFICATION The SAS System The GLM Procedure Class Level Information Class Levels Values treatment 3 123 variety 4 1234 Number of Observations Read 18 Number of Observations Used 18 The SAS System The GLM Procedure Dependent Variable: weight Source DF Sum of Squares Mean Square F Value Pr > F Model 7 82.0000000 11.7142857 2.09 0.1400 Error 10 56.0000000 5.6000000 Corrected Total 17 138.0000000 R-Square Coeff Var Root MSE weight Mean 0.594203 21.51302 2.366432 11.00000 Source DF Type I SS Mean Square F Value Pr > F variety 3 37.80000000 12.60000000 2.25 0.1451 treatment 2 9.48571429 4.74285714 0.85 0.4573 treatment*variety 2 34.71428571 17.35714286 3.10 0.0897 Source DF Type III SS Mean Square F Value Pr > F variety 3 34.87213740 11.62404580 2.08 0.1672 treatment 2 12.47058824 6.23529412 1.11 0.3659 treatment*variety 2 34.71428571 17.35714286 3.10 0.0897 The code to generate this output is data grain; input treatment variety weight; cards; 118 1 1 13 119 …………… 3 4 11 3 4 13 proc glm; class treatment variety; model weight =treatment variety treatment*variety; proc glm; class treatment variety; model weight = variety treatment variety*treatment; run;
THE TWO-WAY CLASSIFICATION WITH INTERACTION 393 An R output and program for Table 4.11 where process is taken as replication and interaction between refinery and source is included is given below. > percentage<-c(31,33,44,36,38,26,37,59,42,42,34,42,28,39,36,32,38, 42,36,22,42,46,26,37,43) > refinery<-c(\"g\",\"g\",\"g\",\"g\",\"g\",\"g\",\"g\",\"g\",\"g\",\"n\",\"n\",\"n\",\"n\", \"n\",\"n\",\"n\",\"n\",\"s\",\"s\",\"s\",\"s\",\"s\",\"s\",\"s\",\"s\") > source<-c(\"t\",\"t\",\"t\",\"t\",\"o\",\"m\",\"t\",\"t\",\"o\",\"m\",\"i\",\"i\",\"i\",\"t\", \"o\",\"m\",\"m\",\"t\",\"o\",\"i\",\"o\",\"o\",\"m\",\"i\",\"i\") > result1<-lm(percentage~refinery*source) > result2<-lm(percentage~source*refinery) > anova(result1) Analysis of Variance Table Response: percentage Df Sum Sq Mean Sq F value Pr(>F) refinery 2 20.96 10.481 0.1507 0.8615 source 3 266.12 88.708 1.2751 0.3212 refinery:source 5 155.47 31.095 0.4469 0.8086 Residuals 14 974.00 69.571 > anova(result2) Analysis of Variance Table Response: percentage Df Sum Sq Mean Sq F value Pr(>F) source 3 261.55 87.184 1.2532 0.3282 refinery 2 25.53 12.767 0.1835 0.8343 source:refinery 5 155.47 31.095 0.4469 0.8086 Residuals 14 974.00 69.571 Observe that source, refinery, and interaction are not significant. A SAS output is given below. The SAS System The GLM Procedure Class Level Information Class Levels Values refinery 3 123 source 4 1234 Number of Observations Read 25 Number of Observations Used 25 The SAS System The GLM Procedure Dependent Variable: percent Source DF Sum of Squares Mean Square F Value Pr > F Model 10 442.560000 44.256000 0.64 0.7616 Error 14 974.000000 69.571429 Corrected Total 24 1416.560000
394 THE TWO-WAY CROSSED CLASSIFICATION R-Square Coeff Var Root MSE percent Mean 0.312419 22.39782 8.340949 37.24000 Source DF Type I SS Mean Square F Value Pr > F refinery 2 20.9627778 10.4813889 0.15 0.8615 source 3 266.1235602 88.7078534 1.28 0.3212 refinery*source 5 155.4736620 31.0947324 0.45 0.8086 Source DF Type III SS Mean Square F Value Pr > F refinery 2 10.7659314 5.3829657 0.08 0.9259 source 3 282.6326238 94.2108746 1.35 0.2972 refinery*source 5 155.4736620 31.0947324 0.45 0.8086 The SAS System The GLM Procedure Number of Observations Read 25 Number of Observations Used 25 The SAS System The GLM Procedure Dependent Variable: percent Source DF Sum of Squares Mean Square F Value Pr > F Model 10 442.560000 44.256000 0.64 0.7616 Error 14 974.000000 69.571429 Corrected Total 24 1416.560000 R-Square Coeff Var Root MSE percent Mean 0.312419 22.39782 8.340949 37.24000 Source DF Type I SS Mean Square F Value Pr > F source 3 261.5516667 87.1838889 1.25 0.3282 refinery 2 25.5346713 12.7673357 0.18 0.8343 source*refinery 5 155.4736620 31.0947324 0.45 0.8086 Source DF Type III SS Mean Square F Value Pr > F source 3 282.6326238 94.2108746 1.35 0.2972 refinery 2 10.7659314 5.3829657 0.08 0.9259 source*refinery 5 155.4736620 31.0947324 0.45 0.8086 The code that generated the above output is data tests; Input refinery source percent;
THE TWO-WAY CLASSIFICATION WITH INTERACTION 395 cards; 1 1 31 1 1 33 ……………… 3 4 37 3 4 43 proc glm; class refinery source; model percent=refinery source refinery*source; proc glm; class source refinery; model percent=source refinery source*refinery; run; (iii) Computational Alternatives. Equation (63) for R(������, ������, ������) is based upon solv- ing the normal equations for the model (62) by “absorbing” the ������-equations and solving for (b – 1) ������’s. This is the procedure described in detail for the no-interaction model in Section 1d. We pointed out there, without explicit presentation of details, that R(������, ������, ������) can also be calculated by solving the normal equations by “absorbing” the ������-equations and solving for (a – 1) ������’s. The calculation of R(������, ������, ������) is then as follows. We have that R(������, ������, ������) = ∑b n.j.y2.j. + u′T−1u (69) j=1 where, T = {tii′ } for i, i′ = 1, 2, … , a − 1 with tii = ni. − ∑b n2ij , n.j j=1 tii′ = ∑b nijni′j for i ≠ i′, (70) − n.j j=1 and { ∑b } for i = 1, 2, … , a − 1. u = {ui} = yi.. − nijy.j. j=1 Table 7.6 involves 3 ������’s and 4 ������’s. For these data, it is therefore, computationally easier to use (69) instead of (63) for calculating R(������, ������, ������) because in (69), T has order 2 whereas in (63) C has order 3. The difference in effort here is negligible. However, the choice of procedure might be more crucial if, say, there were many more ������’s than ������’s or vice versa. (Thus (see Chapter 10), where there may be, say,
396 THE TWO-WAY CROSSED CLASSIFICATION TABLE 7.8 Equivalent Expressions for Sums of Squares in the Analysis of Variance of the Two-Way Classification with Interaction Method Sum of d.f.a Absorbing ������’s (Use When More Absorbing ������’s (Use When More Squares ������’s Than ������’s) See (63) for r′C−1r ������’s Than ������’s)See (69) for u′T−1u Fitting ������ before ������ (Table 7.7b) R(������) 1 ∑n..y2.n..i.yi2. − n..y.2. n∑..y2.n..i.yi2. − n..y2.. R(������|������) a–1 i ∑i n.jy.2j. + u′T−1u − ∑ ni.y2i.. R(������|������, ������) b–1 r′ C−1 r R(������|������, ������, ������) s–a–b+1 ∑ ∑ nijyi2j. − ∑ ni..y2i.. − r′C−1r ji SSE N–s SST N ∑ ∑ nijyi2j. − ∑ n.jy.2j. − u′T−1u i ∑j ∑ y2ijk − i ∑ nij y2ij. i ∑j ∑ y2ijk i ∑ nij y2ij. ∑ ∑ ∑ ∑ − i ∑j ∑k ij i ∑j ∑k ij ∑ yi2jk ∑ yi2jk i jk i jk Fitting ������ before ������ (Table 7.7c) R(������) 1 ∑n..y2.n...jy.2j. − n..y.2.. n∑..y.2n...jy2.j. − n..y2... R(������|������) b–1 R(������|������, ������) a–1 j j R(������|������, ������, ������) s–a–b+1 SSE N–s ∑ ni.y2i.. + r′C−1r − ∑ n.j.y.2j. u′ T−1 u SST N ij ∑ ∑ nijy2ij. − ∑ n.jy2.j. − u′T−1u ∑ ∑ nijyi2j. − ∑ ni..y2i.. − r′C−1r i ∑j ∑ yi2jk − i ∑ nij y2ij. i ∑j ∑ yi2jk i ∑ nij yi2j. ∑ ∑ ∑ ∑ − ∑i ∑j ∑k ij ∑i ∑j ∑k ij yi2jk y2ijk i jk i jk as = number of fitted cells. 2000 ������’s and only 12 ������’s. Then, (69) requiring inversion of a matrix of order 11, is clearly preferable to (63) which demands inverting a matrix of order 1999!) The two alternative procedures for calculating R(������, ������, ������) provide identical numer- ical results, but different symbolic expressions for certain of the sums of square in Table 7.7. We show these expressions in Table 7.8 under the headings “Absorbing ������’s” and “Absorbing ������’s”, which describe the method for solving the normal equations implicit in the procedures. For any given set of data, only one of the procedures need to be used. However, the other always provides a check on the arithmetic involved. The choice of which to use depends on whether there are more or fewer ������’s than ������’s. We can avoid this choice by always denoting the factor with the larger number of effects by ������. Then, the “Absorbing ������’s” procedure will be the one to use. Nevertheless, it is of interest to lay out two sets of expressions. We do this in Table 7.8.
THE TWO-WAY CLASSIFICATION WITH INTERACTION 397 (iv) Interpretation of Results. Other than F(M), the F-statistics in Tables 7.7b and 7.7c are not significant. We would expect this because F(Rm) of Table 7.7a is not significant (see the end of Section 1e). In general, interpretation of the test statistics F(������|������), F(������|������, ������), F(������|������), and F(������|������, ������) in Tables 7.7b and 7.7c is exactly as given in Table 7.4. The possibilities concerning the significance and the non-significance of the F’s are the same here and there. Therefore, the interpretation is the same. Furthermore, Tables 7.7b and 7.7 both have the statistic F(������|������, ������, ������). This provides a test the effectiveness (in terms of accounting for the variation in y) of fitting the model (51) in comparison with fitting the model (1). Since the difference between the two models is the fitting of the interaction effect ������ij in (51), we often refer the test as a test for interaction after fitting the main effects. However, like Table 7.2, the interpretation of F-statistics can be thought of in two ways: 1. as we have already considered, testing the effectiveness of fitting different models; 2. testing linear hypotheses about elements of the model. The context of the second interpretation of the F-statistics makes us better able to consider the meaning of the tests provided by Table 7.7. First, however, we deal with a limitation of the R( ) notation and then, in order to discuss tests of hypothesis, consider estimable functions. (v) Fitting Main Effects Before Interaction. We have defined and freely used notation of the form R(������, ������) − R(������). Formally, it might seem plausible to define R(������|������, ������, ������) = R(������, ������, ������, ������) − R(������, ������, ������). However, before trying to do this, we must take a careful look at the meaning of the interaction ������-factor. In doing so, we will find that R(������|������, ������, ������), as formally defined by the notation, is identically equal to zero. Evidence of this comes from the models (and corresponding sums of squares) that the notation R(������, ������, ������, ������) − R(������, ������, ������) implies. For R(������, ������, ������, ������), the model is (51) and R(������, ������, ������, ������) = ∑a ∑b nijyi2j. i=1 j=1 as in (61). Similarly, in the context of the ������’s and ������’s of (51), the implied model for R(������, ������, ������) is yijk = ������ + ������i + ������ij + eijk. However, this is exactly the model for the two-way nested classification discussed in Section 4 of Chapter 6. Hence, the corre- sponding reduction in the sum of squares is R(������, ������, ������) = ∑a ∑b nijy2ij.. (71) i=1 j=1
398 THE TWO-WAY CROSSED CLASSIFICATION Consequently, R(������|������, ������, ������) = R(������, ������, ������, ������) − R(������, ������, ������) ≡ 0. Similarly, R(������, ������, ������) = ∑a ∑b nijy2ij. = R(������, ������). (72) i=1 j=1 Thus, we also have R(������|������, ������, ������) ≡ 0 ≡ R(������, ������|������, ������). From (61), (71), and (72), we see that the reduction in sum of squares due to fitting any model that contains the interaction ������-factor is ∑a ∑b nijyi2j.. More particularly, in i=1 j=1 (71) and (72), the reduction of any model which, compared to (51), lacks either ������, or ������, or both, is equal to R(������, ������, ������, ������) = ∑a ∑b nijyi2j.. Indeed, as in (72), fitting just (������ i=1 j=1 and) the ������-factor alone leads to the same reduction in the sum of squares. We return to this fact later. Meanwhile, the emphasis here is that in the R( ) notation, there is no such thing as R(������|������, ������, ������) when ������ is the interaction factor between the ������- and ������- factors. This is the underlying reason for there being only two subsections of Table 7.7 after 7.7a. There in 7.7b, we have R(������), R(������|������), R(������|������, ������), and R(������|������, ������, ������) based on fitting ������, ������, ������, and ������ in that order. Likewise, in Table 7.7c, we have R(������),R(������|������), R(������|������, ������), and R(������|������, ������, ������) for fitting ������, ������, ������, and ������ in that order. Notationally, one might be tempted from this to consider other sequences such as ������, ������, ������, and ������, for example. This would give rise to the notation R(������), R(������|������), R(������, ������|������), and R(������|������, ������, ������). However, the latter symbol is, as we have seen identically equal to zero, is not a sum of squares. As a result, in the fitting of ������-, ������-, and ������-factors with ������ representing ������- by ������-interactions, we can fit ������ only in combination with both ������ and ������. We cannot fit ������ unless both ������ and ������ are in the model. Generally, it is true that in the context of the kind of models being considered here, interaction factors can only be fitted when all their corresponding main effects are in the model too. Moreover, only R( ) symbols adhering to this policy have meaning. e. Estimable Functions The basic estimable function for the two-way classification model with interaction is E(yijk) = ������ + ������i + ������j + ������ij.
THE TWO-WAY CLASSIFICATION WITH INTERACTION 399 We shall frequently refer to this expression. Hence, we give it the symbol ������ij. Thus, ������ij = ������ + ������i + ������j + ������ij. (73) Its b.l.u.e. is ���̂���ij = ������ + ������i + ������j + ������ij. = ������◦ + ������i◦ + ������j◦ + ������i◦j . Since the only non-zero elements in b◦ of (55) are ������i◦j = yij., we have that ���̂���ij = yij.. (74) (75a) Moreover, v(���̂���ij) = ������2 , and nij cov(���̂���ij, ���̂���i′j′ ) = 0 unless i = i′ and j = j′. (75b) These results are fundamental to the ensuing discussion. By its definition in (73), ������ij corresponds to the cell in row i and column j of the grid of rows and columns in which the data may be displayed (e.g., Table 7.6). Therefore, ������ij is estimable only if the corresponding (i, j) cell contains observations. This also follows from (74) wherein, ���̂���ij the b.l.u.e. of ������ij exists only for cells that have data, that is, for which there is a yij. value. Therefore, when we say that ������ij is estimable, we implicitly refer only to those ������ij’s that correspond to cells that have data. The other ������ij’s are not estimable. Any linear function of the estimable ������ij’s is estimable. However, because of the presence of ������ij in ������ij, differences between the rows (������’s) or columns (������’s) are not estimable. For example, in Table 7.6, y11. and y21. exist. As a result ������11 and ������21 are estimable. Therefore, ������11 − ������21 = ������1 − ������2 + ������11 − ������21 is estimable. However, ������1 − ������2 is not estimable. Similarly, ������1 − ������3 + ������13 − ������33 and ������1 − ������3 + ������11 − ������13 are estimable but ������1 − ������3 and ������1 − ������3 are not. In general, ∑b ∑b (76) ������i − ������i′ + kij(������j + ������ij) − ki′j(������j + ������i′j) j=1 j=1
400 THE TWO-WAY CROSSED CLASSIFICATION for i ≠ i′ is estimable provided that ∑b ∑b (77) kij = 1 = ki′j j=1 j=1 with kij = 0 when nij = 0 and ki′j = 0 when ni′j = 0. Then the b.l.u.e. of (76) is ∑b ∑b (78) kijyij. − ki′j,yi′j, j=1 j=1 with variance ∑b ( ki2j + ki2′j ) ������2. j=1 nij ni′j A similar result holds for the ������’s. The parametric function ∑a ∑a (79) ������j − ������j′ + hij(������i + ������ij) − hij′ (������i + ������ij′ ), i=1 i=1 is estimable provided that ∑a ∑a (80) hij = 1 = hij′ i=1 i=1 where hij = 0 when nij = 0 and hij′ = 0 when nij′ = 0. The b.l.u.e. of (79) is ∑a ∑a (81) hijyij. − hij′ yij′ . i=1 i=1 It is not possible to derive an estimable function from the ������ij’s which is solely a function of the ������’s and ������’s. On the other hand, it is possible to derive an estimable function that is a function of only the ������’s. Provided that the (ij), (i′j), (ij′), and (i′j′) cells have data in them, the parametric function ������ij,i′j′ ≡ ������ij − ������i′j − ������ij′ + ������i′j′ (82) = ������ij − ������i′j − ������ij′ + ������i′j′ is estimable. Its b.l.u.e. is ���̂���ij,i′j′ = yij. − yi′j. − yij′. + yi′j′.. (83)
THE TWO-WAY CLASSIFICATION WITH INTERACTION 401 The variance of (83) is () 1+ 1 + 1 + 1 v(���̂���ij,i′j′ ) = nij ni′j nij′ ni′j′ ������2. Expressions (76), (79), and (82) are the nearest we can come to obtaining estimable functions of intuitively practical value. We cannot estimate differences between row effects devoid of interaction effects. They are not estimable. They can be estimated only in the presence of average column and interaction effects. For example, with kij = 1∕mi, where mi is the number of filled cells in the ith row (i.e., nij ≠ 0 for mi values of j = 1, 2, …, b), (77) is satisfied and ∑ (������j + ������ij) − ∑ (������j + ������i′j) (84a) ������i − ������i′ + mi j for mi′ j for nij ≠0 nij′ ≠0 is estimable with b.l.u.e. ∑ yij. − ∑ yi′j. . j for mi j for mi′ nij ≠0 ni′ j ≠0 Similarly, because kij = nij∕ni. also satisfies (77), the parametric function ������i − ������i′ + ∑b nij(������j + ������ij) − ∑b ni′j(������j + ������i′j) (84b) ni. ni′. j=1 j=1 is also estimable. Its b.l.u.e. is ∑ nijyij. − ∑ ni′jyi′j. = yi.. − yi′... j ni. j ni′. Example 11 Some Estimable Functions and their b.l.u.e.’s Table 7.6 provides the following examples. First, from (76)–(78) ������1 − ������2 + (������1 + ������11) − (������1 + ������21) = ������1 − ������2 + ������11 − ������21 (85a) is estimable with b.l.u.e. y11. − y21. = 10 − 9 = 1. Similarly, ������1 − ������2 + (������1 + ������11) − 1 (������1 + ������2 + ������21 + ������22) (85b) 2
402 THE TWO-WAY CROSSED CLASSIFICATION is estimable with b.l.u.e. y11. − 1 (y21. + y22.) = 10 − 1 (9 + 13) = −1. 2 2 As far as ������1 − ������2 is concerned, the two estimable functions in (85a) and (85b) are the same. Of course, they involve different functions of the ������’s and the ������’s. In (85a), there are no ������’s because for both rows (treatments) 1 and 2, there are observations in column (variety) 1. (See Table 7.6). An example of (84b) is that ������1 − ������2 + [3(������1 + ������11) + (������3 + ������13) + 2(������4 + ������14)] 6 − [2(������2 + ������32) + 2(������3 + ������33) + 4(������4 + ������44)] 8 is estimable with b.l.u.e. y1.. − y3. = 10 − 11.75 = −1.75. □ Certain other estimable functions deserve mention because they arise in the dis- cussion of tests of hypotheses corresponding to the F-statistics of Table 7.7. The first is ( ∑b n2ij ) ∑a (∑b nijni′j ) ∑b ( ni2j ) ni. n.j n.j nij n.j ������ij ������i = − j=1 ������i − i′≠i j=1 ������i′ + − j=1 (∑b ) − ∑a nijni′j ������i′j. (86) j=1 n.j i′≠i Recall that a linear combination of estimable functions is estimable. The expression in (86) may be rewritten as ������i = ∑b [ + ������i + ������j + ������ij) − ∑a nijnkj ( + ������k + ������j + ] nij(������ n.j ������ ) k=1 ������kj . j=1 It is an estimable function because it is the linear combination of two basic estimable functions. Another similar expression in terms of ������’s and ������’s that is also estimable is ( ∑a n2ij ) ∑b (∑a nijnij′ ) ∑a ( n2ij ) n.j ni. ni. ������j′ nij ni. ������ij ������j = − i=1 ������.j − j′≠j i=1 + − i=1 (∑a ) − ∑b nijnij′ ������ij′ . (87) i=1 ni. j′≠j
THE TWO-WAY CLASSIFICATION WITH INTERACTION 403 Naturally, for ������ij,i′j′ as defined in (82), functions of estimable ������’s are also estimable. However, certain functions of non-estimable ������’s are also estimable. For example, with the data of Table 7.6 ������11,22 = ������11 − ������21 − ������12 + ������22 and ������12,33 = ������12 − ������32 − ������13 + ������33 are not estimable, because ������12 is not. (There are no observations for treatment 1 and variety 2.) However, the sum of these two ������’s does not involve ������12 and is estimable. Thus, we have that ������ = ������11,22 + ������12,33 = ������11 − ������21 + ������22 − ������32 − ������13 + ������33 (88) = ������11 − ������13 − ������21 + ������22 − ������32 + ������33 is estimable. For each of the ������ij in (88), there is at least one observation in treatment i and variety j so that all of the ������ij are estimable. Hence ������ is estimable. In general, if each of the two non-estimable ������’s involves only a single non-estimable ������ij which is common to both ������’s, then the sum or difference of those ������’s will not involve that ������ij and will be estimable. An example of this situation is given by (88). f. Tests of Hypotheses (i) The General Hypothesis. As has already been well-established, the F-statistic for testing H : K′b = 0, is for K′ of full rank s∗, Q with Q = (K′b)′(K′GK)−1K′b◦. (89) F = s∗���̂���2 Furthermore, hypotheses are testable only when they can be expressed in terms of estimable functions—in this case in terms of the ������ij’s. Thus, any testable hypothesis concerning K′b will involve linear functions of the ������ij’s. By the nature of the ������ij, no matter what functions of the ������’s and ������’s are involved in K′b, the functions of the ������ij’s will be the same as those of the ������ij’s. Thus, if ������ = {������ij} and ������ = {������ij}, for nij ≠ 0, (90) then, when K′b = L′������, that part of K′b that involves ������ is L′������. In (55), the only non-zero elements of b◦ are ������◦ = {������i◦j } = y = {yij} for nij ≠ 0. (91) Similarly, in (57), the only non-null sub-matrix in G is the diagonal matrix D{ 1 } nij corresponding to ������◦. Therefore, to test the hypothesis H : K′b = 0 equivalent to L′������ = 0, (92)
404 THE TWO-WAY CROSSED CLASSIFICATION Q of (89) becomes [ { } ]−1 (93) Q = y′L L′D 1 L Ly. nij Example 12 Testing the Hypothesis L′������ = 0 for Data of Table 7.6 For Table 7.6, ������ ′ = [ ������13 ������14 ������21 ������22 ������32 ������33 ] (94) ������11 ������34 and y′ = [ y13. y14. y21. y22. y32. ] y33. ] (95) [ y11. y34. = 10 12 9 9 13 8 15 12 . In (85), ������1 − ������2 + ������11 − ������21 is estimable, for which L′������ = ������11 − ������12 has L′ = [ 1 0 0 −1 0 0 0 ] 0. In addition, from (53), {} [ ] D = D 1 = diag 1 1 1 1 1 1 1 1 , (96) nij 3 2 2 2 2 2 4 so that [] L′D = 1 1 3 0 0 − 2 0 0 0 0 and () L′DL = 1 + 1 = 5 . 32 6 Therefore, for testing the hypothesis ������1 − ������2 + ������11 − ������21 = 0 we have Q = (10 − 9) ( 5 )−1 (10 − 9) = 1.2. 6 In this way, we need only look at the ������ij elements of a hypothesis in order to derive L′ and so calculate Q of (89). □ (ii) The Hypothesis for F(M). In earlier discussing Table 7.7, we interpreted the sum of squares therein as reductions in the sum of squares due to fitting different models. We now consider their meaning in terms of testing hypotheses. In this context, we only deal with hypotheses about the two-way classification interaction model, (51). In particular, we establish the linear hypotheses corresponding to each
THE TWO-WAY CLASSIFICATION WITH INTERACTION 405 of the six different F-statistics in Tables 7.7b and 7.7c. The first of these F-statistics is F(M). Results for the general case (e.g., equation (15) of Chapter 6) indicate that F(M) can be used to test the hypothesis H: E(y) = 0. In the present case, this is equivalent to ∑a ∑b (97) H: nij������ij = 0 for nij ≠ 0. i=1 j=1 In terms of (92), the hypothesis in (97) can be expressed as L′������ = 0 for L′ being the vector L′L′ = [ ⋯ ] for those nij ≠ 0. (98) n11 nab Hence, L′D = 1′ with L′DL = N. (99) For (93), we can show that L′y = y.... As a result, (93) becomes Q = R(������). This confirms the numerator of F(M). (iii) Hypotheses for F(������|������) and F(������|������). We will show that R(������|������) is the numer- ator sum of squares for testing H: 1 ∑ equal for all i. (100a) ni. nij������ij i This hypothesis may also be stated as H: ������i + 1 ∑ nij (������ j + ������ij) equal for all i. (100b) ni. j The hypothesis in (100a) and (100b) can be expressed as a – 1 independent differences H: 1 ∑ − 1 ∑ = 0 for i = 2, 3, … , a. (100c) n1. n1j������1j ni. nij������ij j j We can then see that for (93) that the (i – 1)th row of L′ is for i = 2, 3, … , a, [ n11 n1b − ni1 ⋯ − nib ] n1. n1. ni. ni. 0′ . ������i′−1 = ⋯ 0′ corresponding corresponding (101) to n1j ≠ 0 to nij ≠ 0
406 THE TWO-WAY CROSSED CLASSIFICATION We can show from this that the (i – 1)th element of L′y is y1.. − yi.. and that L′DL = (1∕n1.)J + D{ni.} for i = 2, 3, … , a. Algebraic simplification based on results in Exercise 20 leads to Q of (93) reducing to R(������|������). Hence (100b) is the hypothesis tested by F(������|������). Example 13 The Numerator of the Test Statistic for R(������|������) in Table 7.6 For the data of Table 7.6, consider H: ������1 + 1 [3(������1 + ������11) + (������3 + ������13) + 2(������4 + ������14)] 6 1 −{������2 + 4 [2(������1 + ������21) + 2(������2 + ������22)]} = 0 ������1 + 1 [3(������1 + ������11) + (������3 + ������13) + 2(������4 + ������14)] 6 1 −{������3 + 8 [2(������2 + ������32) + 2(������3 + ������33) + 4(������4 + ������34)]} = 0. We then have, ⎡3 1 2 − 2 − 2 0 0 0⎤ ⎢ 6 6 6 4 4 −2 −2 ⎥ L′ = ⎣⎢ 3 1 2 ⎥⎦ , (102) 6 6 6 8 8 −4 (103) 0 0 8 [ ][ ][ ] L′y = y1.. − y2.. = 10 − 11 = −1 y1.. − y3.. 10 − 11.75 −1.75 and ⎡1 1 1 − 1 − 1 0 0 0⎤ ⎢ 6 6 6 4 4 −1 −1 ⎥ L′D = ⎢⎣ 1 1 1 6 6 6 8 8 1 ⎦⎥ 0 0 − 8 where D is given by (96). Furthermore, ⎡5 1⎤ with (L′DL)−1 = 4 [ 7 −4 ] ⎢ 12 6⎥ . L′DL = ⎢⎣ 1 7 ⎦⎥ 6 24 9 −4 10 Hence, [ −1.75 ] 4 [ 7 −4 ] [ −1 ] Q = −1 = 10.5 = R(������|������) 9 −4 10 −1.75 of Table 7.7b. □
THE TWO-WAY CLASSIFICATION WITH INTERACTION 407 Analogous to the above, R(������|������) is the numerator sum of squares for testing H: ������j + 1 ∑ + ������ij) equal for all j. n.j nij(������i i Exercise 11 provides an example. (iv) Hypotheses for F(������|������, ������) and F(������|������, ������). These F-statistics test the hypothe- ses H: ������i = 0 for all i and H: ������j = 0 for all j, ∑respia=e1ct���i���vi e=ly,0.wThoesreee ������i and ������j are given by (86) and (87). First, observe that this, notice that ∑a [ ∑b ni2j ∑a ∑b ][ ni2j ] ������i ∑a − n.j − nijni′j ∑a ∑b n.j ∑ nijni′j = n.j + ������ij nij − − i=1 ������i ni. j=1 i′≠i j=1 n.j i=1 j=1 i′ ≠i i=1 ][ ] [ nij(n.j − ni′j) = ∑a ∑b n2ij ∑b nij(n.j − nij) ∑a ∑b nij − n2ij − − n.j − n.j + ������ij n.j n.j ������i ni. j=1 j=1 i=1 j=1 i=1 ≡ 0. Therefore, the hypotheses in H: ������i = 0 for all i are not independent. Restating them as a set of independent hypotheses, we have H: ������i = 0 for i = 1, 2, … , a − 1. (104) Writing these hypotheses in the form L′������ = 0 the ith row of L′ is, for i = 1, … , a − 1, given by ⎡ { nijnkj } ⎤′ ⎢ − ⎥ ⎢ n.j for j = 1, … , b and k = 1, … , i − 1, and nkj ≠ 0 ⎢ j = 1, … , b and nij ≠ 0 and nkj ≠ ⎢ { n2ij } = 1, … , b and k = i + 1, … , a, ⎥ ⎢ nij n.j ⎥ ������i′ ⎢ ⎥ = ⎢ − for ⎥ . (105) ⎣⎢ { } ⎥ − nijnkj ⎥ for j 0 ⎥⎦ n.j
408 THE TWO-WAY CROSSED CLASSIFICATION We may then show that, for (93), the ith element of L′y is ∑ ∑ ( nijnkj ) + ( − ni2j ) = yi.. − ∑ − n.j ykj ∑ n.j yij. nijy.j.. k≠j j nij j j Thus, { ∑b } for i = 1, … , a − 1. L′y = yi.. − nijy.j. j=1 In a like manner, we can show that the diagonal elements of L′DL are ni. − ∑b ni2j for i = 1, 2, … , a − 1 n.j j=1 and that the off-diagonal elements of L′DL are − ∑b nijni′j for i ≠ i′ = 1, 2, … , a − 1. j=1 n.j By analogy for testing H: ������j = 0 for j = 1, … , b − 1 we have, { ∑a } L′y = y.j. − nijyi.. for j = 1, 2, … , b − 1. i=1 The matrix L′DL has diagonal elements n.j − ∑a n2ij for j = 1, 2, … , b − 1 ni. i=1 and off-diagonal elements − ∑a nijnij′ for j ≠ j′ = 1, 2, … , b − 1. i=1 ni.
THE TWO-WAY CLASSIFICATION WITH INTERACTION 409 However, in this case, we see from (64) and (65) that L′y = r and L′DL = C. Therefore, in (93), from (63) Q = r′C−1r = R(������|������, ������). Hence, F(������|������, ������) of Table 7.7b tests H : ������′ = 0, that is, ( ∑a ni2j ) ( nij nij′ ) ( n2ij ) − ∑b ∑a ( nijnij′ ) n.j − ni. ∑b ∑a ni. ∑a ni. ������ij ������ij′ H : ������j − ������j′ + nij − ni. = 0 i=1 j≠j′ i=1 i=1 j≠j′ i=1 for j = 1, 2, … , b − 1, (106) equivalent to the same hypothesis for i = 1, 2, … , a. Correspondingly, F(������|������, ������) of Table 7.7c tests H: ������i = 0, that is, ( ∑b n2ij ) ( nij ni′ j ) ( n2ij ) ∑a ∑b ( nij ni′ j ) ni. − n.j ∑a ∑b n.j ∑b n.j n.j ������i′ j H: ������i − ������i′ + nij − ������ij − i′ ≠i j=1 = 0 j=1 i′≠i j=1 j=1 for i = 1, 2, … , a − 1. (107) The hypothesis in (107) is equivalent to the same hypothesis for i = 1, 2, … , a. Observe that in (106), the coefficients of the ������’s are the elements cjj′ of C in (64) and the coefficients of the ������’s, if summed over i, are also the cjj′ ’s. Analogous properties hold for the coefficients of the ������’s and the ������’s in (107). Example 14 Calculating the Test Statistics for Testing Hypothesis for F(������|������, ������) According to (92), the L′ matrix for the hypothesis in (107) is obtained for the coefficients of the ������’s whose terms are ∑b ( n2ij ) ∑a ∑b ( nijni′ ) nij n.j ������ij n.j ������i′ j=1 − − i′≠i j=1 j for i = 1, 2, … , a − 1. j For the data of Tables 7.6 and 7.6a, the value of L′ for the hypothesis (107) is L′ = ⎡ 3 − 32 1 − 12 2 − 22 − 3(2) 0(2) 0(2) − 1(2) − 2(4) ⎤ ⎢ 5 5 4 3 6 ⎥ 3 6 4 ⎢⎣ − 2(3) 2 − 22 − 22 0 0 ⎦⎥ (108) 0 0 2 − 22 5 5 4 [ 4 −20 ] = 1 18 10 20 −18 0 0 −10 . 15 −18 0 0 18 15 −15 0 0
410 THE TWO-WAY CROSSED CLASSIFICATION Thus, [] L′D = 1 6 10 10 −9 0 0 −5 −5 (109) 15 −6 0 0 9 7.5 −7.5 0 0 As a result, L′DL = 1 [ 16 ] with (L′DL)−1 = 1 [ ] −6 11 6 5 −6 11 . 28 6 16 Furthermore, [] L′y = 1 −24 . 5 19 Therefore, in (93), Q = 1 [ ] 1 [ 11 6 ] 1 [ −24 ] = 9.49 = R(������|������, ������) of Table 7.7c. −24 19 16 5 9 5 28 6 □ (v) Hypotheses for F(������|������, ������, ������). The hypothesis tested by F(������|������, ������, ������) takes the following form, where s – a – b + 1 is the degrees of freedom of the numerator of the F-statistic, R(������|������, ������, ������). ⎛ Any column vector consisting of s − a − b + 1 ⎞ ⎜ ⎟ ⎜ linearly independent function of the ⎟ H: ⎜ ������ij,i′ j′ = ������ij − ������i′j − ������ij′ + ������i′j′ where such ⎟ = 0. (110) ⎜ ⎟ ⎜ functions are either estimable ������′s or estimable ⎟ ⎝⎜ sums or differences of ������′s. ⎠⎟ As used here ������ij,i′j′ is as defined in (82). The estimable sums and differences of ������′s are those defined in (88). Writing the hypotheses as L′������ = 0, where L′ has order s – a – b + 1 by s and rank s – a – b + 1, it follows from the nature of the ������′s that L′1 = 0. Furthermore, the equations L′������ = 0 have a solution ������ij = ������ for all i and j for which nij ≠ 0. Therefore, the reduced model corresponding to the hypothesis is E(yijk) = (������ + ������) + ������i + ������j for which the reduction in the sum of squares is R(������, ������, ������). Therefore, in accord with Section 6d(ii) of Chapter 3, Q = R(������, ������, ������, ������) − R(������, ������, ������) = R(������|������, ������, ������). As a result, F(������|������, ������, ������) tests the hypothesis in (110).
THE TWO-WAY CLASSIFICATION WITH INTERACTION 411 Example 15 Test of a Specific Hypothesis About the ������’s For the data of Table 7.6, we can test the hypothesis H: { ������13 − ������33 − ������14 + ������34 = 0 (111) ������11 − ������21 − ������12 + ������22 + (������12 − ������32 − ������13 + ������33) = 0. In keeping with (82), the first relationship in (111) is ������13,34 = 0. As in (88), the second relationship in (111) is ������12,34 = 0. Rewriting (111) in terms of the elements of the model, this hypothesis is H: { ������13 − ������33 − ������14 + ������34 = 0 (112) ������11 − ������21 + ������22 − ������13 − ������32 + ������33 = 0. The second function of the ������’s in (112) is (88). Writing the hypothesis in (112) as L′������ = 0 gives L′ = [ 0 1 −1 00 0 −1 1 ] (113) . 1 −1 0 −1 1 −1 1 0 Then, L′y = [ 0 ] 9 and [ 0 1 − 1 0 0 0 − 1 1] −1 2 2 4. L′D = 1 1 1 1 1 0 (114) 0 − 2 2 − 2 2 3 As a result, [] [] L′DL = 1 27 −18 and (L′DL)−1 = 1 40 18 . 12 −18 40 63 18 27 Hence, in (93), [ ] 1 [ 40 18 ] [ 0 ] Q= 0 9 = 34.71 = R(������|������, ������, ������) 63 18 27 9 of Tables 7.7b and 7.7c. Hence (111) is the hypothesis tested by F(������|������, ������, ������). □ Note that hypotheses of this nature involve not only functions of the form ������ij,i′j′ = ������ij − ������i′j − ������ij′ + ������i′j′ = ������ij − ������i′j − ������ij′ + ������i′j′ , as is the first in (111). They also involve sums and differences of such functions, as is the second in (111). As has already been
412 THE TWO-WAY CROSSED CLASSIFICATION explained in the description of ������ in (88), we choose these sums and differences to eliminate a ������ij that is not estimable. Thus, the second function in (111) is not only ������11 − ������21 + ������22 − ������13 − ������32 + ������33 = ������11 − ������21 − ������12 + ������22 (115) +(������12 − ������32 − ������13 + ������33). It is also, ������11 − ������21 + ������22 − ������13 − ������32 + ������33 = ������22 − ������32 − ������23 + ������33 (116) −(������21 − ������11 − ������23 + ������13). Equation (116) eliminates the non-estimable ������23. The exact form of these functions corresponding to any particular R(������|������, ������, ������) also depends entirely on the available data. The pattern of non-empty cells is the determining factor in establishing which functions of the ������’s make up the hypotheses tested by F(������|������, ������, ������) and which do not. For example, for Table 7.6, one function that is not estimable is ������11 − ������31 − ������13 + ������33 − (������21 − ������31 − ������24 + ������34) = ������11 − ������13 + ������33 − ������21 +������24 − ������34. This function is not estimable because although it eliminates the non-estimable ������31, it still retains the non-estimable ������24. (vi) Reduction to the No-Interaction Model. We would anticipate that the hypothe- ses tested by F(������|������) and F(������|������, ������) in the interaction model reduce to those tested by the same statistics in the no-interaction model. We establish this result here. In the interaction model, F(������|������) tests the hypothesis (100b): H: ������i + 1 ∑ nij (������ j + ������ij) equal for all i. ni. j Putting all ������ij = 0 converts the interaction model into the no-interaction model and transforms the above hypothesis into H: ������i + 1 ∑ nij ������ j equal for all i. ni. j This is identical to that tested by F(������|������) in the no-interaction model as discussed after Example 6. Similarly, in the interaction model, the hypothesis tested by F(������|������, ������) is that given in (106). Putting all ������ij = 0 in (106) reduces the hypothesis to ( ∑a n2ij ) ∑b (∑a nijnij′ ) n.j − ni. − ni. H: ������j ������j′ = 0 for all j. □ i=1 j≠j′ i=1
THE TWO-WAY CLASSIFICATION WITH INTERACTION 413 This represents b – 1 linearly dependent equations in b parameters ������1, ������2, … , ������b. They only hold when all of the ������j’s are equal. In this situation, the hypotheses in (106) reduces to H: equality of all ������j’s. This is the hypothesis tested by F(������|������, ������) in the no-interaction model as indicated in Section 1g. (vii) Independence Properties. As indicated in Section 5g of Chapter 5, the sums of squares for testing hypotheses k′ib = 0 and k′jb = 0 are, on the basis of underlying normality assumptions, independent if k′iGk′j = 0. This property can be used to show that the sums of squares in Tables 7.7a, b, and c are independent. To see this, consider ������i′D������j∗ where ������i′ is a row of L′ for one sum of squares and ������j∗′ is a row of L′ for some other sum of squares in the same section of Table 7.7. For example, from (99), ������i′D of R(������) is 1′ and from (102) an ������j∗′ of R(������|������) is ������j∗′ = [] 3 1 2 2 2 6 6 6 − 4 − 4 0 0 0. Hence, ������i′D������j∗ = 1′������j∗ = 0. We will find that the same result is true for the other row of L′ in (102). We thus conclude that R(������) and R(������|������) are independently distributed. In this way, the independence of the R( )’s is readily established for Tables 7.7a, b, and c. Expressions for L′D are given in equations (99), (103), (109), and (114), and for L′ in (98), (102), (108), and (113). g. Models that Include Restrictions Since, as in (76), ∑b ∑b ������i − ������i′ + kij(������j + ������ij) − ki′j(������j + ������i′j) j=1 j=1 is estimable, for the k’s satisfying (77), it follows that if the model includes restrictions ∑k (117) kij(������j + ������ij) = 0 for all i, for nij ≠ 0, j=1 it follows that ������i − ������i′ is estimable. A particular case of this might be when kij = nij∕ni., as in (84). In this case, (117) becomes ∑k (118) nij(������j + ������ij) = 0 for all i, for nij ≠ 0. j=1
414 THE TWO-WAY CROSSED CLASSIFICATION Then the corresponding b.l.u.e. of ������i − ������i′ is then yi.. − yi′... However, there seems to be little merit in having either (117) or (118) as part of a model because both of them are data-dependent. The same thing applies to restrictions that reduce the F- statistics of Table 7.7 to hypotheses that have meaningful interpretation, for example, a hypothesis of equality of the ������’s. As inherent parts of a model, these restrictions suffer from the same deficiencies, as do all such restrictions, as discussed in Sections 1h and 2h of Chapter 6. h. All Cells Filled For data having empty cells such as those of Table 7.7, the nature of which functions are estimable depends entirely on which nij’s are not zero. For example, with the Table 7.6 data, ������2 + ������22 − (������3 + ������32) is estimable but ������1 + ������12 − (������3 + ������32) is not. In contrast, when all cells contain at least one observation, (∑b ∑b ) ������ij − ������i′j j=1 j=1 (119) ������ii′ = ������i − ������i′ + b is estimable for all i ≠ i′. The function in (119) is a special case of that in (76), where kij = ki′j = 1∕b. Its b.l.u.e. is (∑b ∑b ) yij. − yi′j. j=1 j=1 . (120) ���̂���ii′ = b We can test hypotheses about (119). The statistic that tests (∑b ∑b ) ������ij − ������i′j j=1 j=1 =0 H: ������i − ������i′ + b is [∑b ]2 (yij. − yi′j.) j=1 F= ∑b (1∕nij + 1∕ni′j)���̂���2 j=1
THE TWO-WAY CLASSIFICATION WITH INTERACTION 415 with 1 and s – a – b + 1 degrees of freedom. Furthermore, we can also test the joint hypothesis H: ������i ∑b ������ij all equal, for i = 1, … , a. (121) + b j=1 The F-statistic for doing so is (∑b )2 ⎛ ∑b ⎞ yij. ⎜ yij. ⎟ ⎜⎜∑a ⎟ ∑a j=1 − ⎜ j=1 ⎟ ∕ ∑a 1 ⎟ i=1 ∑b ⎜ i=1 ∑b ⎟ i=1 ∑b 1∕nij 1∕nij ⎟⎠ 1∕nij ⎝⎜ j=1 j=1 j=1 F= . (a − 1)���̂���2 (122) ∑b If the model includes the restrictions j=1 yij. = 0 for all i = 1, 2, …, a, then (119) reduces to ������i − ������i′ . It is estimable with b.l.u.e. given by (120). The hypothesis (121) becomes H: equality of all ������i’s. We then test this hypothesis using (122). We can obtain results paralleling (119) through (122) for ������’s in a similar fashion. i. Balanced Data There is great simplification of the preceding results when nij = n for all j, just as in the no-interaction case and I. The calculations become those of the familiar two-factor analysis with replication (e.g., see p. 110 of Scheffe (1959) and pp. 255–256 of Gruber (2014)). As before, the solutions to the normal equations are ������i◦j = yij. . These are the only non-zero elements of b◦. If the model includes restric- tions ∑a ∑b ∑a ∑b ������i = ������j = 0, ������ij = 0 for all j and ������ij = 0 for all i, i=1 0, j=1 i=1 j=1 then both ������i − ������i′ and ������j − ������j′ are estimable. Their respective b.l.u.e.’s are ������̂i − ������i′ = yi.. − yi′.. and ������̂j − ������j′ = y.j. − y.j′.. Their respective variances are 2������2∕bn and 2������2∕an. The analysis of variance tables of Table 7.7 and 7.8 also simplify, just as did Tables 7.2 and 7.3 in the no- interaction case. Thus, R(������|������) and R(������|������, ������). become identical. The same is true of R(������|������) and R(������|������, ������). We have that ∑a (123a) R(������|������) = R(������|������, ������) = bn (yi.. − y...)2 i=1
416 THE TWO-WAY CROSSED CLASSIFICATION TABLE 7.9 Analysis of Variance for a Two-Way Classification with Interaction, with Balanced Data (all nij = n) (Both Parts of Table 7.8 Simplify to this When nij = n) Source of Variation d.f. Sum of Squares Mean 1 R(������) = abny2... ������ after ������ a–1 ∑a ������ after ������ b–1 ������ after ������, ������, and ������ (a – 1)(b – 1) R(������|������) = R(������|������, ������) = bn (yi.. − y...)2 Residual error ab(n – 1) Total abn i=1 ∑b R(������|������, ������) = R(������|������) = an (y.j. − y...)2 j=1 R(������|������, ������, ������) = n ∑a ∑b (y − yi.. − y.j. + y... )2 ij. i=1 j=1 SSE = ∑a ∑b ∑c (yijk − yij.)2 i=1 j=1 k=1 SST = ∑a ∑b ∑n y2ijk i=1 j−1 k=1 and ∑b (123b) R(������|������, ������) = R(������|������) = an (y.j. − y...)2. j=1 This is the same as in (50).When using the statistical software package SAS for balanced data, the type I sum of squares corresponding to R(������|������) and R(������|������, ������) and the type III sum of squares corresponding to R(������|������, ������) and R(������|������, ������) are the same. Table 7.9 shows the familiar analysis of variance. It is similar to Table 7.5. As was the case there, here distinction between fitting “������ after ������” and “������ after ������ and ������” is no longer necessary. They are both “������ after ������” with reduction in the sum of squares R(������|������) as shown in Table 7.9. As we would expect, for the case of balanced data, the numerator of (122) also reduces to R(������|������) of (123a).When doing the analysis of variance with a hand-held calculator to minimize round-off error, we recommend the computing formulae listed below. They are, R(������|������) = 1 ∑a − 1 y2..., bn yi2.. abn i=1 R(������|������) = 1 ∑b − 1 y2..., an y.2j. abn j=1 and R(������|������, ������, ������) = 1 ∑a ∑b − y.2.. − R(������|������) − R(������|������) n yi2j. abn i=1 j=1
THE TWO-WAY CLASSIFICATION WITH INTERACTION 417 Furthermore, SSTm = ∑a ∑b ∑n − y.2.. yi2jk abn i=1 j=1 k=1 and SSE = SSTm − R(������|������) − R(������|������) − R(������|������, ������, ������). These formulae may be shown to be algebraically equivalent to those in Table 7.9. Example 16 Sums of Squares Computation for Balanced Data These data are from Chapter 14, Problem 14-2 of Montgomery Runger (2007), reproduced with the permission of John Wiley & Sons. The discussion and solution is a slight modification of that in Gruber (2014), also used with the permission of John Wiley & Sons. An engineer suspects that the type of paint used and the drying times influences the surface finish of metal paint. He selected three drying times: 20, 25, and 30 minutes, and used two types of paint. Three parts were tested with each combination of paint and drying time. The data are as follows: Drying Time Minutes Paint 20 25 30 1 74 73 78 64 61 85 2 50 44 92 92 98 66 86 73 45 68 88 85 Source: Montgomery, D.C. and G.C. Factor A is the paint so a = 2. Factor B is the drying time so b = 3. There are three replications so that c = 3. Assign i = 1 to paint 1 and i = 2 to paint 2. Assign j = 1 to 20 minutes, j = 2 to 25 minutes, and j = 3 to 30 minutes. Then, x1.. = 621 and x2.. = 701. Also x.. = 1322. Then, R(������|������) = SSA = 6212 + 7012 − 13222 = 355.556. 9 9 18 To compute SSB = R(������|������) = R(������|������, ������), observe that x.1. = 434, x.2. = 437, and x.3. = 451. Then, R(������|������) = SSB = 4342 + 4372 + 4512 − 13222 = 27.4444. 6 6 6 18
418 THE TWO-WAY CROSSED CLASSIFICATION For interaction, we need to calculate the cell sums. We have x11. = 188, x12. = 178, x13. = 255, x21. = 246, x22. = 259, and x23. = 196. Now, SSM = 1882 + 1782 + 2552 + 2462 + 2592 + 1962 − 13222 = 2261.78 3 3 3 3 3 3 18 and R(������|������, ������, ������) = SSI = SSM − SSA − SSB = 2261.78 − 355.556 − 27.4444 = 1878.78 The total sum of squares corrected for the mean is TSS = 101598 − 13222 = 4504.44 18 and the error sum of squares is SSE = SST − SSA − SSB − SSI = 4504.44 − 355.556 − 27.444 − 1878.78 = 2242.66. Summarizing this in the ANOVA table Source df Sum of Squares Mean Square F Paint 1 355.556 355.556 1.90251 Drying Time 2 27.4444 13.7222 Interaction 2 1878.78 939.39 0.07342 Error 12 2242.66 186.888 5.02649∗ Total 17 4504.44 It appears that the finish is not affected by either the paint or the drying time. However, there is a significant interaction between the choice of paint and the drying time.An R program and output is below. > finish<-c(74,73,78,64,61,85,50,44,92,92,98,66,86,73,45,68,88,85) > paint<-c(\"a\",\"a\",\"a\",\"a\",\"a\",\"a\",\"a\",\"a\",\"a\",\"b\",\"b\",\"b\",\"b\",\"b\", \"b\",\"b\",\"b\",\"b\") > time<-c(\"d\",\"e\",\"f\",\"d\",\"e\",\"f\",\"d\",\"e\",\"f\",\"d\",\"e\",\"f\",\"d\",\"e\", \"f\",\"d\",\"e\",\"f\") > result<-lm(finish~paint*time) > anova(result) Analysis of Variance Table Response: finish
THE TWO-WAY CLASSIFICATION WITH INTERACTION 419 Df Sum Sq Mean Sq F value Pr(>F) paint 1 355.56 355.56 1.9025 0.19296 time 2 27.44 13.72 0.0734 0.92962 paint:time 2 1878.78 939.39 5.0265 0.02596 * Residuals 12 2242.67 186.89 --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 The SAS output is The SAS System The GLM Procedure Class Level Information Class Levels Values PAINT 2 12 TIME 3 20 25 30 Number of Observations READ 18 Number of Observations Used 18 The SAS System The GLM Procedure Dependent Variable: finish Source DF Sum of Squares MEAN Square F Value Pr > F Model 5 2261.777778 452.355556 2.42 0.0973 Error 12 2242.666667 186.888889 Corrected Total 17 4504.444444 R-Square Coeff Var Root MSE finish Mean 0.502121 18.61370 13.67073 73.44444 Source DF Type I SS Mean Square F Value Pr > F paint 1 355.555556 355.555556 1.90 0.1930 time 2 27.444444 13.722222 0.07 0.9296 paint∗time 2 1878.777778 939.388889 5.03 0.0260 Source DF Type III SS Mean Square F Value Pr > F paint 1 355.555556 355.555556 1.90 0.1930 time 2 27.444444 13.722222 0.07 0.9296 paint∗time 2 1878.777778 939.388889 5.03 0.0260 The code used to generate the above output was Data metal; Input paint time finish; Cards;
420 THE TWO-WAY CROSSED CLASSIFICATION 1 20 74 1 25 73 ……………… 2 25 88 2 30 85 proc glm; class paint time; model finish=paint time paint*time; run; 3. INTERPRETATION OF HYPOTHESES None of the hypotheses (97), (100), (106), (107), or (110) are particularly appealing so far as interpretability is concerned. They all involve the data themselves—not their magnitudes but the numbers of them, the values of the nij. For example, (100) is H : ������i + 1 ∑ nij (������ j + ������ij) equal for all i. (124) ni. j The corresponding hypothesis for the no-interaction case is H: ������i + 1 ∑ nij ������ j equal for all i (125) ni. j analogous to (48). These hypotheses involve the nij’s in two ways: 1. in terms of the weight in which, for example, the ������j’s enter the hypothesis; 2. whether some of the ������j’s enter the hypothesis at all. Thus, for example, in (124), if nip = 0, ������p will not occur in the expression containing ������i. As a result, the pattern of the data, specifically the pattern of which nij are zero and which are not, governs the form of the hypotheses tested by the F-statistics in Tables 7.2 and 7.7. In Table 7.2, F(������|������, ������) and F(������|������, ������) test, respectively, the differences between ������’s and the differences between ������’s. Otherwise, all hypotheses tested by the F’s in Tables 7.2 and 7.7 involve data through the values of the nij. For F(M) in both tables, the hypothesis is H: E(y) = 0. This is H: ∑a ∑b nij(������ + ������i + ������j + ������ij) = 0. N i=1 j=1 This hypothesis involves weighted means of the elements of the model as they occur in y. For F(������|������), the hypothesis involves the ������’s in the presence of a weighted mean of those ������’s and ������’s with which the ������’s occur in the data. Likewise, in F(������|������), the hypothesis involves the ������’s in the presence of the weighted means of the ������’s and ������’s. For F(������|������, ������) and F(������|������, ������) of Table 7.7, the hypotheses involve the nij’s in the
INTERPRETATION OF HYPOTHESES 421 somewhat complex manner shown in (106) and (107). In Table 7.7, the only case where the nij’s are not explicitly involved is the hypothesis (110) for F(������|������, ������, ������). However, here the effect of the nij’s is implicit, because whether or not they are zero or non-zero, determines which functions of the ������’s make up the hypothesis. This dependence of hypotheses on the structure of available data throws doubt on the validity of such hypotheses. Usually an experimenter wishes to test hypotheses that arise from the context of his/her work and not hypotheses that depend on the pattern of nij’s in his/her data. However, in general, the F-statistics of the analyses in Table 7.2, 7.3 and 7.7 do rely on the nij-values of the data. The only way that some of the hypotheses corresponding to the analysis of variance F-statistics might be valid would be if the nij’s, as they occur in the data, are in direct proportion to the occurrence of the elements if the model in the population. This is the case of proportionate subclass numbers. For this case, for example, (125) becomes ∑b H: ������i + pj������j equal for all i. j=1 This is equivalent to H: ������i equal for all i. A feature of the hypothesis (110) tested by F(������|������, ������, ������) warrants attention. It involves what hypotheses are actually being tested when testing for interaction. Consider the following measure of the extent to which the difference between the expected value of the ith and the i′th treatments, in terms of Table 7.6, when used on variety j′. The measure is given by ������ij,i′j′ = ������ij − ������i′j − ������ij′ + ������i′j′ = ������ij − ������i′j − ������ij′ + ������i′j′ = E(yij.) − E(yi′j.) − E(yij′.) + E(yi′j′.) = [E(yij.) − E(yi′j.)] − [E(yij′.) + E(yi′j′.)]. This is just the measure of interaction discussed in Section 3d(ii) of Chapter 4. Hence, we can say that F(������|������, ������, ������) test interactions. What does this really mean? It does not necessarily mean that we are testing the hypotheses that the interactions are zero. It would, if the hypotheses were ������ij,i′j′ = 0 for sets of various values of i, j, i′, and j′. However, this is not always so. For example, in (111), part of the hypothesis is ������11,22 + ������12,33 = 0 or equivalently, from (116), ������22,33 − ������21,13 = 0. As hypotheses, these two statements are not equivalent to hypotheses of ������′s being zero. This is an important fact! It means, for example, that in testing ������22,33 − ������21,13 = 0, each of ������22,33 and ������21,13 could be non-zero with the hypotheses still being true. In fact, ������22,33 and ������21,13 could both be very large but nevertheless equal, and as a result the hypothesis H: ������22,33 − ������21,13 = 0 would still be true. The upshot of this discussion is that for unbalanced data, F(������|������, ������, ������) is not testing that interactions are zero. Some
422 THE TWO-WAY CROSSED CLASSIFICATION TABLE 7.10 Presence or Absence of Data for Discussing Connectedness (× Indicates One or More Observations; − Indicates no Observations) Level of ������-Factor Level of ������-Factor 1 2 3 4 1 ××−− 2 ××−− 3 −−×× interactions can be non-zero, although equal in magnitude, of the same or opposite sign, with the hypothesis tested by F(������|������, ������, ������) still being true. 4. CONNECTEDNESS Suppose available data occur as indicated in Table 7.10. If each cell that contains data has only a single observation, the normal equations are as follows. ������◦ ������1◦ ������2◦ ������3◦ ������1◦ ������2◦ ������3◦ ������4◦ ⎡ 6 2 2 2 2 2 1 1 ⎤ ⎡ ������◦ ⎤ ⎡ y.. ⎤ ⎢ ⎥ ⎢ ⎥ ⎢ y1. ⎥ ⎢ 2 2 0 0 1 1 0 0 ⎥ ⎢ ������1◦ ⎥ ⎢ ⎥ ⎢ 2 0 2 0 1 1 0 0 ⎥ ⎢ ������2◦ ⎥ ⎢ y2. ⎥ ⎢ 0 0 2 0 0 1 1 ⎥ ⎢ ������3◦ ⎥ ⎢ y3. ⎥ ⎢2 1 1 0 2 0 0 0 ⎥ ⎢ ������1◦ ⎥ ⎢ y.1 ⎥ (126a) ⎥ ⎢ ⎥ = ⎢ ⎥ ⎢ 2 ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎢ ⎥ ⎢ ������2◦ ⎥ ⎢ ⎥ ⎢ 2 1 1 0 0 2 0 0 ⎥ ⎢ ������3◦ ⎥ ⎢ y.2 ⎥ 0 0 1 0 0 1 0 ⎥ ⎢ ������4◦ ⎥ ⎢1 0 0 1 0 0 0 1 ⎦⎥ ⎣⎢ ⎥⎦ ⎢ y.3 ⎥ ⎣⎢ 1 ⎢⎣ y.4 ⎥⎦ Subtracting the fourth equation from the first, changes (126a) to ������◦ ������1◦ ������2◦ ������3◦ ������1◦ ������2◦ ������3◦ ������4◦ ⎡ 4 2 2 0 2 2 0 0 ⎤ ⎡ ������◦ ⎤ ⎡ y1. + y2. ⎤ ⎢ ⎥ ⎢ ⎥ ⎢ y1. ⎥ ⎢ 2 2 0 0 1 1 0 0 ⎥ ⎢ ������1◦ ⎥ ⎢ ⎥ ⎢ 2 0 2 0 1 1 0 0 ⎥ ⎢ ������2◦ ⎥ ⎢ y2. ⎥ ⎢ 0 0 2 0 0 1 1 ⎥ ⎢ ������3◦ ⎥ ⎢ y3. ⎥ ⎢2 1 1 0 2 0 0 0 ⎥ ⎢ ������1◦ ⎥ ⎢ y.1 ⎥ (126b) ⎥ ⎢ ⎥ = ⎢ ⎥ . ⎢ 2 ⎥ ⎢ ⎥ ⎢ ⎢ ⎥ ⎢ ⎥ ⎢ ������2◦ ⎥ ⎢ ⎥ ⎢ 2 1 1 0 0 2 0 0 ⎥ ⎢ ������3◦ ⎥ ⎢ y.2 ⎥ 0 0 1 0 0 1 0 ⎥ ⎢ ������4◦ ⎥ ⎢ y.3 ⎥ ⎢1 0 0 1 0 0 0 1 ⎥⎦ ⎣⎢ ⎥⎦ ⎣⎢ y.4 ⎦⎥ ⎢⎣ 1
Search
Read the Text Version
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
- 69
- 70
- 71
- 72
- 73
- 74
- 75
- 76
- 77
- 78
- 79
- 80
- 81
- 82
- 83
- 84
- 85
- 86
- 87
- 88
- 89
- 90
- 91
- 92
- 93
- 94
- 95
- 96
- 97
- 98
- 99
- 100
- 101
- 102
- 103
- 104
- 105
- 106
- 107
- 108
- 109
- 110
- 111
- 112
- 113
- 114
- 115
- 116
- 117
- 118
- 119
- 120
- 121
- 122
- 123
- 124
- 125
- 126
- 127
- 128
- 129
- 130
- 131
- 132
- 133
- 134
- 135
- 136
- 137
- 138
- 139
- 140
- 141
- 142
- 143
- 144
- 145
- 146
- 147
- 148
- 149
- 150
- 151
- 152
- 153
- 154
- 155
- 156
- 157
- 158
- 159
- 160
- 161
- 162
- 163
- 164
- 165
- 166
- 167
- 168
- 169
- 170
- 171
- 172
- 173
- 174
- 175
- 176
- 177
- 178
- 179
- 180
- 181
- 182
- 183
- 184
- 185
- 186
- 187
- 188
- 189
- 190
- 191
- 192
- 193
- 194
- 195
- 196
- 197
- 198
- 199
- 200
- 201
- 202
- 203
- 204
- 205
- 206
- 207
- 208
- 209
- 210
- 211
- 212
- 213
- 214
- 215
- 216
- 217
- 218
- 219
- 220
- 221
- 222
- 223
- 224
- 225
- 226
- 227
- 228
- 229
- 230
- 231
- 232
- 233
- 234
- 235
- 236
- 237
- 238
- 239
- 240
- 241
- 242
- 243
- 244
- 245
- 246
- 247
- 248
- 249
- 250
- 251
- 252
- 253
- 254
- 255
- 256
- 257
- 258
- 259
- 260
- 261
- 262
- 263
- 264
- 265
- 266
- 267
- 268
- 269
- 270
- 271
- 272
- 273
- 274
- 275
- 276
- 277
- 278
- 279
- 280
- 281
- 282
- 283
- 284
- 285
- 286
- 287
- 288
- 289
- 290
- 291
- 292
- 293
- 294
- 295
- 296
- 297
- 298
- 299
- 300
- 301
- 302
- 303
- 304
- 305
- 306
- 307
- 308
- 309
- 310
- 311
- 312
- 313
- 314
- 315
- 316
- 317
- 318
- 319
- 320
- 321
- 322
- 323
- 324
- 325
- 326
- 327
- 328
- 329
- 330
- 331
- 332
- 333
- 334
- 335
- 336
- 337
- 338
- 339
- 340
- 341
- 342
- 343
- 344
- 345
- 346
- 347
- 348
- 349
- 350
- 351
- 352
- 353
- 354
- 355
- 356
- 357
- 358
- 359
- 360
- 361
- 362
- 363
- 364
- 365
- 366
- 367
- 368
- 369
- 370
- 371
- 372
- 373
- 374
- 375
- 376
- 377
- 378
- 379
- 380
- 381
- 382
- 383
- 384
- 385
- 386
- 387
- 388
- 389
- 390
- 391
- 392
- 393
- 394
- 395
- 396
- 397
- 398
- 399
- 400
- 401
- 402
- 403
- 404
- 405
- 406
- 407
- 408
- 409
- 410
- 411
- 412
- 413
- 414
- 415
- 416
- 417
- 418
- 419
- 420
- 421
- 422
- 423
- 424
- 425
- 426
- 427
- 428
- 429
- 430
- 431
- 432
- 433
- 434
- 435
- 436
- 437
- 438
- 439
- 440
- 441
- 442
- 443
- 444
- 445
- 446
- 447
- 448
- 449
- 450
- 451
- 452
- 453
- 454
- 455
- 456
- 457
- 458
- 459
- 460
- 461
- 462
- 463
- 464
- 465
- 466
- 467
- 468
- 469
- 470
- 471
- 472
- 473
- 474
- 475
- 476
- 477
- 478
- 479
- 480
- 481
- 482
- 483
- 484
- 485
- 486
- 487
- 488
- 489
- 490
- 491
- 492
- 493
- 494
- 495
- 496
- 497
- 498
- 499
- 500
- 501
- 502
- 503
- 504
- 505
- 506
- 507
- 508
- 509
- 510
- 511
- 512
- 513
- 514
- 515
- 516
- 517
- 518
- 519
- 520
- 521
- 522
- 523
- 524
- 525
- 526
- 527
- 528
- 529
- 530
- 531
- 532
- 533
- 534
- 535
- 536
- 537
- 538
- 539
- 540
- 541
- 542
- 543
- 544
- 545
- 546
- 547
- 548
- 549
- 550
- 551
- 552
- 553
- 554
- 555
- 556
- 557
- 558
- 559
- 560
- 561
- 562
- 563
- 564
- 565
- 566
- 567
- 568
- 569
- 570
- 571
- 572
- 573
- 574
- 575
- 576
- 577
- 578
- 579
- 580
- 581
- 582
- 583
- 584
- 585
- 586
- 587
- 588
- 589
- 590
- 591
- 592
- 593
- 594
- 595
- 596
- 597
- 598
- 599
- 600
- 601
- 602
- 603
- 604
- 605
- 606
- 607
- 608
- 609
- 610
- 611
- 612
- 613
- 614
- 615
- 616
- 617
- 618
- 619
- 620
- 621
- 622
- 623
- 624
- 625
- 626
- 627
- 628
- 629
- 630
- 631
- 632
- 633
- 634
- 635
- 636
- 637
- 638
- 639
- 640
- 641
- 642
- 643
- 644
- 645
- 646
- 647
- 648
- 649
- 650
- 651
- 652
- 653
- 654
- 655
- 656
- 657
- 658
- 659
- 660
- 661
- 662
- 663
- 664
- 665
- 666
- 667
- 668
- 669
- 670
- 671
- 672
- 673
- 674
- 675
- 676
- 677
- 678
- 679
- 680
- 681
- 682
- 683
- 684
- 685
- 1 - 50
- 51 - 100
- 101 - 150
- 151 - 200
- 201 - 250
- 251 - 300
- 301 - 350
- 351 - 400
- 401 - 450
- 451 - 500
- 501 - 550
- 551 - 600
- 601 - 650
- 651 - 685
Pages: