This action might not be possible to undo. Are you sure you want to continue?
https://www.scribd.com/doc/86751545/L6RCBD
03/26/2012
text
original
1
1
Topic 6. Randomized Complete Block Design (RCBD)
[ST&D Chapter 9 sections 9.1 to 9.7 (except 9.6) and Chapter 15: section 15.8]
6. 1. Variability in the completely randomized design (CRD)
In the CRD it is assumed that all experimental units are uniform. This is not always true
in practice, and it is necessary to develop methods to deal with such variability. When
comparing two methods of fertilization, if one region of the field has much greater
natural fertility than the others, a treatment effect might be incorrectly ascribed to the
treatment applied to that part of the field, leading to a Type I error. For this reason, when
conducting a CRD, it is always advocated to include as much of the native variability of
the experiment as possible within each experimental unit (e.u.), making each e.u. as
representative of the whole experiment, and the whole experiment as uniform, as
possible. In actual field studies, plots are designed to be long and narrow to achieve this
objective. But if the e.u. are more variable, experimental error (MSE) is larger, F
(MST/MSE) is smaller, and the experiment is less sensitive. And if the experiment is
replicated in a variety of situations to increase its scope the variability increases even
further. This additional variability needs to be removed from the analysis so that the
actual effects of the treatment can be detected. This is the purpose of blocking.
6. 2. Randomized complete block design (RCBD)
6. 2. 1. Definition
The RCBD assumes that a population of experimental units can be divided into a number
of relatively homogeneous subpopulations or blocks. The treatments are then randomly
assigned to experimental units such that each treatment occurs equally often (usually
once) in each block –i.e. each block contains all treatments. Blocks usually represent
levels of naturally occurring differences or sources of variation that are unrelated to the
treatments. In the analysis, the variation among blocks can be partitioned out of the
experimental error (MSE), thereby reducing this quantity and increasing the power of the
test.
6. 2. 2. Example: Consider a field trial comparing three cultivars (A, B, and C) of sugar
beet with four replications (in this case, the field is divided into 12 plots; each plot is a
replication / e.u.). Suppose the native level of soil nitrogen at the field site varies from
high at the north end to low at the south end. In such situation, yield is expected to vary
from one end of the field to the other, regardless of cultivar differences. This violates the
assumption that the error terms are randomly distributed since the residuals will tend to
be positive at the north end of the field and negative at the south end.
North end of field
Hi N
1 2 3
4 5 6
7 8 9
10 11 12
South end of field
Low N
6.2
2
One strategy to minimize the impact of this variability in native soil fertility on the
analysis of treatment effects is to divide the field into four eastwest blocks of three plots
each.
Block North end of field
Hi N
1 1 2 3
2 1 2 3
3 1 2 3
4 1 2 3
South end of field
Low N
Because these blocks run perpendicular to the nitrogen gradient, the soil within each of
these blocks will be relatively uniform. This is the basic idea of the randomized
complete block design. Remember that in the completely randomized design (CRD),
each e.u. in the experiment has an equal chance of being assigned any treatment level
(i.e. a single randomization is performed for the entire experiment). This is not the case
in an RCBD. In the randomized complete block design (RCBD), each e.u. in a given
block has the same chance of being chosen for each treatment (i.e. a separate
randomization is performed for each block). Within each block, a fixed number (often 1)
of e.u.'s will be assigned to each treatment level. The term "complete" refers to the fact
that all treatment levels are represented in each block (and, by symmetry, that all blocks
are represented in each treatment level).
After the four separate randomizations, one for each block, the field could look like this:
Block North end of field
Hi N
1 B A C
2 A B C
3 A C B
4 A C B
South end of field
Low N
6. 2. 3. The linear model
In the case of a single replication per blocktreatment combination (like the example
above), the underlying linear model that explains each observation is:
Y
ij
= µ+ t
i
+ 
j
+ c
ij
.
Here, as before, t
i
represents the effect of treatment i (i= 1,…, t) such that the average of
each treatment level is
i i
T t µ + = . In a similar way, 
j
represents the effect of Block j (j =
1, ..., r). , such that the average of each block is
j j
B  µ + = . As always, c
ij
are the
residuals, the deviations of each observation from their expected values. The model in
dot notation:
6.3
3
And the sum of squares:
or, TSS = SST + SSB + SSE.
Since the variance of means of n observations is o
2
/n, the coefficients r and t (within SST
and SSB respectively) ensure that all mean squares are estimates of the same o
2
when
there are no block or treatment effects. This is another example of partitioning of
variance, made possible because the sums of squares of blocks and treatments are
orthogonal to one another. This orthogonality is a direct result of the balanced presence
of all treatments in each block.
6. 2. 4. ANOVA
ANOVA table for the RCBD (one replication per blocktreatment combination).
Source df SS MS F
Blocks r  1 SSB SSB/(r1)
Treatments t  1 SST SST/(t1) MST/MSE
Error (r1)(t1) TSSSSTSSB SSE/(r1)(t1)
Total rt – 1 TSS
ANOVA table for the CRD
Source df SS MS F
Treatments t  1 SST SST/(t1) MST/MSE
Error t(r  1) TSS  SST SSE/r(t1)
Total rt – 1 TSS
Due to the additional factor in the linear model, the ANOVA table for the RCBD has an
additional row (Block) relative to that for the CRD.
Notice that one consequence of this is that there are fewer degrees of freedom for error in
the RCBD design than in the CRD design [(r1)(t1) vs. t(r1), or (r  1) fewer degrees of
freedom].
In the RCBD, these (r – 1) degrees of freedom have been partitioned from the error and
assigned to the blocks.
¿ ¿ ¿¿ ¿ ¿
= = = = = =
+ ÷ ÷ + ÷ + ÷ = ÷
t
i
t
i
t
i
r
j
j i
ij
r
j
j i
r
j
ij
Y Y Y Y Y Y t Y Y r Y Y
1 1 1 1
2
.. . .
1
2
.. .
2
.. .
1
2
.. ) ( ) ( ) ( ) (
) ( ) ( ) ( .. . . .. . .. . .. Y Y Y Y Y Y Y Y Y Y j i
ij
j i
ij
+ ÷ ÷ + ÷ + ÷ + =
6.4
4
Power
1 – β
distribution of the difference between
two means (RCBD and CRD).
α/2
MSE
RCBD
=MSE
CRD
df MSE: CRD > RCBD
Critical F: RCBD > CRD
Rejection
threshold
RCBD
Rejection
threshold
CRD
When there are no significant
differences among blocks¬
power CRD > power RCBD
Situation 1: No differences among blocks (i.e. no block effects)
If the RCBD design were applied to an experiment in which the blocks were really no
different from one another (i.e. there were no significant block effect), the MSE for the
CRD and the RCBD will estimate the same error variance. However the degrees of
freedom of the MSE for the RCBD will be smaller than those for the CRD and therefore
the critical F value will be larger.
The larger critical value
in the RCBD moves the
threshold of rejection
further from the mean
than in the CRD. This
change in the rejection
threshold affects the
Type II error (β) and the
power of the test (1 β).
Under this scenario, the
probability of accepting
a false null hypothesis
(β) will be smaller in
the CRD than in the
RCBD. In other words,
the CRD would in this
situation be more
powerful.
Situation 2: Significant difference among blocks
Now suppose that there
really are substantial
differences among blocks as
well as among treatments (H
0
is false). In a CRD, this
variation due to differences
among blocks would remain
in the error. This larger MSE
would make the F statistic
(MST/MSE) for the CRD
smaller (less significant) than
the F statistic for the RCBD.
Under this scenario, the
RCBD would still have a
larger critical F value in the
table because of the lost
degrees of freedom; but this may be more than compensated by the smaller MSE. If the
effect of the reduced MSE (increased F) outweighs the effect of the larger critical value
6.5
5
(rejection threshold further from 0), the net result will be a smaller , and thus a larger
power (1) in the RCBD relative to the CRD.
Obviously, one should only use the RCBD when the variation explained by the blocks
more than offsets the penalty associated with having fewer error degrees of freedom. So
how can one determine when an RCBD is appropriate? This question is answered using
the concept of efficiency (introduced in Section 1.4.4.6. and further developed in section
6. 3.).
6. 2. 5. Example (from Little and Hills book)
This experiment was conducted to investigate the effect of estrogen on weight gain in
sheep.
The four treatments in the experiment are a factorial combinations of two separate
factors: Gender of sheep (male and female) and amount of estrogen (S0 and S3).
Although this experiment could be analyzed as a factorial, in this example we are treating
the four treatments and four levels of a single factor (genderestrogen combination).
Sheep from four different ranches were involved in the experiment. Anticipating that
differences in herd management may affect the results, the researchers blocked by ranch.
The completeness of an RCBD demanded, therefore, that each ranch volunteer four sheep
to the experiment, two males and two females, providing one replication of each
treatment level from each ranch.
Table 6.1 RCBD. Effect of estrogen on weight gain in sheep (lbs).
Block (=ranch) Treatment
Treatment I II III IV Total Mean
FS0 47 52 62 51 212 53
MS0 50 54 67 57 228 57
FS3 57 53 69 57 236 59
MS3 54 65 74 59 252 63
Block Total 208 224 272 224 928
Block Mean 52 56 68 56 58
Table 6.2 RCBD ANOVA
Source of Variation df SS MS F
Totals 15 854
Blocks 3 576 192.00 24.69**
Treatments 3 208 69.33 8.91**
Error 9 70 7.78
6.6
6
Table 6.3 CRD ANOVA
Source of Variation df SS MS F
Totals 15 854
Treatments 3 208 69.33 1.29 NS
Error 12 646 53.83
Since each treatment is present at the same level of replication within each block,
differences among blocks are not the result of treatment effects. Differences among
blocks are entirely independent of treatment effects and are due only to differences
associated with the four ranches. Therefore, this component (SSB) can be perfectly
partitioned from the total SS. Ultimately, this reduces the experimental error. To see
this, compare the two tables above (Tables 6.2 and 6.3), paying close attention to the
degrees of freedom and the SS in each analysis.
6. 2. 5. 2. SAS Program
The linear model of an RCBD contains two classification variables, treatment and block.
For this experiment, we will call the treatment factor "Sex_Est" because its levels are
comprised of various combinations of gender and estrogen supplements. The block
variable is "Ranch." The response variable is "Gain." SAS does not know the scientific
interpretation of the effects in the model, so it will simply compute F statistics for both
Sex_Est and Ranch, as shown in Table 6.2 above. See the code below:
data lambs;
input sex_est $ @;
do block = 1 to 4;
input gain @;
output;
end;
cards;
f0 47 52 62 51
m0 50 54 67 57
f3 57 53 69 57
m3 54 65 74 59
;
proc glm;
class block sex_est;
model gain=block sex_est;
run; quit;
6. 3. Relative efficiency [ST&D p. 221, and Topic 1 section 1.4.4.6]
We saw earlier that if the variation among blocks is large then we can expect the RCBD
to be more sensitive to treatment effects than the CRD; conversely, if this variation is
small, the CRD may be more sensitive (i.e. more powerful). The concept of relative
efficiency formalizes the comparison between two experimental methods by quantifying
this balance between loss of degrees of freedom and reduction in experimental error.
6.7
7
Recall that the F statistic = MST/MSE. The experimental design primarily affects the
MSE since the degrees of freedom for treatments is always (t – 1) and the variation due to
treatments is independent of (i.e. orthogonal to) the variation due to blocks and the
experimental error. The information per replication in a given design is:
2
1
c
o
= I
Therefore, the relative efficiency of one design another is
2
1
2
2
2
2
2
1
2
1
2 : 1
1
1
c
c
c
c
o
o
o
o
= = =
I
I
RE
In reality, we never know the true experimental error (
2
c
o ); we only have an estimate of
it (MSE). To pay for this lack of knowledge, a correction factor is introduced into the
expressions for information (I) and relative efficiency (RE) (Cochram and Cox, 1957).
The following formulas include this correction factor and give an estimate of the relative
amount of information provided by two designs:
MSE df
df
I
MSE
MSE
1
3
1 1
2 

.

\

+
+
~ =
c
o
1 1 2
2 2 1
2 2
2
1 1
1
2
1
2 : 1
) 3 )( 1 (
) 3 )( 1 (
1
3
1
1
3
1
MSE df df
MSE df df
MSE df
df
MSE df
df
I
I
RE
MSE MSE
MSE MSE
MSE
MSE
MSE
MSE
+ +
+ +
=


.

\

+
+


.

\

+
+
~ =
where MSE
i
is the mean square error from experimental design i. If this ratio is greater
than 1, it means that Design 1 provides more information per replication and is therefore
more efficient than Design 2. If RE
1:2
= 2, for example, each replication in Design 1
provides twice as much information as each replication in Design 2. Design 1 is twice as
efficient.
6.8
8
The main problem with the approach is how to estimate MSE for the alternative design.
Suppose an experiment is conducted as an RCBD. The MSE for this design is simply
given by the analysis (MSE
RCBD
). But now we wish to ask the question: What would
have been the value of the MSE if the experiment had been conducted as a CRD? In fact,
it was not conducted as a CRD. The treatments were not randomized according to a
CRD. Because of this, one cannot just reanalyze the data as though it were a CRD and
use the MSE from the analysis as a valid estimate of MSE
CRD
.
MSE
CRD
can be estimated, however, by the following formula (ST&D 222):
e T B
RCBD e T RCBD B
CRD
df df df
MSE df df MSB df
E S M
+ +
+ +
~
) (
ˆ
where MSB and MSE are the block and error mean squares in the original design
(RCBD), and df
B
, df
T
, and df
e
are the block, treatment, and error degrees of freedom in
the original design. To obtain this formula, the total SS of the two designs are assumed
equal. This equation is then expanded such that the SS are rewritten in terms of the
underlying variance components of the expected MS. Simplification of the terms
generates the above estimate (for a complete derivation, see Sokal & Rohlf 1995,
Biometry 838839).
From the sheep experiment, MSE
RCBD
= 7.78 and MSB
RCBD
= 192.0. Therefore:
62 . 44
9 3 3
78 . 7 ) 9 3 ( ) 192 ( 3 ) (
ˆ
=
+ +
+ +
=
+ +
+ +
~
e T B
RCBD e T RCBD B
CRD
df df df
MSE df df MSB df
E S M
and…
51 . 5
78 . 7 ) 3 9 )( 1 12 (
62 . 44 ) 3 12 )( 1 9 (
) 3 )( 1 (
ˆ
) 3 )( 1 (
1 2
2 1
:
=
+ +
+ +
=
+ +
+ +
~
RCBD MSE MSE
CRD MSE MSE
CRD RCBD
MSE df df
E S M df df
RE
Interpretation: It takes 5.51 replications in the CRD to produce the same amount of
information as one replication in the RCBD. Or, the RCBD is 5.51 time more efficient
than the CRD in this case. It was a very good idea to block by ranch.
6. 4. Assumptions of the model
The model for the RCBD with a single replication per blocktreatment combination is:
Y
ij
= µ + t
i
+ 
j
+ c
ij
6.9
9
As in the CRD, it is assumed that the residuals (c
ij
)
are independent, homogeneous, and
normally distributed. Also as in the CRD, it is assumed that the variance within each
treatment levels is homogeneous across all treatment levels. But now, in an RCBD
without replication (i.e. with a single replication per blocktreatment combination), there
is a third assumption of the model: Additivity of main effects.
Recall that experimental error is defined as the variation among experimental units that
are treated alike. With that in mind, consider the following schematic of our sheep
experiment:
Ranch
Trtmt 1 2 3 4
M Est
0
M Est
3
F Est
0
F Est
3
In this experiment, while there are four reps of each level of treatment and four reps of
each block, there is no true replication visàvis calculation of experimental error. For
example, there is only one male sheep at Ranch 1 that received no estrogen. Normally,
our estimate of the experimental error would come from looking at the variation among
two or more sheep treated alike (e.g. two or more sheep of the same gender, at the same
ranch, receiving the same estrogen treatment). So if we have no ability to calculate the
experimental error, what is the c
ij
in our linear model?
There is an expected value for each of the 16 cells in the above diagram, given by:
Expected Y
ij
= µ + t
i
+ 
j
In this design, we use the deviation of the observed values from their expected value as
estimates of the experimental error. Technically, though, these deviations are the
combined effects of experimental error and any putative block*treatment interaction.
With only one replication per cell, we are unable to separate these two effects. So when
we use these deviations (observed – expected) as an estimate of the experimental error,
we are assuming that there are no significant block*treatment interactions (i.e. no
significant nonadditive effects).
Said another way, in the Y
ij
= µ + t
i
+ 
j
+ c
ij
model, the residuals are the results of
experimental error and any nonadditive treatment*block interactions:
c
ij
= t
i
*
j
+ error
ij
6.10
10
Thus, when we use c
ij
as estimates of the true experimental error, we are assuming that
t
i
*
j
= 0.
This assumption of no interaction in a twoway ANOVA is referred to as the assumption
of additivity of the main effects. If this assumption is violated, all Ftests will be very
inefficient and possibly misleading, particularly if the interaction effect is very large.
Example: A significant interaction term will result if the effect of the two factors A and
B on the response variable Y is multiplicative rather than additive. This is one form of
nonadditivity.
Table 6.4. Additive and multiplicative effects
Factor A
Factor B
t
1
= +1 t
2
= +2 t
3
= +3

1
= +1
2 3 4 Additive effects
1 2 3 Multiplicative effects
0 0.30 0.48 Log of multiplicative effects

2
= +5
6 7 8 Additive effects
5 10 15 Multiplicative effects
0.70 1.00 1.18 Log of multiplicative effects
In Table 6.4 additive and multiplicative treatment effects are shown in a hypothetical
twoway ANOVA. Let us assume that the population mean is µ=0. Then the mean of the
e.u.’s subjected to level 1 of factor A and level 1 of factor B should be 2 (1+1) by the
conventional additive model. Similarly, the expected subgroup mean subjected to level 3
of factor A and level 2 of factor B is 8, since the respective contributions to the mean are
3 and 5. If the process is multiplicative rather than additive, however, as occurs in a
variety of physicochemical and biological phenomena, the expected values are quite
different. For treatment A
3
B
2
, the expected value is 15, the product of 3 and 5.
If multiplicative data of this sort are analyzed by a conventional ANOVA, the interaction
SS will be large due to the nonadditivity of the treatment effects. If this SS is embedded
in the SSE, as in the case of an RCBD with one e.u. per blocktreatment combination, the
estimate of the experimental error will be artificially large, thereby making all F tests
artificially insensitive.
In the case of multiplicative effects, there is a simple remedy. Transforming the variable
by taking the log of each mean will restore additivity. The third line in each cell gives
the logarithm of the expected value, assuming multiplicative relations. After the
transformation, the increments are strictly additive again (t
1
=0, t
2
=0.30, t
3
=0.48, 
1
=0,

1
=0.70). This is a good illustration of how transformations of scale can be used to meet
the assumptions of analysis of variance.
6.11
11
6. 4. 1. Tukey’s test for nonadditivity
John Tukey devised a very clever method of testing for significant nonadditive effects
(i.e. interactions) in datasets that lack the degrees of freedom necessary to include such
effects (i.e. interactions) directly in the model. Here's the logic behind the test:
To begin, recall that under our linear model, each observation is characterized as:
ij j i ij
y c t  µ + + + =
Therefore, the predicted value of each individual is given by:
j i ij
pred t  µ + + =
In looking at these two equations, the first thing to
notice is that, if we had no error in our experiment
(i.e. if 0 =
ij
c ), the observed data would exactly
match its predicted values and a correlation plot of
the two would yield a perfect line with slope = 1:
Now let's introduce some error. If the errors in the
experiment are in fact random and independent
(criteria of the ANOVA and something achieved
by proper randomization from the outset), then
ij
c
will be a random variable that causes no systematic
deviation from this linear relationship, as indicated
in the next plot:
As this plot shows, while random error may
decrease the overall strength of correlation, it will
not systematically compromise its underlying linear nature.
But what happens when you have an interaction (e.g. Block * Treatment) but lack the
degrees of freedom necessary to include it in the linear model (e.g. when you have only 1
replication per block*treatment combination)? In
this case, the df and the variation assigned to the
interaction are relegated to the error term. Under
such circumstances, you can think of the error term
as now containing two separate components:
+ =
RANDOMij ij
c c B*T Interaction Effects
While the first component is random and will not
affect the underlying linear correlation seen above,
the second component is nonrandom and will cause
Observed vs. PredictedValues (RCBD, noerror)
10
12
14
16
18
20
10 12 14 16 18 20
Predicted
O
b
s
e
r
v
e
d
…
…
Observed vs. Predicted (RCBD, with error)
10
12
14
16
18
20
10 12 14 16 18 20
Predicted
O
b
s
e
r
v
e
d
.
.
Observedvs. Predicted (RCBD, with error and B*T)
10
12
14
16
18
20
10 12 14 16 18 20
Predicted
O
b
s
e
r
v
e
d
.
.
6.12
12
systematic deviations from linearity. Indeed, if this interaction component is too large,
the observed vs. predicated correlation will become detectably nonlinear, thereby
violating the ANOVA assumption of random and independent error, not to mention
making your F tests much less sensitive.
The plot on the following page illustrates the deviation from linearity that results when
significant multiplicative effects (one kind of nonadditive effect) cannot be
accommodated by the model. The quadratic (i.e. nonlinear) trend is unmistakable.
So, if the observed and predicted values obey a linear relationship, then
the nonrandom Interaction Effects buried in the error term are sufficiently
small to uphold our assumption of random, independent error.
Seen in this light, our test for unaccountedfor nonadditivity [significant nonadditive
(i.e. interaction) effects] becomes a simple test for linear regression, which is what
Tukey's 1df test is. It is a regression of the observed values with the squares of the
predicted values. Why the squares? Because, as mentioned before when talking about
contrasts for trends, to test if a relationship is linear, (as opposed to a higher power
relationship), one tests for a quadratic effect, and if it is significant concludes that the
relationship is not linear.
This test is easily implemented using SAS:
Data Lambs;
Input Sex_Est $ @@;
Do Ranch = 1 to 4;
Input Gain @@;
Output;
End;
Cards;
F0 47 52 62 51
M0 50 54 67 57
F3 57 53 69 57
M3 54 65 74 59
;
Proc GLM;
Class Sex_Est Ranch;
Model Gain = Ranch Sex_Est;
Output out = LambsPR p = Pred r = Res;
Proc GLM; * This is the Tukey 1 df test;
Class Sex_Est Ranch;
Model Gain = Ranch Sex_Est Pred*Pred;
Run;
Quit;
Output from the 2nd Proc GLM (the Tukey 1 df test):
Source DF Type III SS Mean Square F Value Pr > F
Ranch 3 0.73506585 0.24502195 0.03 0.9927
Sex_Est 3 0.29808726 0.09936242 0.01 0.9981
Pred*Pred 1 3.41880342 3.41880342 0.41 0.5395 NS
6.13
13
The Tukey test is NS (p = 0.5395 > 0.05); therefore, we fail to reject the null hypothesis
of additivity and we are justified in using the MSE as a valid estimate of the true
experimental error.
Please note: This test is necessary ONLY when there is one observation per block
treatment combination. If there are two or more replications per blocktreatment
combination, the block*treatment interaction can be tested directly in an exploratory
model.
6. 4. 2. Diagnostic checking of the Model
Discrepancies of many different kinds between the tentative model and the observed data
can be detected by studying residuals. These residuals, the third value in each cell in the
table below, are the quantities remaining after the systematic contributions associated
with the assumed model (in this case treatments and blocks) are removed (See ST&D
213214).
Table 6.5 Yield of penicillin from four different protocols (A – D). Blocks are different
stocks of an important reagent. The numbers below each observation (O) are the predicted
values (P = Grand Mean + Treatment effect + Block effect) and the residuals (R).
Block
Treatment Block
Mean
Block
Effect A B C D
Stock 1
O: 89
P: 90
R: 1
O: 88
P: 91
R: 3
O: 97
P: 95
R: 2
O: 94
P: 92
R: 2
92 +6
Stock 2
O: 84
P: 81
R: 3
O: 77
P: 82
R: 5
O: 92
P: 86
R: 6
O: 79
P: 83
R: 4
83 3
Stock 3
O: 81
P: 83
R: 2
O: 87
P: 84
R: 3
O: 87
P: 88
R: 1
O: 85
P: 85
R: 0
85 1
Stock 4
O: 87
P: 86
R: 1
O: 92
P: 87
R: 5
O: 89
P: 91
R: 2
O: 84
P: 88
R: 4
88 2
Stock 5
O: 79
P: 80
R: 1
O: 81
P: 81
R: 0
O: 80
P: 85
R: 5
O: 88
P: 82
R: 6
82 4
Treatment mean
84 85 89 86
Mean=86
Treatment effect 2 1 3 0
SAS program
This experiment, organized as an RCBD, has one replication per blocktreatment
combination. Therefore, in addition to testing for normality and variance homogeneity of
residuals, one must also test for nonadditivity of block and treatment effects. The SAS
code for such an analysis:
6.14
14
Data Penicillin;
Do Block = 1 to 4;
Do Trtmt = 1 to 4;
Input Yield @@;
Output;
End;
End;
Cards;
89 88 97 94
84 77 92 79
81 87 87 85
87 92 89 84
79 81 80 88
;
Proc GLM Data = Penicillin;
Class Block Trtmt;
Model Yield = Block Trtmt;
Output out = PenPR p = Pred r = Res;
Proc Univariate Data = PenPR normal; * Testing for normality of residuals;
Var Res;
Proc GLM Data = Penicillin; * Testing for variance homogeneity (1 way ANOVA);
Class Trtmt;
Model Yield = Trtmt;
Means Trtmt / hovtest = Levene;
Proc Plot Data = PenPR; * Generating a plot of predicted vs. residual values;
Plot Res*Pred = Trtmt;
Proc GLM Data = PenPR; * Testing for nonadditivity;
Class Block Trtmt;
Model Yield = Block Trtmt Pred*Pred;
Run; Quit;
The OUT option after MODEL creates a new data set, named ‘PenPR’ in this example,
that includes the original variables plus the predicted (‘Pred’) and residual (‘Res’)
variables.
This dataset meets all assumptions: normality, variance homogeneity, and additivity:
Tests for Normality
Test Statistic p Value
ShapiroWilk W 0.967406 Pr < W 0.6994 NS
Levene's Test for Homogeneity of Yield Variance
ANOVA of Squared Deviations from Group Means
Sum of Mean
Source DF Squares Square F Value Pr > F
Trtmt 3 922.2 307.4 0.39 0.7620 NS
Error 16 12618.8 788.7
Tukey's 1 df test for nonadditivity
Source DF Type III SS Mean Square F Value Pr > F
Block 3 28.29215818 9.43071939 0.28 0.8365
Trtmt 3 28.26814524 9.42271508 0.28 0.8367
Pred*Pred 1 26.46875000 26.46875000 0.79 0.3901 NS
6.15
15
Finally, consider the plot of predicted vs. residual values:
In this example, no particular pattern is observed in the residuals. This observation
parallels the normal distribution of the residuals, the homogeneous variances of the
residuals among treatments, and a nonsignificant Tukey’s test for nonadditivity.
6.4.3 The plot of residual vs. predicted values
As demonstrated in the above example, when the assumptions of the model are met, no
particular pattern will be seen in the scatterplot of residual vs. predicted values. As
different assumptions are violated, patterns will begin to emerge; and the characteristics
of those patterns can provide information as to what strategies (e.g. data transformations)
should be pursued.
For example, in some cases, the plot of the residuals
versus the predicted values will show a curvilinear
relationship with positive residuals for low and high
values of Y and negative residuals for intermediate
values. This sort of pattern suggests multiplicative
block and treatment effects that might be eliminated
by a suitable transformation of the response
variable.
In other cases, the plot of the residuals versus the
predicted values presents a funnellike appearance.
This indicates that the variance increases as the
value of the response increases (a situation that is
common when the variance is a constant percentage
of the mean).
Another useful plot to consider is the scatterplot of residuals vs. the sequence in which
the data was collected. Such a plot can reveal patterns of systematic variation during the
data collection (e.g. increasing variation with time as the operators get tired).
6.16
16
6.5 Example of nesting within an RCBD
The following dataset was created assuming that each sheep was weighed two separate
times at the end of the experiment (i.e. two measurements (subsamples) were taken on
each experimental unit). The subsample values were created such that their averages
yield the values of each experimental unit in the original dataset:
Data Lambs;
Input Sex_Est $ Ranch Animal Gain @@;
Cards;
f0 1 1 46 f0 2 1 51 f0 3 1 61 f0 4 1 50
m0 1 1 49 m0 2 1 53 m0 3 1 66 m0 4 1 56
f3 1 1 56 f3 2 1 52 f3 3 1 68 f3 4 1 56
m3 1 1 53 m3 2 1 64 m3 3 1 73 m3 4 1 58
f0 1 1 48 f0 2 1 53 f0 3 1 63 f0 4 1 52
m0 1 1 51 m0 2 1 55 m0 3 1 68 m0 4 1 58
f3 1 1 58 f3 2 1 54 f3 3 1 70 f3 4 1 58
m3 1 1 55 m3 2 1 66 m3 3 1 75 m3 4 1 60
;
Proc GLM Data = Lambs Order = Data;
Class Ranch Sex_Est Animal;
Model Gain = Ranch Sex_Est Animal(Ranch*Sex_Est);
Random Animal(Ranch*Sex_Est);
Test h = Sex_Est e = Animal(Ranch*Sex_Est);
*In nested models, specify the correct error term in all contrasts and
mean comparisons;
Contrast 'sex' Sex_Est 1 1 1 1 / e =
Animal(Ranch*Sex_Est);
Contrast 'estrogen' Sex_Est 1 1 1 1 / e =
Animal(Ranch*Sex_Est);
Contrast 'interaction' Sex_Est 1 1 1 1 / e =
Animal(Ranch*Sex_Est);
Means Sex_Est / Tukey e = Animal(Ranch*Sex_Est);
*Below is a Tukey test with the incorrect error for comparison;
Means Sex_Est / Tukey;
Proc Varcomp Method = Type1;
Class Ranch Sex_Est Animal;
Model Gain = Ranch Sex_Est Animal(Ranch*Sex_Est);
Run; Quit;
Now that there are subsamples, the experimental unit (Animal) must appear in the model.
As with all experimental units, the label "Animal" is simply an ID. To specify a
particular animal in the experiment, the Ranch (i.e. block) and the level of Sex_Est (i.e.
treatment) must be specified. Hence the syntax:
Animal(Ranch*Sex_Est)
The ID "Animal" only has meaning within specific BlockTreatment combinations.
Animals are random samples from larger populations; hence Animal(Ranch*Sex_Est) is
declared as a random variable.
6.17
17
As in the CRD, it is important to note that the error term to test differences among
treatments is the variance among experimental units (MSEE). Thus
Animal(Ranch*Sex_Est) must be declared as the error term for each hypothesis tested
regarding treatment means, whether the overall F test or subsequent contrasts or mean
comparisons. If the error term is not specified, SAS will test every hypothesis using the
variance among subsamples (MSSE).
Output (compare to output of the original experiment with no subsamples)
Overall ANOVA
Sum of
Source DF Squares Mean Square F Value Pr > F
Model 15 1708.000000 113.866667 56.93 <.0001
Error 16 32.000000 2.000000
Corrected Total 31 1740.000000
Partitioning of model effects (automatic wrong F tests for treatment and block)
Source DF Type III SS Mean Square F Value Pr > F
Ranch 3 1152.000000 384.000000 192.00 <.0001
Sex_Est 3 416.000000 138.666667 69.33 <.0001
Animal(Ranch*Sex_Es) 9 140.000000 15.555556 7.78 0.0002
Correct F test for treatment
Tests of Hypotheses Using the Type III MS for Animal(Ranch*Sex_Es) as an Error Term
Source DF Type III SS Mean Square F Value Pr > F
Sex_Est 3 416.0000000 138.6666667 8.91 0.0046 **
Note that 8.91 is exactly the same as in the previous analysis (Topic 6.2.5, Table 6.2)
using the average of the two subsamples)
Correct contrasts
Contrast DF Contrast SS Mean Square F Value Pr > F
sex 1 128.0000000 128.0000000 8.23 0.0185 *
estrogen 1 288.0000000 288.0000000 18.51 0.0020 **
interaction 1 0.0000000 0.0000000 0.00 1.0000 NS
Correct Tukey means separation
Minimum Significant Difference 6.1563
Tukey Grouping Mean N Sex_Est
A 63.000 8 m3
B A 59.000 8 f3
B A 57.000 8 m0
B 53.000 8 f0
Incorrect Tukey means separation
Minimum Significant Difference 2.023
Tukey Grouping Mean N Sex_Est
A 63.0000 8 m3
B 59.0000 8 f3
B 57.0000 8 m0
C 53.0000 8 f0
Type 1 Analysis of Variance
Source Expected Mean Square
Ranch Var(Error) + 2 Var(Animal(Ranch*Sex_Es)) + 8 Var(Ranch)
Sex_Est Var(Error) + 2 Var(Animal(Ranch*Sex_Es)) + 8 Var(Sex_Est)
Animal(Ranch*Sex_Es) Var(Error) + 2 Var(Animal(Ranch*Sex_Es))
6.18
18
Error Var(Error)
Type 1 Estimates
Variance Component Estimate %
Var(Ranch) 46.05556 65.6
Var(Sex_Est) 15.38889 21.9
Var(Animal(Ranch*Sex_Es)) 6.77778 9.7
Var(Error) 2.00000 2.8
The only reason to analyze this dataset as a nested RCBD is to
calculate these variance components. If you do not need these
variance components, simply average the subsamples for each
experimental unit and analyze it as a simple RCBD.
As with the CRD, this variance component information can be used together with cost
information to determine the optimum allocation of resources among subsamples and
experimental units.
*Remember: In nested models specify the correct error term in all mean comparisons;
.u.6. The model in dot notation: 2 . r). the deviations of each observation from their expected values. ij are the residuals.2 One strategy to minimize the impact of this variability in native soil fertility on the analysis of treatment effects is to divide the field into four eastwest blocks of three plots each. the soil within each of these blocks will be relatively uniform. as before. 3. . Remember that in the completely randomized design (CRD).. that all blocks are represented in each treatment level). In the randomized complete block design (RCBD). t) such that the average of each treatment level is Ti i . one for each block.e. Block 1 2 3 4 1 1 1 1 North end of field 2 2 2 2 South end of field 3 3 3 3 Low N Hi N Because these blocks run perpendicular to the nitrogen gradient. in the experiment has an equal chance of being assigned any treatment level (i. 2. j represents the effect of Block j (j = 1. a fixed number (often 1) of e.…. each e. After the four separate randomizations. such that the average of each block is B j j . Within each block. a separate randomization is performed for each block).. Here.'s will be assigned to each treatment level. The linear model In the case of a single replication per blocktreatment combination (like the example above). As always. .e. the underlying linear model that explains each observation is: Yij = + i + j + ij. This is the basic idea of the randomized complete block design. The term "complete" refers to the fact that all treatment levels are represented in each block (and. In a similar way. a single randomization is performed for the entire experiment).u. by symmetry. in a given block has the same chance of being chosen for each treatment (i. This is not the case in an RCBD. i represents the effect of treatment i (i= 1.u. each e. the field could look like this: Block 1 2 3 4 B A A A North end of field A B C C South end of field C C B B Low N Hi N 6.
these (r – 1) degrees of freedom have been partitioned from the error and assigned to the blocks. j Y . the ANOVA table for the RCBD has an additional row (Block) relative to that for the CRD. made possible because the sums of squares of blocks and treatments are orthogonal to one another.. Y .. (Y i. t(r1).SST TSS MS SST/(t1) SSE/r(t1) F MST/MSE Due to the additional factor in the linear model. In the RCBD.1) fewer degrees of freedom]. ) (Y . ) 2 t (Y . Y . 3 .1) rt – 1 SS SST TSS . or (r ... j Y . 4. This is another example of partitioning of variance. Notice that one consequence of this is that there are fewer degrees of freedom for error in the RCBD design than in the CRD design [(r1)(t1) vs. ) And the sum of squares: (Yij Y .. This orthogonality is a direct result of the balanced presence of all treatments in each block.. Y . Since the variance of means of n observations is 2/n. ) 2 i 1 j 1 i 1 j 1 i 1 j 1 t r t r t r or. ) 2 r (Y i. 2. 6.. j Y .3 Yij Y .6. ) 2 (Yij Y i.. the coefficients r and t (within SST and SSB respectively) ensure that all mean squares are estimates of the same 2 when there are no block or treatment effects. j Y . TSS = SST + SSB + SSE. Source Blocks Treatments Error Total df r1 t1 (r1)(t1) rt – 1 SS SSB SST TSSSSTSSB TSS MS SSB/(r1) SST/(t1) SSE/(r1)(t1) F MST/MSE ANOVA table for the CRD Source Treatments Error Total df t1 t(r . Y . ) (Yij Y i. ANOVA ANOVA table for the RCBD (one replication per blocktreatment combination).
the RCBD would still have a larger critical F value in the table because of the lost degrees of freedom. In other words. In a CRD. The larger critical value MSERCBD=MSECRD distribution of the difference between in the RCBD moves the two means (RCBD and CRD). However the degrees of freedom of the MSE for the RCBD will be smaller than those for the CRD and therefore the critical F value will be larger.β). there were no significant block effect).e. this variation due to differences among blocks would remain in the error. but this may be more than compensated by the smaller MSE. Situation 2: Significant difference among blocks Now suppose that there really are substantial differences among blocks as well as among treatments (H0 is false). Under this scenario. threshold of rejection further from the mean df MSE: CRD > RCBD than in the CRD. This larger MSE would make the F statistic (MST/MSE) for the CRD smaller (less significant) than the F statistic for the RCBD.4 Situation 1: No differences among blocks (i.6. the probability of accepting a false null hypothesis (β) will be smaller in When there are no significant Power differences among blocks the CRD than in the 1–β power CRD > power RCBD RCBD. the MSE for the CRD and the RCBD will estimate the same error variance. Under this scenario. no block effects) If the RCBD design were applied to an experiment in which the blocks were really no different from one another (i. This Critical F: RCBD > CRD change in the rejection Rejection α/2 Rejection threshold affects the threshold threshold CRD Type II error (β) and the RCBD power of the test (1.e. If the effect of the reduced MSE (increased F) outweighs the effect of the larger critical value 4 . the CRD would in this situation be more powerful.
Treatment FS0 MS0 FS3 MS3 Block Total Block Mean I 47 50 57 54 208 52 Block (=ranch) Treatment II III IV Total Mean 52 62 51 212 53 54 67 57 228 57 53 69 57 236 59 65 74 59 252 63 224 272 224 928 56 68 56 58 Table 6.6. providing one replication of each treatment level from each ranch.4. Table 6.1 RCBD. and further developed in section 6.33 7. Sheep from four different ranches were involved in the experiment. two males and two females. in this example we are treating the four treatments and four levels of a single factor (genderestrogen combination).2 RCBD ANOVA Source of Variation Totals Blocks Treatments Error df 15 3 3 9 SS 854 576 208 70 MS 192. Effect of estrogen on weight gain in sheep (lbs). Example (from Little and Hills book) This experiment was conducted to investigate the effect of estrogen on weight gain in sheep.69** 8. the net result will be a smaller . 3. and thus a larger power (1) in the RCBD relative to the CRD. the researchers blocked by ranch. Anticipating that differences in herd management may affect the results. The completeness of an RCBD demanded. 2.78 F 24.4.). Although this experiment could be analyzed as a factorial. So how can one determine when an RCBD is appropriate? This question is answered using the concept of efficiency (introduced in Section 1.5 (rejection threshold further from 0). therefore. The four treatments in the experiment are a factorial combinations of two separate factors: Gender of sheep (male and female) and amount of estrogen (S0 and S3).91** 5 . Obviously.6. one should only use the RCBD when the variation explained by the blocks more than offsets the penalty associated with having fewer error degrees of freedom. 6.00 69. that each ranch volunteer four sheep to the experiment. 5.
4. To see this. if this variation is small. For this experiment. 6. conversely. 221. proc glm. as shown in Table 6. paying close attention to the degrees of freedom and the SS in each analysis. See the code below: data lambs. treatment and block. 6. this reduces the experimental error. 6 . The concept of relative efficiency formalizes the comparison between two experimental methods by quantifying this balance between loss of degrees of freedom and reduction in experimental error.6] We saw earlier that if the variation among blocks is large then we can expect the RCBD to be more sensitive to treatment effects than the CRD. model gain=block sex_est. end. output.3 CRD ANOVA Source of Variation Totals Treatments Error df 15 3 12 SS 854 208 646 MS 69. the CRD may be more sensitive (i. Differences among blocks are entirely independent of treatment effects and are due only to differences associated with the four ranches. this component (SSB) can be perfectly partitioned from the total SS. Relative efficiency [ST&D p. and Topic 1 section 1.3). Ultimately. differences among blocks are not the result of treatment effects.4.33 53. cards. so it will simply compute F statistics for both Sex_Est and Ranch.e.6 Table 6. more powerful). f0 47 52 62 51 m0 50 54 67 57 f3 57 53 69 57 m3 54 65 74 59 ." SAS does not know the scientific interpretation of the effects in the model. 2." The response variable is "Gain.29 NS Since each treatment is present at the same level of replication within each block. 5. do block = 1 to 4. SAS Program The linear model of an RCBD contains two classification variables. Therefore.6. The block variable is "Ranch.83 F 1. 3.2 above. 2.2 and 6. class block sex_est. input gain @. quit. we will call the treatment factor "Sex_Est" because its levels are comprised of various combinations of gender and estrogen supplements. input sex_est $ @. compare the two tables above (Tables 6. run.
for example. If RE1:2 = 2. To pay for this lack of knowledge. 1957). we never know the true experimental error ( 2 ).6. the relative efficiency of one design another is 1 RE1:2 I1 21 22 2 1 I2 1 22 In reality. The information per replication in a given design is: I 1 2 Therefore. we only have an estimate of it (MSE). orthogonal to) the variation due to blocks and the experimental error. If this ratio is greater than 1. The following formulas include this correction factor and give an estimate of the relative amount of information provided by two designs: df 1 1 MSE df MSE 3 MSE 1 2 I df MSE1 1 1 I1 df MSE1 3 MSE1 (df MSE1 1)(df MSE 2 3) MSE2 RE1:2 I 2 df MSE 2 1 1 (df MSE 2 1)(df MSE1 3) MSE1 df MSE 2 MSE 2 3 where MSEi is the mean square error from experimental design i. each replication in Design 1 provides twice as much information as each replication in Design 2. a correction factor is introduced into the expressions for information (I) and relative efficiency (RE) (Cochram and Cox. it means that Design 1 provides more information per replication and is therefore more efficient than Design 2. Design 1 is twice as efficient.7 Recall that the F statistic = MST/MSE. 7 .e. The experimental design primarily affects the MSE since the degrees of freedom for treatments is always (t – 1) and the variation due to treatments is independent of (i.
62 df B df T df e 339 ˆ (df MSE1 1)(df MSE 2 3) MSECRD (9 1)(12 3)44. and error degrees of freedom in the original design. 4. and dfe are the block. and dfB.8 The main problem with the approach is how to estimate MSE for the alternative design. one cannot just reanalyze the data as though it were a CRD and use the MSE from the analysis as a valid estimate of MSECRD.6. see Sokal & Rohlf 1995.51 (df MSE 2 1)(df MSE1 3) MSERCBD (12 1)(9 3)7. The treatments were not randomized according to a CRD.78 and MSBRCBD = 192. 6. The MSE for this design is simply given by the analysis (MSERCBD). Biometry 838839). Therefore: ˆ MSECRD and… df B MSBRCBD (df T df e ) MSERCBD 3(192) (3 9)7. the total SS of the two designs are assumed equal.0. But now we wish to ask the question: What would have been the value of the MSE if the experiment had been conducted as a CRD? In fact. Or. It was a very good idea to block by ranch. Because of this. however. the RCBD is 5. MSERCBD = 7. Suppose an experiment is conducted as an RCBD.78 44. To obtain this formula. by the following formula (ST&D 222): ˆ MSECRD df B MSBRCBD (dfT df e ) MSE RCBD df B dfT df e where MSB and MSE are the block and error mean squares in the original design (RCBD).62 5. From the sheep experiment. Assumptions of the model The model for the RCBD with a single replication per blocktreatment combination is: Yij = + i + j + ij 8 . treatment. This equation is then expanded such that the SS are rewritten in terms of the underlying variance components of the expected MS.51 replications in the CRD to produce the same amount of information as one replication in the RCBD.51 time more efficient than the CRD in this case.78 RE RCBD:CRD Interpretation: It takes 5. dfT. it was not conducted as a CRD. MSECRD can be estimated. Simplification of the terms generates the above estimate (for a complete derivation.
there is no true replication visàvis calculation of experimental error. With that in mind.e. the residuals are the results of experimental error and any nonadditive treatment*block interactions: ij = i*j + errorij 9 . we are unable to separate these two effects. there is a third assumption of the model: Additivity of main effects. But now. with a single replication per blocktreatment combination). With only one replication per cell. receiving the same estrogen treatment). our estimate of the experimental error would come from looking at the variation among two or more sheep treated alike (e. while there are four reps of each level of treatment and four reps of each block. we use the deviation of the observed values from their expected value as estimates of the experimental error.e. no significant nonadditive effects). consider the following schematic of our sheep experiment: Ranch Trtmt M Est0 M Est3 F Est0 F Est3 1 2 3 4 In this experiment. Technically. in the Yij = + i + j + ij model. So when we use these deviations (observed – expected) as an estimate of the experimental error. what is the ij in our linear model? There is an expected value for each of the 16 cells in the above diagram. homogeneous. For example. two or more sheep of the same gender. and normally distributed. Said another way. Recall that experimental error is defined as the variation among experimental units that are treated alike. we are assuming that there are no significant block*treatment interactions (i. it is assumed that the variance within each treatment levels is homogeneous across all treatment levels. Also as in the CRD. there is only one male sheep at Ranch 1 that received no estrogen.9 As in the CRD. Normally. given by: Expected Yij = + i + j In this design.6. at the same ranch. it is assumed that the residuals (ij) are independent. though. in an RCBD without replication (i. So if we have no ability to calculate the experimental error.g. these deviations are the combined effects of experimental error and any putative block*treatment interaction.
per blocktreatment combination. After the transformation. If the process is multiplicative rather than additive.u. Then the mean of the e. In the case of multiplicative effects. Additive and multiplicative effects Factor A Factor B 1= +1 2 1 0 6 5 0. 10 . This is a good illustration of how transformations of scale can be used to meet the assumptions of analysis of variance.4. If multiplicative data of this sort are analyzed by a conventional ANOVA. as occurs in a variety of physicochemical and biological phenomena.4 additive and multiplicative treatment effects are shown in a hypothetical twoway ANOVA.48. the expected subgroup mean subjected to level 3 of factor A and level 2 of factor B is 8.18 Additive effects Multiplicative effects Log of multiplicative effects Additive effects Multiplicative effects Log of multiplicative effects 1= +1 2= +5 In Table 6. since the respective contributions to the mean are 3 and 5. 3=0. particularly if the interaction effect is very large. Transforming the variable by taking the log of each mean will restore additivity. The third line in each cell gives the logarithm of the expected value.30. there is a simple remedy. the estimate of the experimental error will be artificially large. This assumption of no interaction in a twoway ANOVA is referred to as the assumption of additivity of the main effects. Let us assume that the population mean is =0. 1=0. the expected values are quite different. however. when we use ij as estimates of the true experimental error. This is one form of nonadditivity. Table 6.00 3= +3 4 3 0.10 Thus. Example: A significant interaction term will result if the effect of the two factors A and B on the response variable Y is multiplicative rather than additive. If this assumption is violated. assuming multiplicative relations.70 2= +2 3 2 0.48 8 15 1. If this SS is embedded in the SSE. the product of 3 and 5.30 7 10 1. the increments are strictly additive again (1=0.70). we are assuming that i*j = 0. For treatment A3B2. the expected value is 15. as in the case of an RCBD with one e. 1=0.’s subjected to level 1 of factor A and level 1 of factor B should be 2 (1+1) by the conventional additive model. all Ftests will be very inefficient and possibly misleading. the interaction SS will be large due to the nonadditivity of the treatment effects. Similarly. 2=0.u. thereby making all F tests artificially insensitive.6.
g. you can think of the error term as now containing two separate components: 20 18 16 ij RANDOMij B*T Interaction Effects While the first component is random and will not affect the underlying linear correlation seen above. with error and B*T) this case.. 1. the df and the variation assigned to the interaction are relegated to the error term. Here's the logic behind the test: To begin.. the second component is nonrandom and will cause 14 12 10 10 12 14 16 Predicted 18 20 11 . Predicted (RCBD. Predicted (RCBD. Under such circumstances. if ij 0 ). the predicted value of each individual is given by: Observed vs. no error) pred ij i j In looking at these two equations. 4. interactions) in datasets that lack the degrees of freedom necessary to include such effects (i. Predicted Values (RCBD. with error) 20 18 Observed. it will not systematically compromise its underlying linear nature.e.6.g. when you have only 1 replication per block*treatment combination)? In Observed vs. If the errors in the experiment are in fact random and independent (criteria of the ANOVA and something achieved by proper randomization from the outset).e. Block * Treatment) but lack the degrees of freedom necessary to include it in the linear model (e. while random error may decrease the overall strength of correlation. if we had no error in our experiment (i. the observed data would exactly match its predicted values and a correlation plot of the two would yield a perfect line with slope = 1: O bserved… … 20 18 16 14 12 10 10 12 14 16 Predicted 18 20 Now let's introduce some error. 16 14 12 As this plot shows.e. the first thing to notice is that. as indicated in the next plot: Observed vs.11 6. But what happens when you have an interaction (e. then ij will be a random variable that causes no systematic deviation from this linear relationship. 10 10 12 14 16 Predicted 18 20 Observed. each observation is characterized as: y ij i j ij Therefore. recall that under our linear model. interactions) directly in the model. Tukey’s test for nonadditivity John Tukey devised a very clever method of testing for significant nonadditive effects (i.
e. Why the squares? Because. Run. the observed vs.24502195 0. Input Sex_Est $ @@. one tests for a quadratic effect.41880342 F Value 0. Output. Model Gain = Ranch Sex_Est Pred*Pred.41880342 Mean Square 0.01 0. Cards. which is what Tukey's 1df test is. Proc GLM. Model Gain = Ranch Sex_Est. Class Sex_Est Ranch. predicated correlation will become detectably nonlinear. Seen in this light. So. to test if a relationship is linear. Do Ranch = 1 to 4. if the observed and predicted values obey a linear relationship. independent error.9927 0.e. Input Gain @@. interaction) effects] becomes a simple test for linear regression. nonlinear) trend is unmistakable. It is a regression of the observed values with the squares of the predicted values.73506585 0. Output from the 2nd Proc GLM (the Tukey 1 df test): Source Ranch Sex_Est Pred*Pred DF 3 3 1 Type III SS 0. our test for unaccountedfor nonadditivity [significant nonadditive (i.12 systematic deviations from linearity. This test is easily implemented using SAS: Data Lambs.03 0. The plot on the following page illustrates the deviation from linearity that results when significant multiplicative effects (one kind of nonadditive effect) cannot be accommodated by the model.6. Output out = LambsPR p = Pred r = Res.29808726 3. Class Sex_Est Ranch. and if it is significant concludes that the relationship is not linear. * This is the Tukey 1 df test. Quit. not to mention making your F tests much less sensitive. End. F0 47 52 62 51 M0 50 54 67 57 F3 57 53 69 57 M3 54 65 74 59 . as mentioned before when talking about contrasts for trends.41 Pr > F 0. The quadratic (i.5395 NS 12 . (as opposed to a higher power relationship). thereby violating the ANOVA assumption of random and independent error. Indeed.9981 0. then the nonrandom Interaction Effects buried in the error term are sufficiently small to uphold our assumption of random. Proc GLM. if this interaction component is too large.09936242 3.
5 Yield of penicillin from four different protocols (A – D). Diagnostic checking of the Model Discrepancies of many different kinds between the tentative model and the observed data can be detected by studying residuals. Table 6. are the quantities remaining after the systematic contributions associated with the assumed model (in this case treatments and blocks) are removed (See ST&D 213214). the block*treatment interaction can be tested directly in an exploratory model.05). Blocks are different stocks of an important reagent. 6. 4. The numbers below each observation (O) are the predicted values (P = Grand Mean + Treatment effect + Block effect) and the residuals (R). we fail to reject the null hypothesis of additivity and we are justified in using the MSE as a valid estimate of the true experimental error. These residuals. 2. Treatment Block Stock 1 Stock 2 Stock 3 Stock 4 Stock 5 Treatment mean Treatment effect A O: 89 P: 90 R: 1 O: 84 P: 81 R: 3 O: 81 P: 83 R: 2 O: 87 P: 86 R: 1 O: 79 P: 80 R: 1 84 Block D O: 94 P: 92 R: 2 O: 79 P: 83 R: 4 O: 85 P: 85 R: 0 O: 84 P: 88 R: 4 O: 88 P: 82 R: 6 86 Block Effect +6 3 1 2 4 B O: 88 P: 91 R: 3 O: 77 P: 82 R: 5 O: 87 P: 84 R: 3 O: 92 P: 87 R: 5 O: 81 P: 81 R: 0 85 C O: 97 P: 95 R: 2 O: 92 P: 86 R: 6 O: 87 P: 88 R: 1 O: 89 P: 91 R: 2 O: 80 P: 85 R: 5 89 Mean 92 83 85 88 82 Mean=86 2 1 3 0 SAS program This experiment. The SAS code for such an analysis: 13 . in addition to testing for normality and variance homogeneity of residuals. therefore.6. Therefore. Please note: This test is necessary ONLY when there is one observation per blocktreatment combination. has one replication per blocktreatment combination. the third value in each cell in the table below.5395 > 0. organized as an RCBD.13 The Tukey test is NS (p = 0. If there are two or more replications per blocktreatment combination. one must also test for nonadditivity of block and treatment effects.
Model Yield = Block Trtmt Pred*Pred. * Testing for nonadditivity. Proc GLM Data = Penicillin. Do Trtmt = 1 to 4. variance homogeneity. Cards. Proc GLM Data = Penicillin.28 0. Output out = PenPR p = Pred r = Res. and additivity: Tests for Normality Test ShapiroWilk StatisticW 0.14 Data Penicillin.2 12618.4 788.8367 0. Var Res. Output. This dataset meets all assumptions: normality. Do Block = 1 to 4. * Testing for normality of residuals.39 Pr > F 0.79 Pr > F 0.42271508 26.26814524 26. End. Class Trtmt. The OUT option after MODEL creates a new data set. Input Yield @@.43071939 9. that includes the original variables plus the predicted (‘Pred’) and residual (‘Res’) variables.8 Mean Square 307. residual values. * Testing for variance homogeneity (1 way ANOVA).29215818 28. Proc GLM Data = PenPR.3901 NS 14 .6.46875000 F Value 0.8365 0.46875000 Mean Square 9.7 Source Trtmt Error DF 3 16 F Value 0. * Generating a plot of predicted vs. Run.6994 NS Levene's Test for Homogeneity of Yield Variance ANOVA of Squared Deviations from Group Means Sum of Squares 922. Model Yield = Trtmt. Means Trtmt / hovtest = Levene. Plot Res*Pred = Trtmt. named ‘PenPR’ in this example. End. Class Block Trtmt. Quit.7620 NS Tukey's 1 df test for nonadditivity Source Block Trtmt Pred*Pred DF 3 3 1 Type III SS 28. Proc Univariate Data = PenPR normal.28 0. 89 88 97 94 84 77 92 79 81 87 87 85 87 92 89 84 79 81 80 88 . Class Block Trtmt.967406 p ValuePr < W 0. Proc Plot Data = PenPR. Model Yield = Block Trtmt.
and the characteristics of those patterns can provide information as to what strategies (e. For example. the plot of the residuals versus the predicted values presents a funnellike appearance. 15 . in some cases. As different assumptions are violated. consider the plot of predicted vs.g. predicted values As demonstrated in the above example. and a nonsignificant Tukey’s test for nonadditivity. the homogeneous variances of the residuals among treatments. This sort of pattern suggests multiplicative block and treatment effects that might be eliminated by a suitable transformation of the response variable. the sequence in which the data was collected. residual values: In this example. increasing variation with time as the operators get tired). when the assumptions of the model are met. Another useful plot to consider is the scatterplot of residuals vs. data transformations) should be pursued.6. This observation parallels the normal distribution of the residuals.3 The plot of residual vs. Such a plot can reveal patterns of systematic variation during the data collection (e.g. This indicates that the variance increases as the value of the response increases (a situation that is common when the variance is a constant percentage of the mean). the plot of the residuals versus the predicted values will show a curvilinear relationship with positive residuals for low and high values of Y and negative residuals for intermediate values. patterns will begin to emerge. no particular pattern will be seen in the scatterplot of residual vs. no particular pattern is observed in the residuals.15 Finally.4. predicted values. In other cases. 6.
Test h = Sex_Est e = Animal(Ranch*Sex_Est). As with all experimental units. Class Ranch Sex_Est Animal.e. Contrast 'interaction' Animal(Ranch*Sex_Est).5 Example of nesting within an RCBD The following dataset was created assuming that each sheep was weighed two separate times at the end of the experiment (i.e. the Ranch (i. f0 1 1 46 f0 2 1 51 f0 3 1 61 f0 m0 1 1 49 m0 2 1 53 m0 3 1 66 m0 f3 1 1 56 f3 2 1 52 f3 3 1 68 f3 m3 1 1 53 m3 2 1 64 m3 3 1 73 m3 4 4 4 4 1 1 1 1 50 56 56 58 f0 1 1 48 f0 2 1 53 f0 3 1 63 f0 4 1 52 m0 1 1 51 m0 2 1 55 m0 3 1 68 m0 4 1 58 f3 1 1 58 f3 2 1 54 f3 3 1 70 f3 4 1 58 m3 1 1 55 m3 2 1 66 m3 3 1 75 m3 4 1 60 . Proc Varcomp Method = Type1. hence Animal(Ranch*Sex_Est) is declared as a random variable. Class Ranch Sex_Est Animal. Run. the experimental unit (Animal) must appear in the model. 16 . Cards. Animals are random samples from larger populations. *In nested models. block) and the level of Sex_Est (i. Model Gain = Ranch Sex_Est Animal(Ranch*Sex_Est).e. specify mean comparisons. two measurements (subsamples) were taken on each experimental unit). Quit. Now that there are subsamples. *Below is a Tukey test with the incorrect error for comparison.6. Random Animal(Ranch*Sex_Est).16 6. Hence the syntax: Animal(Ranch*Sex_Est) The ID "Animal" only has meaning within specific BlockTreatment combinations. Contrast 'estrogen' Animal(Ranch*Sex_Est). the label "Animal" is simply an ID. The subsample values were created such that their averages yield the values of each experimental unit in the original dataset: Data Lambs. Input Sex_Est $ Ranch Animal Gain @@. Model Gain = Ranch Sex_Est Animal(Ranch*Sex_Est). Means Sex_Est / Tukey e the correct error term in all contrasts and Sex_Est Sex_Est Sex_Est 1 1 1 1 1 / e = 1 1 1 / e = 1 / e = 1 1 1 = Animal(Ranch*Sex_Est). Contrast 'sex' Animal(Ranch*Sex_Est). Means Sex_Est / Tukey. Proc GLM Data = Lambs Order = Data. treatment) must be specified. To specify a particular animal in the experiment.
000000 Mean Square 384.000 N 8 8 8 8 6.0000000 288.2) using the average of the two subsamples) Correct contrasts Contrast sex estrogen interaction DF 1 1 1 Contrast SS 128.17 As in the CRD. whether the overall F test or subsequent contrasts or mean comparisons.51 0. If the error term is not specified.0000 NS Correct Tukey means separation Minimum Significant Difference Tukey Grouping B B B A A A Mean 63.0000000 F Value 8.0000000 Mean Square 138.0002 Note that 8. it is important to note that the error term to test differences among treatments is the variance among experimental units (MSEE).78 Pr > F <.000000 1740. Output (compare to output of the original experiment with no subsamples) Overall ANOVA Sum of Mean Square 113.000000 32.0000 53.2.000000 138.023 Sex_Est m3 f3 m0 f0 Incorrect Tukey means separation Minimum Significant Difference Tukey Grouping A B B C Type 1 Analysis of Variance Mean 63.000 53.33 7.0000000 288.866667 2.000 57.6666667 F Value 8.0000 57.0046 ** DF 3 3 9 Type III SS 1152. SAS will test every hypothesis using the variance among subsamples (MSSE).000 59.91 is exactly the same as in the previous analysis (Topic 6.0000000 0.23 18.00 Pr > F 0.0000 59. Table 6.000000 416.0185 * 0.555556 F Value 192.0001 <.0020 ** 1.91 Pr > F 0.666667 15.0000 N 8 8 8 8 Source Expected Mean Square Ranch Var(Error) + 2 Var(Animal(Ranch*Sex_Es)) + 8 Var(Ranch) Sex_Est Var(Error) + 2 Var(Animal(Ranch*Sex_Es)) + 8 Var(Sex_Est) Animal(Ranch*Sex_Es) Var(Error) + 2 Var(Animal(Ranch*Sex_Es)) 17 .0000000 0.0001 0.6.000000 F Value 56.93 Pr > F <.0000000 Mean Square 128.00 69.000000 Source Model Error Corrected Total DF 15 16 31 Squares 1708. Thus Animal(Ranch*Sex_Est) must be declared as the error term for each hypothesis tested regarding treatment means.1563 Sex_Est m3 f3 m0 f0 2.000000 140.5.0001 Partitioning of model effects (automatic wrong F tests for treatment and block) Source Ranch Sex_Est Animal(Ranch*Sex_Es) Correct F test for treatment Tests of Hypotheses Using the Type III MS for Animal(Ranch*Sex_Es) as an Error Term Source Sex_Est DF 3 Type III SS 416.
18 .05556 15. this variance component information can be used together with cost information to determine the optimum allocation of resources among subsamples and experimental units.8 Var(Error) The only reason to analyze this dataset as a nested RCBD is to calculate these variance components.18 Error Type 1 Estimates Variance Component Var(Ranch) Var(Sex_Est) Var(Animal(Ranch*Sex_Es)) Var(Error) Estimate 46. *Remember: In nested models specify the correct error term in all mean comparisons.00000 % 65.38889 6.77778 2.6 21.6. If you do not need these variance components. simply average the subsamples for each experimental unit and analyze it as a simple RCBD.9 9.7 2. As with the CRD.
This action might not be possible to undo. Are you sure you want to continue?