• Blocking and nuisance
factors
Design of • The randomized complete
Experiments block design or the RCBD
– Ch 4 The is foundational to this
Blocking course.
Principle
• The concept of a block is a
bit fuzzy, but useful in
reducing MSE.
Chapter 4 Design & Analysis of Experiments 10E 2020 Montgomery 1
• Blocking is a technique for dealing with nuisance
factors.
• A nuisance factor is a factor that probably has
some effect on the response, but it’s of no interest
to the experimenter…however, the variability it
contributes to the response needs to be accounted
The for.
• Typical nuisance factors include batches of raw
Blocking material, operators, different pieces of test
equipment, time (shifts, days, etc.) the experiment
Principle is done.
• We may know these nuisance factors
contribute to model variability, but we don’t
care to analyze their influence. These factors
just inflate Mean Squared Error (MSE), which
is the basis for all of our inference and
comparisons.
• By blocking, we can reduce MSE.
2
The Blocking Principle
• Many experiments involve blocking (or should)
• Failure to block is a common flaw in designing an
experiment. It elevates MSE and can hide
meaningful differences between factor groups.
• You should always consider blocking, if possible,
and you can justify creating a blocking variable.
3
• If the nuisance variable is known and
controllable, we use blocking.
• If the nuisance factor is known and
uncontrollable, sometimes we can use the
The analysis of covariance – ANCOVA- (Chapter 15
of STA 590) to remove the effect of the nuisance
Blocking factor from the analysis.
•
Principle If the nuisance factor is unknown and
uncontrollable (a “lurking” variable), we hope
that randomization balances out its impact across
the experiment
• Sometimes several sources of variability are
combined in a block, so the block becomes an
aggregate variable.
4
The
Hardness • We wish to determine whether 4
different sensor tips produce different
Testing (mean) hardness readings using a
Example Rockwell hardness tester.
• Each tip will be used on the same
(Table 4.1 experimental unit; that is, assume a test
piece of steel.
pg. 115) • The test pieces are a source of nuisance
variability. At a microscopic level, the
piece is not homogeneous. Where you
test on the piece can also influence the
reading.
5
The • We will treat the test pieces as blocks.
Hardness • We will consider the blocks as
homogeneous experimental units and
Testing include this blocking variable as a factor
in our model.
Example • We would expect the piece to
contributed some variability, the pieces
(Table 4.1 are not identical, but we really do not
care about that.
pg. 115) • But if this variability can be quantified
we can reduce MSE. MSE is the
garbage bin. Anything you cannot
quantify goes into MSE.
• The objective is to analyze the sensor
tips. We know the readings on a single
piece will vary, we cannot control that.
But we can block it.
6
The Hardness Testing Example
• Suppose that we use b = 4 blocks:
There would be 4P4 = 4! = 24 ways to assign these
tips to the different designated points on the
block, but this was the random assignment
arbitrarily chosen. 7
Extension of ANOVA to the RCBD
• Suppose that there are a treatments (tips) and b
blocks
• A statistical model for the RCBD is
i 1, 2,..., a
yij i j ij
j 1, 2,..., b
• We want to see if the tips have equal readings.
This would be testing Ho: 𝝉𝒊 = 0
• We include the block effect, but don’t really
care about testing it.
• We also assume no interaction.
8
Extension of the ANOVA to the RCBD
ANOVA partitioning of total variability:
a b a b
ij .. [( yi. y.. ) ( y. j y.. )
( y y
i 1 j 1
) 2
i 1 j 1
( yij yi. y. j y.. )]2
a b
b ( yi. y.. ) 2 a ( y. j y.. ) 2
i 1 j 1
a b
( yij yi. y. j y.. ) 2
i 1 j 1
SST SSTreatments SS Blocks SS E
9
Extension of ANOVA to the RCBD
The degrees of freedom for the sums of squares in
SST SSTreatments SSBlocks SSE
are as additive. Remember that N=ab
N-1 = (a-1)+ (b-1) + (a-1)(b-1)
ab -1 = a + b –2 – a –b +ab +1
= ab-1
Therefore, ratios of sums of squares to their degrees of
𝑴𝑺𝑻
freedom result in MS and F*= 𝑴𝑺𝑬 is an F statistic
that can be used to test the hypothesis of equal
treatment means
10
ANOVA Display for the RCBD
11
Vascular Graft Example (page 120)
• In this experiment, the factor of interest is Extrusion
Pressure (PSI). The dependent variable is the
number of defects per production run. There are 6
batches of raw material (resin), each from a different
manufacturer but will be treated as blocks.
12
Vascular Graft Example
R code
(data put in manually even though this is Table4.3 in the Mongomery package)
defects<-c(90.3,89.2,98.2,93.9,87.4,97.9,92.5,89.5,90.6,94.7,87,95.8,85.5,90.8,
89.6,86.2,88,93.4,82.5,89.5,85.6,87.4,78.9,90.7)
block<-[Link](rep(seq(1:6),times=4))
pressure<-[Link](rep(c("8500","8700","8900","9100"), each=6))
data<-[Link](defects,block,pressure)
13
Vascular Graft Example
R code
model<-aov(defects~block+pressure,data=data)
#notice we use block + pressure since block*pressure would include block,
pressure, and the interaction that we do not want.
summary(model)
Df Sum Sq Mean Sq F value Pr(>F)
block 5 192.2 38.45 5.249 0.00553 **
pressure 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
Block is significant, but we don’t care. Pressure is too so we will look at
Tukey.
14
Color Interaction Plot for the
Vascular Graft Example
We assumed no interaction, and don’t test for it, but an interaction plot can
help verify our assumptions. We don’t want any extreme criss-cross patterns.
R-code:
library(ggplot2)
ggplot(data,aes(x=pressure,y=defects,group=block))+
geom_point(aes(color=block))+
geom_line(aes(color=block),size=1.2)
This plot is fine. For the
most part this is no
extreme “X” or criss-
cross pattern.
15
Diagnostics for the Vascular Graft Example
[Link](model$residuals)
Shapiro-Wilk normality test
data: model$residuals
W = 0.95631, p-value = 0.3689 (normality acceptable)
leveneTest(defects~pressure)
Levene's Test for Homogeneity of Variance (center = median)
Df F value Pr(>F)
group 3 0.7789 0.5195
(Homogeniety of Factor Level Variances acceptable)
16
Multiple Comparisons for the Vascular Graft Example –
Which Pressure is Different?
tapply(data$defects,data$pressure,mean)
8500 8700 8900 9100
92.81667 91.68333 88.91667 85.76667
We will designate these, in increasing numerical order
µ4 µ3 µ2 µ1 (we will need to add the underlining)
Where 4=9100 psi , 3=8900 psi etc.
Higher pressure has less defects.
17
Multiple Comparisons for the Vascular Graft Example –
Which Pressure is Different?
tukey <- TukeyHSD(model)
tukey$pressure
#table for pairwise pressure comparisons, don’t need Block.
diff lwr upr p adj
8700-8500 -1.133333 -5.637161 3.370495 0.885483084 1 vs. 2
8900-8500 -3.900000 -8.403828 0.603828 0.101308402 1 vs 3
9100-8500 -7.050000 -11.553828 -2.546172 0.002088318
8900-8700 -2.766667 -7.270495 1.737161 0.324564408 2 vs 3
9100-8700 -5.916667 -10.420495 -1.412839 0.008666712
9100-8900 -3.150000 -7.653828 1.353828 0.225767430 3 vs 4.
The pressure groups with p-values above .05 are equal (not significant).
These must be indicated using the underlining technique.
18
Multiple Comparisons for the Vascular Graft Example
Which Pressure is Different?
Underlining technique:
µ4 µ3 µ2 µ1
______
_________
Where 4=9100 psi, 3=8900 psi, 2=8700, 1=8500.
1-2-3 are all pairwise equal.
3-4 are equal, so running at Pressure 3 (8900) might result in
less wear on the equipment or same money. 19
Multiple Comparisons for the Vascular Graft Example –
Which Pressure is Different?
Another way to do this is using [Link]
library(agricolae)
tukey<-[Link](model,"pressure",group=TRUE)
tukey
$groups µ4 µ3 µ2 µ1
defects groups ______
8500 92.81667 a _________
8700 91.68333 a
8900 88.91667 ab Where 4=9100 psi, 3=8900 psi,
9100 85.76667 b 2=8700 psi , 1=8500 psi.
Partial output. Use letter to create underlining.
20
What are the consequences of no blocks?
Conventional One Way ANOVA
model2<-aov(defects~pressure,data=data)
summary(model2)
Df Sum Sq Mean Sq F value Pr(>F)
pressure 3 178.2 59.39 3.931 0.0234 *
Residuals 20 302.1 15.11
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
MSE increased from 7.326 to 15.11 (doubled), even though Df went up too.
Block variability has no place to go. It must go to MSE. So the block helped
and “absorbed” 15.11-7.326 = 7.784 or about 7.784/15.11= 51.5% of the
variability.
Running this as a One-Way ANOVA, the comparisons are now
µ 4 µ3 µ 2 µ1
____________
________________
Due to the increase in MSE (uncertainty), important differences (4 vs 2) can
sometimes be missed. These results suggest µ2 (8700) is the same as µ4 (9100).
21
The Latin Square Design
• Text reference, Section 4.2, page 133
• These designs are used to simultaneously control
(or eliminate) two sources of nuisance
variability
• A significant assumption is that the three factors
(treatments, two nuisance factors) do not interact
• There are many Latin Square Designs. You need
each treatment to only appear once in each row
and each column.
• A Sudoko is a special type of Latin Square.
22
The Rocket Propellant Problem –
A Latin Square Design
• There are 5 operators (1-5), 5 fuel formulas(A-E), and each batch can
only make 5 containers of fuel.
• There is not enough raw material go around. So a 5x5 Latin Square
Design assigns formulations to batches across operators.
• In this problem, the 5 Operators (Chemists) were each given 5
batches of raw material. Each Operator made (A,B,C,D,E). Note
there are no repeats on the batch or the operator.
• The dependent variable is the amount of time, in seconds, that the fuel
burned. 23
Statistical Analysis of the
Latin Square Design
• The statistical (effects) model is
i 1, 2,..., p
yijk i j k ijk j 1, 2,..., p
k 1, 2,..., p
• The statistical analysis (ANOVA) is much like the
analysis for the RCBD.
• See the ANOVA table, page 135 (Table 4.10)
• The analysis for the rocket propellant example
follows
Chapter 4 Design & Analysis of Experiments 24
10E 2020 Montgomery
• In this example, treatment is the formulation(A-E)
that we care about.
• The rows are the batches and the columns are the
operators.
• We are not concerned with batches or operators and
would want to assume no row or column interaction
25
with treatment.
The Rocket Propellant Problem –
A Latin Square Design
library(tidyverse)
library(MontgomeryDAE)
data<-(Table4.9)
Data<-Table4.9%>%
mutate(across(where([Link]), [Link])) #change to factors
rocket<-aov(BurnRate~Batch+Operator+Formulation)
summary(rocket)
Df Sum Sq Mean Sq F value Pr(>F)
Batch 4 68 17.00 1.594 0.23906
Operator 4 150 37.50 3.516 0.04037 *
Formulation 4 330 82.50 7.734 0.00254 **
Residuals 12 128 10.67
---Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
26
The Rocket Propellant Problem –
A Latin Square Design
R code Diagnostics:
[Link](rocket$residuals)
Shapiro-Wilk normality test
data: rocket$residuals
W = 0.92239, p-value = 0.05811
leveneTest(BurnRate~Batch)
Levene's Test for Homogeneity of Variance (center = median)
Df F value Pr(>F)
group 4 0.8196 0.5278
20
For this model, the diagnostics are acceptable (normality barely made
it! ) 27
TukeyHSD(rocket,”formula”)
Tukey multiple comparisons of means
95% family-wise confidence level Factor Level Means:
tapply(data$time,data$formula,mean)
Fit: aov(formula = time ~ operator + batch + formula) A B C D E
$formula
28.6 20.2 22.4 29.8 26.0
diff lwr upr p adj
B-A -8.4 -14.9839317 -1.8160683 0.0110827
C-A -6.2 -12.7839317 0.3839317 0.0684350
D-A 1.2 -5.3839317 7.7839317 0.9754380
E-A -2.6 -9.1839317 3.9839317 0.7194121 Red is not a significant difference
C-B 2.2 -4.3839317 8.7839317 0.8204614
D-B 9.6 3.0160683 16.1839317 0.0041583
E-B 5.8 -0.7839317 12.3839317 0.0944061
D-C 7.4 0.8160683 13.9839317 0.0254304 Looks like E,A, or D
E-C 3.6 -2.9839317 10.1839317 0.4461852
E-D -3.8 -10.3839317 2.7839317 0.3966727 should be considered.
The underlining resulting from this analysis:
µB µC µE µA µD
_________________
_________________
__________________ 28
Practice Problems
1. Exercise 4.13
A consumer products company relies on direct mail marketing pieces as a major component
of its advertising campaigns. The company has three different designs for a new brochure
and want to evaluate their effectiveness, as there are substantial differences in costs between
the three designs. The company decides to test the three designs by mailing 5,000 samples of
each to potential customers in four different regions of the country. Since there are known
regional differences in the customer base, regions are considered as blocks. The number of
responses to each mailing is given.
a) At 95% confidence, determine if there is a difference in mean cotton
strength across the groups.
b) If there are differences, use underlining to depict the differences.
c) Analyze the diagnostics, including an interaction plot, to validate your model.
Chapter 4 Design & Analysis of Experiments 29
10E 2020 Montgomery
Practice Problems
2. Exercise 4.28
An industrial engineer is investigating the effect of four assembly methods (A, B, C, D) on
the assembly time for a color television component. Four operators are selected for the
study. Furthermore, the engineer knows that each assembly method produces such fatigue
that the time required for the last assembly may be greater than the time required for the
first, regardless of the method. That is, a trend develops in the required assembly time. To
account for this source of variability, the engineer uses the Latin square design shown
below. Analyze the data from this experiment (α = 0.05) draw appropriate conclusions.
a) At 95% confidence, determine if there is a difference in mean cotton
strength across the groups.
b) If there are differences, use underlining to depict the differences.
c) Analyze the diagnostics to validate your model.
Chapter 4 Design & Analysis of Experiments 30
10E 2020 Montgomery