2. • Factors A (with a levels) and B (b levels)
• Total of ab treatment combinations
• The same number of replications per cell, n
Nested Design
A1
1 2 3
1
2
.
n
1
2
.
n
1
2
.
n
A2
1 2 3
1
2
.
n
1
2
.
n
1
2
.
n
A3
1 2 3
1
2
.
n
1
2
.
n
1
2
.
n
Factor B
Replications
3. • Factor B Level 1 in A1 is completely different from Factor B Level 1 in A2 and also in A3
• The levels of Factor B are nested within Factor A and there are n replicates within each
combination.
Nested Design
A1
1 2 3
1
2
.
n
1
2
.
n
1
2
.
n
A2
1 2 3
1
2
.
n
1
2
.
n
1
2
.
n
A3
1 2 3
1
2
.
n
1
2
.
n
1
2
.
n
Factor B
Replications
4. Example
Hospital 1
W1 W2 W3
1
2
.
n
1
2
.
n
1
2
.
n
W1 W2 W3
1
2
.
n
1
2
.
n
1
2
.
n
W1 W2 W3
1
2
.
n
1
2
.
n
1
2
.
n
Wards
Hospital 2 Hospital 3
Patients
Beds
Locations
Times
Ward 1 in Hospital 1 is not the same level of the Ward factor as Ward 1 in Hospital 2
Ward – Random Effect
Hospital – a random effect or fixed effect depending on contect
5. Example
Area 1
V1 V2 V3
1
2
.
n
1
2
.
n
1
2
.
n
V1 V2 V3
1
2
.
n
1
2
.
n
1
2
.
n
V1 V2 V3
1
2
.
n
1
2
.
n
1
2
.
n
Village
Area 2 Area 3
Locations
Times
Person
Household
Village 1 in Area 1 is not the same level of the Village factor as Village 1 in Area 2
Village – Random Effect
Area – could be a Fixed Effect or Random Effect depending on context
6. • The levels of Factor B are completely crossed with Factor A
- n replicates within each combination
• Factor B Level 1 in A1 is exactly the same level as Factor B Level 1 in A2
- And all other levels of A
Two Factor Design Data Layout
Factor B Factor A
1 a
1 X111,X112,…, X11n Xa11,Xa12,…, Xa1n
2 X121,X122,…, X12n Xa21,Xa22,…, Xa2n
Xij1,Xij2,…, Xijn
b X1b1,X1b2,…, X1bn Xab1,Xab2,…, Xabn
7. Nested Design - degrees of freedom
A1
1 2 3
𝑋11
A2
1 2 3
A3
1 2 3
Factor B
• Combined factor has 𝑎𝑏 levels
• 𝑎𝑏 − 1 degrees of freedom between the means
• 𝑎 − 1 df associated with differences among the levels of A
• 𝑎 𝑏 − 1 df associated with differences among B within A
• 𝑛 replications within each combination used to estimate error
• 𝑎𝑏 𝑛 − 1 df associated with the Error
𝐴1𝐵1
𝑋12
𝐴1𝐵2
𝑋13
𝐴1𝐵3
𝑋21
𝐴2𝐵1
𝑋22
𝐴2𝐵2
𝑋23
𝐴2𝐵3
𝑋31
𝐴3𝐵1
𝑋32
𝐴3𝐵2
𝑋33
𝐴3𝐵3
Combined
levels
Means
Complete Factor
8. Effects Model
𝑋𝑖𝑗𝑘 = 𝜇 + 𝜏𝑖𝑗 + 𝜖𝑖𝑗𝑘 = 𝜇 + 𝛼𝑖 + 𝛽𝑗 𝑖 + 𝜖𝑖𝑗𝑘
𝑖 = 1,2, … , 𝑎
𝑗 = 1,2, … , 𝑏
𝑘 = 1,2, … , 𝑛
The combined factor model is
essentially the same model as for a
Completely Randomised Design
Differences among treatments plus
an error term 𝜖𝑖𝑗𝑘
𝛼𝑖 main effect of level i of factor A
𝛽𝑗 𝑖 effect of level j of factor B nested within level i of factor A
Treatment Effects written as a factorial
structure.
Effect of A
Additional effect of B nested within A
9. • Factor B – the nested factor - generally defines a random effect,
- e.g., randomly selected subjects or units
- Assume 𝛽𝑗 𝑖 ~𝑁 0, 𝜎𝛽
2
independently of the errors, 𝜖𝑖𝑗𝑘.
• Factor A
- may be either a fixed effect with 𝛼𝑖 = 0 as constraint
- or random effect with 𝛼𝑖~𝑁 0, 𝜎𝛼
2
assumed.
• Therefore, ND based experiments will be mostly mixed effects (type III) or random effects (type
II) models
• Errors, 𝜖𝑖𝑗𝑘, normally distributed and independent with constant variance; additive terms
Assumptions
10. Hypotheses
• Fixed Effect
• Factor A
• 𝐻0: 𝛼𝑖 = 0, for all i
• 𝐻1: 𝛼𝑖 ≠ 0, for at least one i
• Factor B
• 𝐻0: 𝛽𝑗 𝑖 = 0, for all i, j
• 𝐻1: 𝛽𝑗 𝑖 ≠ 0, for at least one i,j
• Random Effect
•
• Factor A
• 𝐻0: 𝜎𝛼
2 = 0
• 𝐻1: 𝜎𝛼
2
> 0
• Factor B
• 𝐻0: 𝜎𝛽
2
= 0
• 𝐻1: 𝜎𝛽
2
> 0
11. Source df SS MS
Factor A 𝑎 − 1 SSA
𝑀𝑆𝐴 =
𝑆𝑆𝐴
𝑎 − 1
Factor B
(within A)
𝑎 𝑏 − 1 SSB 𝐴
𝑀𝑆𝐵 𝐴 =
SSB 𝐴
𝑎 𝑏 − 1
Error
(Residual)
𝑎𝑏 𝑛 − 1 SSE = 𝑆𝑆𝑇 − 𝑆𝑆𝐴 − SSB 𝐴
𝑀𝑆𝐸 =
𝑆𝑆𝐸
𝑎𝑏 𝑛 − 1
Total 𝑎𝑏𝑛 − 1 𝑆𝑆𝑇
Anova for 2 factor Nested model
12. Source df MS F EMS
Factor A 𝑎 − 1
𝑀𝑆𝐴 =
𝑆𝑆𝐴
𝑎 − 1
𝑀𝑆𝐴
𝑀𝑆𝐵 𝐴
𝜎2
+ 𝑛𝜎𝛽
2
+ 𝑏𝑛𝜎𝛼
2
Factor B
(within A)
𝑎 𝑏 − 1
𝑀𝑆𝐵 𝐴 =
SSB 𝐴
𝑎 𝑏 − 1
𝑀𝑆𝐵 𝐴
𝑀𝑆𝐸
𝜎2 + 𝑛𝜎𝛽
2
Error
(Residual)
𝑎𝑏 𝑛 − 1
𝑀𝑆𝐸 =
𝑆𝑆𝐸
𝑎𝑏 𝑛 − 1
𝜎2
Total 𝑎𝑏𝑛 − 1
F tests B Random Effect
Factor A can be Fixed or Random
13. Source df MS F EMS
Factor A 𝑎 − 1
𝑀𝑆𝐴 =
𝑆𝑆𝐴
𝑎 − 1
𝑀𝑆𝐴
𝑀𝑆𝐸
𝜎2 + 𝑏𝑛𝜎𝛼
2
Factor B
(within A)
𝑎 𝑏 − 1
𝑀𝑆𝐵 𝐴 =
SSB 𝐴
𝑎 𝑏 − 1
𝑀𝑆𝐵 𝐴
𝑀𝑆𝐸
𝜎2
+ 𝑛𝜎𝛽
2
Error
(Residual)
𝑎𝑏 𝑛 − 1
𝑀𝑆𝐸 =
𝑆𝑆𝐸
𝑎𝑏 𝑛 − 1
𝜎2
Total 𝑎𝑏𝑛 − 1
F tests B Fixed Effect
𝜎𝛽
2
=
𝑖𝑗
𝛽𝑗 𝑖
2
Factor A can be Fixed or Random