Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
17.2 Note: This model is often called the cell means model. This model has ab 1 degrees of freedom and the
error degrees of freedom are i j (nij 1). However, such an analysis is not of much interest since we
have not included any structure on the way in which the factors influence the response. One useful structure
postulates the existence of an additive structure. Write
+ (
i
) + (
j
) + (ij
i
j +
) = + i + j + ij ,
ij =
where
i
j
ij
=
=
=
=
ij
i
j +
i = 0,
i=1
b
j = 0,
j=1
a
ij =
i=1
HAB : ij = 0 i, j;
b
ij = 0.
j=1
HA : i = 0 i;
HB : j = 0 j.
17.5 Note: No interaction means that the difference between two groups i and i defined by one factor is independent of the level j of the other factor:
i
ij
i
ij
ij i j
=
=
=
i j
i
i
i
i, j
i, i , j
i, i , j
55
i
i = 0 i, i. e. averaged across levels of factor B, the average mean is
17.6 Note: HA is equivalent to
constant across levels of factor A.
17.7 Note: If HAB : ij = 0 is true, then HA is equivalent to ij i j = 0 i, i , j, i. e. the mean is constant
across levels of factor A within each level of factor B. Thus, hypotheses on main effects make most sense
if there is no interaction.
17.8 Theorem: In a balanced design (i. e. nij = r i, j), the least-squares estimates are
= Y ,
j = Yj Y ,
i = Yi Y ,
ij = Yij Yi Yj + Y.
i
SSA =
j
j
j
(Yi Y )2 = rb
(Yj Y) = ra
2
(Yj Y ) = ra
2
(Yij Yi Yj + Y )2 = r
i
i
(Yi Y )2 = rb
i
SSE
i
SSAB =
i
SSB =
(Yijk Y )2 ,
j
2
ij
2i = RSSHA RSS,
j2 = RSSHB RSS,
= RSSHAB RSS,
rb
a1
ra
b1
2
i i .
2
i i .
r
(a1)(b1)
i
2.
ij
56
17.11 Note: The above is usually summarized in an ANOVA table:
source
sum of squares
df
mean squares
test statistic
Factor A
SSA
a1
MSA /MSE
Factor B
SSB
b1
MSB /MSE
Interaction
SSAB
(a 1)(b 1)
MSAB /MSE
Error
SSE
ab(r 1)
Total
SSTOTAL
abr 1
17.12 Note: The above ANOVA table is for a fixed effects model. To calculate the correct F statistics for the hypothesis tests in 2-way ANOVA random effects and mixed effects models, we have to consider the expected
mean squares for the different factors. The expected mean squares for fixed, random, and mixed (A fixed
and B random) effects ANOVAs are shown in the table below:
source
fixed effects
random effects
mixed effects
Factor A
2 +
rb
a1
2i
2 + rb 2
2 + rAB
A
2 +
2 + rAB
Factor B
2 +
ra
b1
2
i i
2 + ra 2
2 + rAB
B
2
2 + raB
Interaction
2 +
r
(a1)(b1)
2
2 + rAB
2
2 + rAB
Error
i
2
ij
rb
a1
2i
Laboratory
Technician
(1, 1)
11
2
(1, 2)
12
(1, 3)
13
(2, 1)
21
(2, 2)
22
(2, 3)
23
If instead the same 3 technicians performed the experiment in all the labs, the factors would be crossed:
Laboratory
Technician
2
1
2
11
21
12
22
3
13
23
57
17.14 Note: The model for the nested design is ij = + i + ij , while the model for the crossed design is
ij = + i + j + ij . The nested design can be seen as an incomplete 2-way layout:
Laboratory
(1,1)
(1,2)
Technician
(1,3) (2,1)
1
2
11
12
13
(2,2)
(2,3)
22
23
21
17.15 Example: Assume we have a hospitals, b technicians per hospital, and each technician performs r replications of the experiment. The ANOVA model is
Yijk = ij + ijk
with i = 1, . . . , a; j = 1, . . . , b; k = 1, . . . , r; and ijk N (0, 2 ) independent. We write
+ (
i
) + (ij
i ) = + i + ij ,
ij =
where i is the Hospital effect, and ij is the effect of jth technician in ith hospital. In a random effects
2 ) and N (0, 2 ).
model, we assume i N (0, A
ij
B|A
2 =0
HA : A
2
HB : B|A
= 0.
and
i
SSA =
SSE
i
SSB|A =
j
j
j
j
(Yi Y)2 ,
(Yij Yi )2 = r
i
i
(Yi Y)2 = rb
i
(Yijk Y )2 ,
(Yijk Yij ) .
2
(Yij Yi )2 ,
58
17.19 Theorem: For the random effects model we have:
2
2.
+ rbA
(a) E[MSA ] = E[SSA /(a 1)] = 2 + rB|A
2 .
(b) E[MSB|A ] = E[SSAB /(a(b 1))] = 2 + rB|A
sum of squares
df
mean squares
test statistic
Factor A
SSA
a1
MSA /MSB|A
Factor B|A
SSB|A
a(b 1)
MSB|A /MSE
Error
SSE
ab(r 1)
Total
SSTOTAL
abr 1
17.22 Note: The above ANOVA table is for a random effects model. In general, by the definition of a nested
model, the nested factor is usually considered random. However, the expected mean squares can be calculated for a fixed effects model too. In the table below we summarize the expected mean squares for random,
mixed (A fixed and B random), and fixed effects nested ANOVA models.
source
random effects
mixed effects
fixed effects
Factor A
2
2
2 + rB|A
+ rbA
rb
2
2
2 + rB|A
+ a1
i i
2 +
rb
a1
Factor B|A
2
2 + rB|A
2
2 + rB|A
2 +
r
a(b1)
Error
2
i i
i
2
ij