Design and Analysis of Experiments Dr. Tai-Yue Wang Department of Industrial and Information Management National Cheng Kung University Tainan, TAIWAN, ROC 1/33 Factorial Experiments Dr. Tai-Yue Wang Department of Industrial and Information Management National Cheng Kung University Tainan, TAIWAN, ROC 2/33 Outline Basic Definition and Principles The Advantages of Factorials The Two Factors Factorial Design The General Factorial Design Fitting Response Curve and Surfaces Blocking in Factorial Design 3 Basic Definitions and Principles Factorial Design—all of the possible combinations of factors’ level are investigated When factors are arranged in factorial design, they are said to be crossed Main effects – the effects of a factor is defined to be changed Interaction Effect – The effect that the difference in response between the levels of one factor is not the same at all levels of the 4 other factors. Basic Definitions and Principles Factorial Design without interaction 5 Basic Definitions and Principles Factorial Design with interaction 6 Basic Definitions and Principles Average response – the average value at one factor’s level Average response increase – the average value change for a factor from low level to high level No Interaction: A y A y A B yB yB AB 52 20 2 40 52 20 30 2 30 52 2 20 40 2 30 40 2 21 11 2 1 7 Basic Definitions and Principles With Interaction: A y A y A B yB yB AB 12 20 2 50 12 20 40 2 2 40 12 20 50 2 40 50 1 9 2 29 2 8 Basic Definitions and Principles Another way to look at interaction: When factors are quantitative y 0 1 x 1 2 x 2 1 2 x1 x 2 T he least squares fit is yˆ 35.5 10.5 x1 5.5 x 2 0.5 x1 x 2 35.5 10.5 x1 5.5 x 2 In the above fitted regression model, factors are coded in (-1, +1) for low and high levels This is a least square estimates 9 Basic Definitions and Principles Since the interaction is small, we can ignore it. Next figure shows the response surface plot 10 Basic Definitions and Principles The case with interaction 11 Advantages of Factorial design Efficiency Necessary if interaction effects are presented The effects of a factor can be estimated at several levels of the other factors 12 The Two-factor Factorial Design Two factors a levels of factor A, b levels of factor B n replicates In total, nab combinations or experiments 13 The Two-factor Factorial Design – An example Two factors, each with three levels and four replicates 32 factorial design 14 The Two-factor Factorial Design – An example Questions to be answered: What effects do material type and temperature have on the life the battery Is there a choice of material that would give uniformly long life regardless of temperature? 15 The Two-factor Factorial Design Statistical (effects) model: y ijk i j ( ) ij ijk i 1, 2, ..., a j 1, 2, ..., b k 1, 2, ..., n means model y ijk ij ijk i 1 ,2 ,...,a j 1, 2 ,..., b k 1, 2 ,..., n 16 The Two-factor Factorial Design Hypothesis Row effects: H 0 :1 2 a 0 H a : at least one i 0 Column effects: H 0 : 1 2 a 0 H a : at least one i 0 Interaction: H 0 : ( ) ij 0 H a : at least one ( ) ij 0 The Two-factor Factorial Design -- Statistical Analysis a b n i 1 j 1 k 1 a b ( y ijk y ... ) bn ( y i .. y ... ) an ( y . j . y ... ) 2 2 i 1 a n i 1 2 j 1 b j 1 a ( y ij . y i .. y . j . y ... ) 2 i 1 b n ( y ijk y ij . ) j 1 k 1 SS T SS A SS B SS A B SS E df breakdow n: abn 1 a 1 b 1 ( a 1)( b 1) ab ( n 1) 18 2 The Two-factor Factorial Design -- Statistical Analysis Mean square: A: SS A E ( MS A ) E a 1 a bn i 2 2 i 1 a 1 B: a an i 2 SS B E ( MS B ) E b 1 2 i 1 b 1 Interaction: a E ( MS SS AB ) E AB ( a 1)( b 1) n 2 i 1 b ( ) 2 ij j 1 ( a 1)( b 1) 19 The Two-factor Factorial Design -- Statistical Analysis Mean square: Error: SS E E ( MS A ) E ab ( n 1) 2 20 The Two-factor Factorial Design -- Statistical Analysis ANOVA table 21 The Two-factor Factorial Design -- Statistical Analysis Example 22 The Two-factor Factorial Design -- Statistical Analysis Example 23 The Two-factor Factorial Design -- Statistical Analysis Example 24 The Two-factor Factorial Design -- Statistical Analysis Example STATANOVA--GLM General Linear Model: Life versus Material, Temp Factor Type Levels Values Material fixed 3 1, 2, 3 Temp fixed 3 15, 70, 125 Analysis of Variance for Life, using Adjusted SS for Tests Source DF Material 2 Temp 2 Material*Temp 4 Error 27 Total 35 Seq SS 10683.7 39118.7 9613.8 18230.7 77647.0 Adj SS 10683.7 39118.7 9613.8 18230.7 Adj MS 5341.9 19559.4 2403.4 675.2 F P 7.91 0.002 28.97 0.000 3.56 0.019 S = 25.9849 R-Sq = 76.52% R-Sq(adj) = 69.56% Unusual Observations for Life Obs Life Fit SE Fit Residual St Resid 2 74.000 134.750 12.992 -60.750 -2.70 R 8 180.000 134.750 12.992 45.250 2.01 R R denotes an observation with a large standardized residual. 25 The Two-factor Factorial Design -- Statistical Analysis Example STATANOVA--GLM 26 The Two-factor Factorial Design -- Statistical Analysis Example STATANOVA--GLM 27 The Two-factor Factorial Design -- Statistical Analysis Estimating the model parameters y ijk i j ( ) ij ijk i 1, 2, ..., a j 1, 2, ..., b k 1, 2, ..., n y ... i y i .. y ... j y . j . y ... y ij . y i .. y . j . y ... ij 28 The Two-factor Factorial Design -- Statistical Analysis Choice of sample size Row effects 2 nbD 2 2a 2 Column effects 2 naD 2 2b 2 Interaction effects nD 2 2 2 [( a 1)( b 1) 1] 2 D:difference, :standard deviation 29 The Two-factor Factorial Design -- Statistical Analysis 30 The Two-factor Factorial Design -- Statistical Analysis Appendix Chart V For n=4, giving D=40 on temperature, v1=2, v2=27, Φ 2 =1.28n. β =0.06 n Φ2 Φ υ1 υ2 β 2 2.56 1.6 2 9 0.45 3 3.84 1.96 2 18 0.18 4 5.12 2.26 2 27 0.06 31 The Two-factor Factorial Design -- Statistical Analysis – example with no interaction Analysis of Variance for Life, using Adjusted SS for Tests Source Material Temp Error Total DF Seq SS Adj SS Adj MS F P 2 10684 10684 5342 5.95 0.007 2 39119 39119 19559 21.78 0.000 31 27845 27845 898 35 77647 S = 29.9702 R-Sq = 64.14% R-Sq(adj) = 59.51% 32 The Two-factor Factorial Design – One observation per cell Single replicate The effect model y ij i j ( ) ij ij i 1, 2 ,..., a j 1, 2 ,..., b 33 The Two-factor Factorial Design – One observation per cell ANOVA table 34 The Two-factor Factorial Design -- One observation per cell The error variance is not estimable unless interaction effect is zero Needs Tuckey’s method to test if the interaction exists. Check page 183 for details. 35 The General Factorial Design In general, there will be abc…n total observations if there are n replicates of the complete experiment. There are a levels for factor A, b levels of factor B, c levels of factor C,..so on. We must have at least two replicate (n≧2) to include all the possible interactions in model. 36 The General Factorial Design If all the factors are fixed, we may easily formulate and test hypotheses about the main effects and interaction effects using ANOVA. For example, the three factor analysis of variance model: y ijkl i j k ( ) ij ( ) ik ( ) jk ( ) ijk ijkl i 1, 2 ,..., a j 1, 2 ,..., b k 1, 2 ,..., c l 1, 2 ,..., n 37 The General Factorial Design ANOVA. 38 The General Factorial Design where a SS T b 2 n y i 1 SS A c 1 bcn SS AB SS BC j 1 k 1 l 1 a 2 i ... i 1 a 1 cn 1 an SS ABC 2 ijkl abcn 2 y .... y i 1 a 2 ij .. abcn y . jk . a b SS E SS T 1 abcn y j 1 b SS A SS B 2 . j .. y .... SS C abcn SS AC 1 bn a i 1 k 1 abn y k 1 2 .. k . y .... abcn 2 c 2 c 1 y 2 i.k . y .... abcn SS A SS C SS B SS C y .... abcn j 1 k 1 SS A SS B SS C SS AB SS BC SS AC 2 c y n i 1 acn 2 b 2 2 ijk . j 1 k 1 a 2 .... c y n i 1 y 2 j 1 k 1 1 1 2 y .... j 1 c SS B abcn b y y .... 2 ijk . y .... abcn 39 The General Factorial Design -example Three factors: pressure, percent of carbonation, and line speed. 40 The General Factorial Design -example ANOVA 41 Fitting Response Curve and Surfaces When factors are quantitative, one can fit a response curve (surface) to the levels of the factor so the experimenter can relate the response to the factors. These surface could be linear or quadratic. Linear regression model is generally used 42 Fitting Response Curve and Surfaces -- example Battery life data Factor temperature is quantitative 43 Fitting Response Curve and Surfaces -- example Example STATANOVA—GLM Response life Model temp, material temp*temp, material*temp, material*temp*temp Covariates temp 44 Fitting Response Curve and Surfaces -- example coding method: -1, 0, +1 General Linear Model: Life versus Material Factor Type Levels Values Material fixed 3 1, 2, 3 Analysis of Variance for Life, using Sequential SS for Tests Source DF Seq SS Adj SS Seq MS Temp 1 39042.7 1239.2 39042.7 Material 2 10683.7 1147.9 5341.9 Temp*Temp 1 76.1 76.1 76.1 Material*Temp 2 2315.1 7170.7 1157.5 Material*Temp*Temp 2 7298.7 7298.7 3649.3 Error 27 18230.8 18230.8 675.2 Total 35 77647.0 S = 25.9849 R-Sq = 76.52% R-Sq(adj) = 69.56% Term Coef SE Coef T P Constant 153.92 11.87 12.96 0.000 Temp -0.5906 0.4360 -1.35 0.187 Temp*Temp -0.001019 0.003037 -0.34 0.740 Temp*Material 1 -1.9108 0.6166 -3.10 0.005 2 0.4173 0.6166 0.68 0.504 Temp*Temp*Material 1 0.013871 0.004295 3.23 0.003 2 -0.004642 0.004295 -1.08 0.289 Two kinds of coding methods: 1. 1, 0, -1 2. 0, 1, -1 F 57.82 7.91 0.11 1.71 5.40 P 0.000 0.002 0.740 0.199 0.011 45 Fitting Response Curve and Surfaces -- example Final regression equation: Life 153 . 92 0 . 5906 * A 15 . 46 * B [1] 5 . 7 * B [ 2 ] 0 . 001019 * A 1 . 9108 * AB [1] 2 0 . 4173 * AB [ 2 ] 0 . 013871 * A B [1] 0 . 004642 * A B [ 2 ] 2 2 46 Fitting Response Curve and Surfaces – example –3 factorial design 2 Tool life Factors: cutting speed, total angle Data are coded 47 Fitting Response Curve and Surfaces – example –3 factorial design 2 48 Fitting Response Curve and Surfaces – example –3 factorial design 2 Regression Analysis: Life versus Speed, Angle, ... The regression equation is Life = - 1068 + 14.5 Speed + 136 Angle - 4.08 Angle*Angle - 0.0496 Speed*Speed - 1.86 Angle*Speed + 0.00640 Angle*Speed*Speed + 0.0560 Angle*Angle*Speed - 0.000192 Angle*Angle*Speed*Speed Predictor Constant Speed Angle Angle*Angle Speed*Speed Angle*Speed Angle*Speed*Speed Angle*Angle*Speed Angle*Angle*Speed*Speed Coef SE Coef -1068.0 702.2 14.480 9.503 136.30 72.61 -4.080 1.810 -0.04960 0.03164 -1.8640 0.9827 0.006400 0.003272 0.05600 0.02450 -0.00019200 0.00008158 - T -1.52 1.52 1.88 -2.25 -1.57 -1.90 1.96 2.29 2.35 P 0.163 0.162 0.093 0.051 0.151 0.090 0.082 0.048 0.043 S = 1.20185 R-Sq = 89.5% R-Sq(adj) = 80.2% 49 Fitting Response Curve and Surfaces – example –3 factorial design 2 Analysis of Variance Source Regression Residual Error Total DF 8 9 17 Source Speed Angle Angle*Angle Speed*Speed Angle*Speed Angle*Speed*Speed Angle*Angle*Speed Angle*Angle*Speed*Speed SS 111.000 13.000 124.000 MS 13.875 1.444 DF 1 1 1 1 1 1 1 1 Seq SS 21.333 8.333 16.000 4.000 8.000 42.667 2.667 8.000 F 9.61 P 0.001 50 Fitting Response Curve and Surfaces – example –3 factorial design 2 51 Blocking in a Factorial Design We may have a nuisance factor presented in a factorial design Original two factor factorial model: y ij i j ( ) ij ij i 1, 2 ,..., a j 1, 2 ,..., b Two factor factorial design with a block factor model: y ijk i j ( ) ij k ijk i 1, 2 ,... a j 1, 2 ,..., b k 1, 2 ,..., n 52 Blocking in a Factorial Design 53 Blocking in a Factorial Design - example Response: intensity level Factors: Ground cutter and filter type Block factor: Operator 54 Blocking in a Factorial Design - example General Linear Model: Intensity versus Clutter, Filter, Blocks Factor Type Levels Values Clutter fixed 3 High, Low, Medium Filter fixed 2 1, 2 Blocks fixed 4 1, 2, 3, 4 Analysis of Variance for Intensity, using Sequential SS for Tests Source Clutter Filter Clutter*Filter Blocks Error Total DF 2 1 2 3 15 23 Seq SS 335.58 1066.67 77.08 402.17 166.33 2047.83 Adj SS 335.58 1066.67 77.08 402.17 166.33 Seq MS 167.79 1066.67 38.54 134.06 11.09 F 15.13 96.19 3.48 12.09 P 0.000 0.000 0.058 0.000 S = 3.33000 R-Sq = 91.88% R-Sq(adj) = 87.55% 55 Blocking in a Factorial Design - example General Linear Model: Intensity versus Clutter, Filter, Blocks Term Coef Constant 94.9167 Clutter High 4.3333 Low -4.7917 Filter 1 6.6667 Clutter*Filter High 1 2.0833 Low 1 -2.2917 Blocks 1 0.417 2 1.583 3 4.583 SE Coef 0.6797 T 139.64 P 0.000 0.9613 0.9613 4.51 -4.98 0.000 0.000 0.6797 9.81 0.000 0.9613 0.9613 2.17 -2.38 0.047 0.031 1.177 1.177 1.177 0.35 1.34 3.89 0.728 0.199 0.001 56