IE 361 Module 21 Design and Analysis of Experiments: Part 2 (Two-Way Studies and Analyses) Reading: Section 6.2, Statistical Quality Assurance Methods for Engineers Prof. Steve Vardeman and Prof. Max Morris Iowa State University Vardeman and Morris (Iowa State University) IE 361 Module 21 1 / 22 Two-Way Factorial Studies In this module we start to consider what can be learned about the action of several factors on a response variable, based on r samples collected under di¤erent sets of process conditions, i.e. under di¤erent combinations of levels of those factors. We begin with the simplest such situation, where there are two factors of interest, some Factor A has I levels, another Factor B has J levels, and samples of a response y are obtained under each combination of a level i of Factor A and a level j of Factor B. This results in what can be thought of as a two-way table of data yijk = the kth response at level i of Factor A and level j of Factor B illustrated in the table on panel 3. There, the sample size in the ith row and jth column is denoted as nij . Vardeman and Morris (Iowa State University) IE 361 Module 21 2 / 22 Two-Way Factorial Data 1 2 Factor A I 1 y111 , y112 , . . . , y11n11 y211 , y212 , . . . , y21n21 .. . Factor B 2 y121 , y122 , . . . , y12n12 y221 , y222 , . . . , y22n22 J y1J 1 , y1J 2 , . . . , y1Jn1J .. . .. yI 11 , yI 12 , . . . , yI 1nI 1 . yIJ 1 , yIJ 2 , . . . , yIJnIJ This layout is complete in the sense that there are data in every cell. The terminology factorial used in the name of this section means that the combinations of levels of the two factors are considered, and the jargon "I J factorial" (naming the number of levels of each factor) is common. Vardeman and Morris (Iowa State University) IE 361 Module 21 3 / 22 Two-Way Factorial Data Example 21-1 (Example 20-1 Revisited) The glass-phosphor study of Module 20 has 2 3 factorial structure. We repeat the summary statistics, this time emphasizing the the natural two-way structure through the use of double subscripts indicating glass (row) and phosphor (column) in the table. The table adds row and column averages of the cell means ȳij (the ȳi . ’s and ȳ.j ’s respectively). These prove useful for de…ning important summaries of two-way factorials in the balance of this section. Phosphor 1 2 3 ȳ11 = 285 ȳ12 = 301.67 ȳ13 = 281.67 1 ȳ1. = 289.44 2 = 25 2 = 58.33 2 = 108.33 s11 s12 s13 Glass ȳ21 = 235 ȳ22 = 245 ȳ23 = 225 2 ȳ2. = 235 2 2 2 = 25 s21 = 25 s22 = 175 s23 ȳ.1 = 260 Vardeman and Morris (Iowa State University) ȳ.2 = 273.33 IE 361 Module 21 ȳ.3 = 253.33 ȳ.. = 262.22 4 / 22 Two-Way Factorial Data Example 21-1 continued A useful plot in two-way studies is that of sample means versus level of one factor, connecting plotted points for a given level of the second factor with line segments. Such a plot is commonly called an interaction plot. The …gure below is such a plot (with the raw data values also shown). Figure: Interaction Plot for the Glass-Phosphor Study (With Raw Data Plotted) Vardeman and Morris (Iowa State University) IE 361 Module 21 5 / 22 Two-Way Factorial Data Example 21-1 continued A better interaction plot adds "error bars." In Module 20 we saw that 95% con…dence limits for the tube type means are (using the double subscript notation) ȳij 10.44. Below is the interaction plot for the glass-phosphor study enhanced with 10.44 error bars indicating the precision with which the means are known. Figure: Interaction Plot for the Glass-Phosphor Study Enhanced With Error Bars From 95% Con…dence Limits Vardeman and Morris (Iowa State University) IE 361 Module 21 6 / 22 Two-Way Factorial Data Example 21-1 continued The qualitative story told by the interaction plots is that: Glass 1 current requirements are clearly higher than those for Glass 2, Phosphor 2 current requirements seem to be somewhat higher than those for Phosphors 1 and 3, the "Glass" di¤erences in current requirements seem to be larger than "Phosphor" di¤erences, and the pattern in current requirement means for Glass 1 is similar to the pattern in current requirement means for Glass 2 Vardeman and Morris (Iowa State University) IE 361 Module 21 7 / 22 Two-Way Factorial E¤ects Main E¤ects A way to quantify insights like those made in the Glass-Phosphor study is to de…ne so-called (…tted) factorial e¤ects. To begin, so-called main e¤ects of the factors are de…ned as appropriate row or column average ȳ ’s minus the grand average ȳ . That is ai = ȳi . ȳ.. = (the row i average ȳ ) (the grand average ȳ ) = the (…tted) main e¤ect of the ith level of Factor A bj = ȳ.j ȳ.. = (the column j average ȳ ) (the grand average ȳ ) = the (…tted) main e¤ect of the jth level of Factor B and Vardeman and Morris (Iowa State University) IE 361 Module 21 8 / 22 Fitted Main E¤ects Example 21-1 continued Using the row and column averages of cell sample means, we have a1 = 289.44 262.22 = 27.22 and a2 = 235 262.22 = 27.22 and b1 = 260 262.22 and b3 = 253.33 2.22 and b2 = 273.33 262.22 = 262.22 = 11.11 8.88 The fact that A main e¤ects are larger in absolute value than B main e¤ects is consistent with the fact that the gap between the top and bottom pro…les on panel 6 is more pronounced than the up-then-down pattern seen in them. The fact that a1 > 0 indicates that current requirements for Glass 1 are larger than for Glass 2 (that has a2 < 0). (Similarly, the fact that b2 > 0 indicates that current requirements for Phosphor 2 are larger than for Phosphors 1 and 3 that have b1 < 0 and b3 < 0.) Vardeman and Morris (Iowa State University) IE 361 Module 21 9 / 22 Fitted Main E¤ects It is no accident that in the glass-phosphor example the (2) Factor A main e¤ects add to 0 and the (3) Factor B main e¤ects also add to 0. This is an algebraic consequence of the de…nitions of these quantities and can be used as a check on one’s calculations. In some cases the …tted main e¤ects in a two-way factorial essentially capture the entire story told in the data set, in the sense that for each combination of a level i of Factor A and a level j of Factor B ȳij ȳ.. + ai + bj (the sample means can essentially be reconstructed from an overall mean and Factor A and Factor B main e¤ects). The glass-phosphor example is such a case. Vardeman and Morris (Iowa State University) IE 361 Module 21 10 / 22 Fitted Main E¤ects Example 21-1 continued The tables below can be used to compare the means ȳij and the quantities ȳ.. + ai + bj . Table of ȳij ’s: Glass 1 2 ȳ11 ȳ21 1 = 285 = 235 Phosphor 2 ȳ12 = 301.67 ȳ22 = 245 Table of ȳ.. + ai + bj ’s: Phosphor 1 2 Glass 1 287.22 300.55 2 232.78 246.11 3 ȳ13 = 281.67 ȳ23 = 225 3 280.56 226.11 For example, ȳ.. + a1 + b1 = 262.22 + 27.22 + ( 2.22) = 287.22 Vardeman and Morris (Iowa State University) IE 361 Module 21 11 / 22 Two-Way Factorial E¤ects Interactions The fact that the two tables on panel 11 are very much alike is a re‡ection of the fact that the (interaction) plot of means on panel 6 shows fairly parallel traces. A way to measure lack of parallelism on a plot of means is to compute so called …tted interactions abij = ȳij (ȳ.. + ai + bj ) = the di¤erence between what is observed at level i of Factor A and level j of Factor B and what can be accounted for in terms of an overall mean and the Factor A level i main e¤ect and the Factor B level j main e¤ect Vardeman and Morris (Iowa State University) IE 361 Module 21 12 / 22 Fitted Interactions Example 21-1 continued The cell-by-cell di¤erences of the entries in the two previous table are the …tted interactions abij given in the table below. Table of abij ’s 1 1 2.22 Phosphor 2 1.11 3 1.11 Glass 2 2.22 1.11 1.11 For example, ab11 = 285 Vardeman and Morris (Iowa State University) 287.22 = IE 361 Module 21 2.22 13 / 22 Fitted Interactions Example 21-1 continued The …tted interactions are smaller in absolute value than the …tted main e¤ects of either Factor A or Factor B. Interactions measure lack of parallelism on an interaction plot, and their small size in the glass-phosphor example indicate that one can more or less think of the factors "Glass" and "Phosphor" as acting "separately" on the current requirement variable. It is no accident that in the glass-phosphor example the (2 3 = 6) …tted interactions in the table on panel 13 add to 0 across any row or down any column of the two way table (across any level of either factor). This is again an algebraic consequence of the de…nitions of these quantities. Vardeman and Morris (Iowa State University) IE 361 Module 21 14 / 22 Con…dence Intervals for Two-Way Factorial E¤ects Lhat’s (and L’s) Before basing serious real world decisions on the perceived sizes of e¤ects of experimental factors on a response, it is important to have some comfort that one is seeing more than is explainable as "just experimental variation." One must be reasonably certain that the e¤ects one sees are more than just background noise. In the present two-way factorial context, that means that beyond computing …tted main e¤ects and interactions ai , bj , and abij one really needs some way of judging whether they are clearly "more than just noise." Attaching margins of error to them is a way of doing this, and the key to seeing how to …nd relevant margins of error is to recognize that …tted e¤ects are linear combinations of ȳ ’s, L̂’s in the notation of Module 20. Vardeman and Morris (Iowa State University) IE 361 Module 21 15 / 22 Con…dence Intervals for Two-Way Factorial E¤ects Lhat’s (and L’s) Take, for example, the quantity b2 in any 2 glass-phosphor study). This is 3 study (like the b2 = ȳ.2 ȳ.. 1 = (ȳ12 + ȳ22 ) 2 1 (ȳ11 + ȳ12 + ȳ13 + ȳ21 + ȳ22 + ȳ23 ) 6 1 1 1 1 1 1 = ȳ11 + ȳ12 ȳ13 ȳ21 + ȳ22 ȳ23 6 3 6 6 3 6 which is indeed of the form L̂ = c1 ȳ1 + c2 ȳ2 + + cr ȳr . The fact that …tted factorial e¤ects are L̂’s means that there are corresponding linear combinations of population/theoretical means µ (there are corresponding L’s) and the methods of Module 20 can be used to make con…dence limits based on the …tted e¤ects ... …nd margins of error to attach to the …tted e¤ects. Vardeman and Morris (Iowa State University) IE 361 Module 21 16 / 22 Con…dence Intervals for Two-Way Factorial E¤ects Applying the General Formula We may use \ E¤ect tspooled s 2 c11 + n11 + cIJ2 nIJ \ if we can see what to make con…dence limits based on …tted e¤ects E¤ect are the appropriate sums to put under the square root in the formula. And there are some fairly simple "hand calculation" formulas for what goes under the root in the case of two-way studies, particularly for cases where all nij = m (there is a common …xed sample size). (Standard jargon is that this is the balanced data case.) Table 6.5 of SQAME gives the balanced data formulas and is essentially reproduced on panel 18. (Table 6.6 of SQAME gives general formulas not requiring balanced data.) Vardeman and Morris (Iowa State University) IE 361 Module 21 17 / 22 Con…dence Intervals for Two-Way Factorial E¤ects Applying the General Formula ... What’s Under the Root Here’s Table 6.5 of SQAME. + + L̂ αβij abij (I 1 )(J 1 ) mIJ αi ai I 1 mIJ αi αi 0 ai ai 0 βj 0 bj cIJ2 n IJ 2 mJ J 1 mIJ bj βj βj 2 c11 n 11 L bj 0 Vardeman and Morris (Iowa State University) 2 mI IE 361 Module 21 18 / 22 Con…dence Intervals for Two-Way Factorial E¤ects Example 21-1 continued (Interactions) In the glass-phosphor study, I = 2, J = 3, and the common sample size is m = 3. So a margin of error to associate with any of the …tted interactions abij based on 95% two-sided con…dence limits is s r 1 (2 1) (3 1) tspooled = 2.179 (8.3) 3 (2) (3) 9 = 6.0 µA and reviewing the table giving the …tted interactions, we see that all I J = 6 of them are smaller than this in absolute value. The lack of parallelism seen on the interaction plots is not only small in comparison to the size of …tted main e¤ects, it is in fact "down in the noise range." This is quantitative con…rmation of the story in this regard told on panel 6. Vardeman and Morris (Iowa State University) IE 361 Module 21 19 / 22 Con…dence Intervals for Two-Way Factorial E¤ects Example 21-1 continued (A Main E¤ects) A margin of error to be applied to the di¤erence in …tted Factor A main e¤ects (α2 α1 = (ȳ2. ȳ.. ) (ȳ1. ȳ.. ) = ȳ2. ȳ1. = 54.44) is then r r 2 2 = 2.179 (8.3) tspooled 3 3 9 = 8.6 µA Since j 54.44j > 8.6 there is then a di¤erence between the glass 1 and glass 2 main e¤ects that is clearly more than experimental noise, again providing quantitative con…rmation of what seems "obvious" on panel 6. Vardeman and Morris (Iowa State University) IE 361 Module 21 20 / 22 Con…dence Intervals for Two-Way Factorial E¤ects Example 21-1 continued (B Main E¤ects) And …nally, a margin of error to be applied to any di¤erence in …tted Factor B main e¤ects (βj βj 0 = (ȳ.j ȳ.. ) (ȳ.j 0 ȳ.. ) = ȳ.j ȳj 0 ) is then r r 2 1 = 2.179 (8.3) tspooled 3 2 3 = 10.5 µA Looking again at the …tted phosphor main e¤ects and their di¤erences, the di¤erence between phosphor 2 main e¤ects and those of either of the other two phosphors is clearly more than experimental noise, but the observed di¤erence between phosphor 1 and 3 main e¤ects is "in the noise range." Once again, this is quantitative con…rmation of what in retrospect seems "obvious" on panel 6. Vardeman and Morris (Iowa State University) IE 361 Module 21 21 / 22 Perspective The virtue of inventing numerical measures like the main e¤ects and interactions we have met here and learning how to attach margins of error to them, over what for example can be seen on a plot like panel 6, is that the numerical ideas generalize to cases with many factors, where there is no obvious way to make pictures to allow us to "see" what is going on. In the next module we consider 3 (and higher) way factorials, placing primary attention on the case where every factor has just 2 levels, and make heavy use of such …tted factorial e¤ects. Vardeman and Morris (Iowa State University) IE 361 Module 21 22 / 22