Chapter 4 Experiments with Blocking Factors 許湘伶 Design and Analysis of Experiments (Douglas C. Montgomery) hsuhl (NUK) DAE Chap. 4 1 / 54
The Randomized Complete Block Design (RCBD; 隨機化完全集區設計 ) 1 Variability arising from a nuisance factor can affect the results. 2 A nuisance factor: has an effect on the response but we are not interested in that effect. unknown and uncontrolled: Randomization known and uncontrollable: compensate( 補償 ) in ANCOVA; (Chap. 14) known and controllable: design technique called blocking; 3 blocking: systematically eliminate its effect on the statistical comparisons among treatments hsuhl (NUK) DAE Chap. 4 2 / 54
The Randomized Complete Block Design the hardness testing experiment determine whether or not four different tips produce different readings on a hardness testing machine one factor: tip type completely randomized single-factor design the metal coupons differ slightly in their hardness to remove the variability between coupons from the experimental error hsuhl (NUK) DAE Chap. 4 3 / 54
The Randomized Complete Block Design (cont.) Complete: each block contains all the treatments improves the accuracy of the comparisons among tips by eliminating the variability among the coupons Block factor: 1 batches of raw material 2 people 3 time hsuhl (NUK) DAE Chap. 4 4 / 54
The Randomized Complete Block Design (cont.) a treatment; b blocks one observation per treatment in each block only randomization of treatments is within the block hsuhl (NUK) DAE Chap. 4 5 / 54
The Randomized Complete Block Design (cont.) Statitical model for RCBD: { i = 1, 2,..., a y ij = µ + τ i + β j + ɛ ij j = 1, 2,..., b a b ( τ i = 0 and β j = 0) i=1 j=1 = µ ij + ɛ ij (µ ij = µ + τ i + β j mean model) β j : the effect of the jth block ɛ ij NID(0, σ 2 ) hsuhl (NUK) DAE Chap. 4 6 / 54
Estimating parameters Two constraints: a ˆτ i = 0 i=1 b ˆβ j = 0 j=1 Estimates: ˆµ = ȳ ˆτ i = ȳ i ȳ ˆβ j = ȳ j ȳ i = 1,..., a j = 1,..., b ŷ ij = ˆµ + ˆτ i + ˆβ j = ȳ i + ȳ j ȳ hsuhl (NUK) DAE Chap. 4 7 / 54
Testing hypothesis for RCBD Testing the equality of the treatment means: H 0 : µ 1 = µ 2 = = µ a H 1 : at least one µ i µ j H 0 : τ 1 = τ 2 = = τ a = 0 H 1 : τ i 0at least one i the ith treatment mean: µ i = 1 b b (µ + τ i + β j ) = µ + τ i j=1 hsuhl (NUK) DAE Chap. 4 8 / 54
Testing hypothesis for RCBD (cont.) partitioning of total variability: d.f.: ab 1 = (a 1) + (b 1) + (a 1)(b 1) hsuhl (NUK) DAE Chap. 4 9 / 54
Testing hypothesis for RCBD (cont.) SS T = SS Treatments = 1 b SS Blocks = 1 a a i=1 a i=1 b j=1 b j=1 y ij y2 N y 2 i y2 N y 2 j y2 N SS E =SS T SS Treatments SS Blocks hsuhl (NUK) DAE Chap. 4 10 / 54
Testing hypothesis for RCBD (cont.) SS Treatments /σ 2, SS Blocks /σ 2, SS E /σ 2 : are independently χ 2 r.v. Expected of the mean squares: E(MS Treatments ) =σ 2 + b a i=1 τ i 2 a 1 E(MS Blocks ) =σ 2 + a a j=1 β2 j b 1 E(MS E ) =σ 2 Test statistic for testing the equality of treatment means: F 0 = MS Treatments MS E H 0 Fa 1,(a 1)(b 1) hsuhl (NUK) DAE Chap. 4 11 / 54
Testing hypothesis for RCBD (cont.) randomization has been applied only to treatments within blocks: restriction on randomization Comparing block means? F 0 = MS Blocks MS E? for H 0 : β j = 0 If ɛ ij NID(0, σ 2 ) F 0 = MS Blocks MS E can be used to compare block means. On the other hand, F ratio for comparing block means is a test for the equality of the block means + the randomization restriction. (Anderson and McLean (1974)) Because the normality assumption is often questionable, to exclude F 0 = MS Blocks MS E from ANOVA table hsuhl (NUK) DAE Chap. 4 12 / 54
Testing hypothesis for RCBD (cont.) hsuhl (NUK) DAE Chap. 4 13 / 54
Testing hypothesis for RCBD (cont.) RCBD for the Vascular Graft Experiment( 人工血管 ) Factor: extrusion pressure(psi; 擠壓力 ) Block: batch of resin( 樹脂 ) hsuhl (NUK) DAE Chap. 4 14 / 54
Testing hypothesis for RCBD (cont.) hsuhl (NUK) DAE Chap. 4 15 / 54
Testing hypothesis for RCBD (cont.) hsuhl (NUK) DAE Chap. 4 16 / 54
Testing hypothesis for RCBD (cont.) > graft<-scan("graft.txt") > PSI.labels <- c(8500,8700,8900,9100) > vasc.graft <- data.frame(psi=gl(4,6,24),block=gl(6,1,24),graft) > graft.aov <- aov(graft block+psi,vasc.graft) > summary(graft.aov) Df Sum Sq Mean Sq F value Pr(>F) block 5 192.2 38.45 5.249 0.00553 ** PSI 3 178.2 59.39 8.107 0.00192 ** Residuals 15 109.9 7.33 --- Signif. codes: 0 *** 0.001 ** 0.01 * 0.05. 0.1 1 hsuhl (NUK) DAE Chap. 4 17 / 54
Testing hypothesis for RCBD (cont.) Residuals: e ij = y ij ŷ ij = y ij (ȳ i + ȳ j ȳ ) hsuhl (NUK) DAE Chap. 4 18 / 54
Testing hypothesis for RCBD (cont.) hsuhl (NUK) DAE Chap. 4 19 / 54
Testing hypothesis for RCBD (cont.) Mean yields for the four extrusion pressures relative to a scaled t distribution with a scale factor MS E /b = 1.10 The highest pressure (9100 psi) results in a mean yield that is much lower than all other means. hsuhl (NUK) DAE Chap. 4 20 / 54
Testing hypothesis for RCBD (cont.) > library(agricolae) > graft.lsd<-lsd.test(graft.aov,"psi",group=f) # without grouping > graft.lsd $statistics Mean CV MSerror 89.79583 3.014185 7.32575 $parameters Df ntr t.value 15 4 2.13145 $means graft std r LCL UCL Min Max 8500 92.81667 4.577081 6 90.46148 95.17185 87.4 98.2 8700 91.68333 3.304189 6 89.32815 94.03852 87.0 95.8 8900 88.91667 2.966760 6 86.56148 91.27185 85.5 93.4 9100 85.76667 4.445072 6 83.41148 88.12185 78.9 90.7 $comparison hsuhl (NUK) DAE Chap. 4 21 / 54
Testing hypothesis for RCBD (cont.) Difference pvalue sig. LCL UCL 8500-8700 1.133333 0.4794566570-2.1974047 4.464071 8500-8900 3.900000 0.0247127253 * 0.5692620 7.230738 8500-9100 7.050000 0.0004136854 *** 3.7192620 10.380738 8700-8900 2.766667 0.0969618155. -0.5640714 6.097405 8700-9100 5.916667 0.0017928594 ** 2.5859286 9.247405 8900-9100 3.150000 0.0620999888. -0.1807380 6.480738 $groups NULL hsuhl (NUK) DAE Chap. 4 22 / 54
Testing hypothesis for RCBD (cont.) Additivity of the Randomized Block Model y ij = µ + τ i + β j + ɛ ij If interaction is present, it can seriously affect and possibly invalidate the ANOVA. Interaction: inflates MS E ; affect the comparison of treatment means factorial designs hsuhl (NUK) DAE Chap. 4 23 / 54
Random Treatments and Blocks Assume β j NID(0, σβ 2 ), j = 1, 2,..., b, the treatments are fixed E(y ij ) = µ + τ i, V(y ij ) = σ 2 β + σ 2 i = 1, 2,..., a Cov(y ij, y i j ) = 0, j j Cov(y ij, y i j) = σ 2 β, i i Covariance between any two observations in different block is zero Covariance between any two observations from the same block is σ 2 β hsuhl (NUK) DAE Chap. 4 24 / 54
Random Treatments and Blocks (cont.) Expected mean squares: E(MS Treatments ) = σ 2 + b a i=1 τ i 2 a 1 E(MS Blocks ) = σ 2 + aσβ 2 E(MS E ) = σ 2 The null hypothesis of no treatment effects: τ i = 0 F 0 = MS Treatmens MS E hsuhl (NUK) DAE Chap. 4 25 / 54
Random Treatments and Blocks (cont.) Estimator: ˆσ 2 β = MS Blocks MS E a Interaction between treatments and blocks: y ij = µ + τ i + β j + (τβ) ij + ɛ ij { i = 1, 2,..., a j = 1, 2,..., b στβ 2 : variance component for the block treatment interaction E(MS Treatments ) = σ 2 + στβ 2 + b a i=1 τ i 2 a 1 E(MS Blocks ) = σ 2 + aσβ 2 E(MS E ) = σ 2 + σ 2 τβ hsuhl (NUK) DAE Chap. 4 26 / 54
Estimating missing values Sometimes, an observation in one of the blocks is missing Suppose y ij for treatment i in block j is missing y ij, y i, y j: represent the one missing observation in the grand total, the treatment and the block, respectively x: the missing observation to be estimated; Choosing x s.t. min SS E SSE = x 2 1 b (y i + x) 2 1 a (y j + x) 2 + 1 ab (y + x) 2 + R min x SSE x = ay i + by j y (a 1)(b 1) (1) hsuhl (NUK) DAE Chap. 4 27 / 54
Estimating missing values (cont.) If several observations are missing, they may be estimated by writing SS E as a function of the missing values, differentiating with respect to each missing value, equating the results to zero, and solving the resulting equations. Using (1), iteratively to estimate the missing values; continued until convergence is obtained. hsuhl (NUK) DAE Chap. 4 28 / 54
Latin Square Design several other types of designs that utilize the blocking principle Example: five different formulations of a rocket propellant( 火箭推進燃料 ) uses in aircrew escape systems( 彈射救生系統 ) on the observed burning rate a batch of raw material: large enough for five formulations to be tested operators: differences in the skills and experience two nuisance factors to be average out testing each formulation exactly once in each batch of raw material and for each formulation to prepared exactly once by each of five operators hsuhl (NUK) DAE Chap. 4 29 / 54
Latin Square Design (cont.) Latin square design used to eliminate two nuisance sources of variability rows, columns: two restrictions on randomization hsuhl (NUK) DAE Chap. 4 30 / 54
Latin Square Design (cont.) Each of the p 2 cells contains one of the p letters that corresponds to the treatments, and each letter occurs once and only once in each row and column. 4 4 A B D C B C A D C D B A D A C B 5 5 A D B E C D A C B E C B E D A B E A C D E C D A B hsuhl (NUK) DAE Chap. 4 31 / 54
Latin Square Design (cont.) statistical model for a Latin square: y ijk = µ + α i + τ j + β k + ɛ ijk (row) (treatment) (column) partitioning SS T : i = 1, 2,..., p j = 1, 2,..., p k = 1, 2,..., p SS T = SS Rows + SS Columns + SS Treatments + SS E (p 2 1) (p 1) (p 1) (p 1) ((p 2)(p 1)) no interaction between factors The statistical analysis (ANOVA) is much like the analysis for the RCBD. hsuhl (NUK) DAE Chap. 4 32 / 54
Latin Square Design (cont.) Testing for no differences in treatment means: Figure : Example 4.3 hsuhl (NUK) DAE Chap. 4 33 / 54
Latin Square Design (cont.) Figure : Example 4.3 hsuhl (NUK) DAE Chap. 4 34 / 54
Latin Square Design (cont.) hsuhl (NUK) DAE Chap. 4 35 / 54
Latin Square Design (cont.) > rocket.lm <- lm(y factor(op)+factor(batch)+treat,rocket) > anova(rocket.lm) Analysis of Variance Table Response: y Df Sum Sq Mean Sq F value Pr(>F) factor(op) 4 150 37.500 3.5156 0.040373 * factor(batch) 4 68 17.000 1.5937 0.239059 treat 4 330 82.500 7.7344 0.002537 ** Residuals 12 128 10.667 --- Signif. codes: 0 *** 0.001 ** 0.01 * 0.05. 0.1 1 hsuhl (NUK) DAE Chap. 4 36 / 54
Latin Square Design (cont.) Residuals: e ijk = y ijk ŷ ijk = y ijk ȳ i ȳ j ȳ k + 2ȳ hsuhl (NUK) DAE Chap. 4 37 / 54
Latin Square Design (cont.) Standard Latin Square: obtained by writing the first row in alphabetical order and then writing each successive row as the row of letters just above shifted one place to the left. hsuhl (NUK) DAE Chap. 4 38 / 54
Latin Square Design (cont.) Replication-Case 1: the same batch and operators in each replicate hsuhl (NUK) DAE Chap. 4 39 / 54
Latin Square Design (cont.) Replication-Case 2: the same batch but different operators in each replicate hsuhl (NUK) DAE Chap. 4 40 / 54
Latin Square Design (cont.) Replication-Case 3: different batched and different operators in each replicate hsuhl (NUK) DAE Chap. 4 41 / 54
Crossover Designs the time period is a factor in the experiment two replacement fluids (A,B) on dehyfration( 脫水 ) on 20 subjects 1 First period: half of the subjects-a; the other half of the subjects-b 2 measure response at the end of the period 3 after the effect of the fluids is eliminated: change the assignment half of the subjects-a B; the other half of the subjects-b A hsuhl (NUK) DAE Chap. 4 42 / 54
Graeco-Latin Square Design hsuhl (NUK) DAE Chap. 4 43 / 54
Graeco-Latin Square Design (cont.) block in three direction each at p levels in only p 2 runs statistical model: y ijkl = µ + θ i + τ j + w k + Φ l + ɛ ijkl, i, j, k, l = 1,..., p hsuhl (NUK) DAE Chap. 4 44 / 54
Balanced Incomplete Block Designs (BIBD) BIBD: 平衡不完全集區設計 any two treatments appear together an equal number of times all treatment comparisons are equally important the treatment combinations used in each block should be selected in a balanced manner hsuhl (NUK) DAE Chap. 4 45 / 54
Balanced Incomplete Block Designs (BIBD) (cont.) a treatment; each block can hold exactly k (k < a) treatments ( ) a A BIBD: constructed by blocks; assigning a different k combination of treatmens to each block hsuhl (NUK) DAE Chap. 4 46 / 54
Balanced Incomplete Block Designs (BIBD) (cont.) Assume a treatment; b blocks each block contains k treatments; each treatment occurs r times in the design N = ar = bk each pair of treaments appears in the same block: λ = r(k 1) a 1 hsuhl (NUK) DAE Chap. 4 47 / 54
Balanced Incomplete Block Designs (BIBD) (cont.) statistical model for BIBD: Patitioned total variability: y ij = µ + τ i + β j + ɛ ij SS T = SS Treatments(adjusted) + SS Blocks + SS E hsuhl (NUK) DAE Chap. 4 48 / 54
Balanced Incomplete Block Designs (BIBD) (cont.) The adjusted treatment totals will always sum to zero. SS Treatments(adjusted) = k a i=1 Q2 i λa Q = y i 1 b n ij y j, i = 1,..., a k j=1 { 1, if treatment i appears in block j n ij = 0, otherwise SS Blocks = 1 b y 2 j y2 k N j=1 hsuhl (NUK) DAE Chap. 4 49 / 54
Balanced Incomplete Block Designs (BIBD) (cont.) hsuhl (NUK) DAE Chap. 4 50 / 54
Balanced Incomplete Block Designs (BIBD) (cont.) ### Ex 4.5 > catalyst.y <- matrix(c(73,na,73,75,74,75,75,na,na,67,68,72,71,72,na,75) > catalyst <- data.frame(rep=as.vector(catalyst.y), + treat=factor(rep(1:4,4)), + block=factor(rep(1:4,each=4))) > summary(aov(rep treat+block+error(block),catalyst)) Error: block Df Sum Sq Mean Sq treat 3 55 18.33 Error: Within Df Sum Sq Mean Sq F value Pr(>F) treat 3 22.75 7.583 11.67 0.0107 * Residuals 5 3.25 0.650 --- Signif. codes: 0 *** 0.001 ** 0.01 * 0.05. 0.1 1 > hsuhl (NUK) DAE Chap. 4 51 / 54
Balanced Incomplete Block Designs (BIBD) (cont.) > summary(aov(rep treat+block,catalyst)) Df Sum Sq Mean Sq F value Pr(>F) treat 3 11.67 3.889 5.983 0.041463 * block 3 66.08 22.028 33.889 0.000953 *** Residuals 5 3.25 0.650 --- Signif. codes: 0 *** 0.001 ** 0.01 * 0.05. 0.1 1 4 observations deleted due to missingness > summary(aov(rep block+treat,catalyst)) Df Sum Sq Mean Sq F value Pr(>F) block 3 55.00 18.333 28.20 0.00147 ** treat 3 22.75 7.583 11.67 0.01074 * Residuals 5 3.25 0.650 --- Signif. codes: 0 *** 0.001 ** 0.01 * 0.05. 0.1 1 4 observations deleted due to missingness hsuhl (NUK) DAE Chap. 4 52 / 54
Balanced Incomplete Block Designs (BIBD) (cont.) like to assess the block effects alternate partitioning of SS T SS Treatments : unadjusted SS T = SS Treatments + SS Blocks(adjusted) + SS E SS Blocks(adjusted) = r b j=1 (Q j) 2 λb Q j = y j 1 4 n n ij y i, i=1 j = 1, 2,..., b SS T SS Treatments(adjusted) + SS Blocks(adjusted) + SS E hsuhl (NUK) DAE Chap. 4 53 / 54
Balanced Incomplete Block Designs (BIBD) (cont.) hsuhl (NUK) DAE Chap. 4 54 / 54