24.4 Nested Designs
A nested design occurs when one factor is entirely contained within another. This differs from a crossed design, where all levels of one factor are present across all levels of another factor.
- Crossed Design: If Factor B is crossed with Factor A, then each level of Factor B appears at every level of Factor A.
- Nested Design: If Factor B is nested within Factor A, then each level of Factor B is unique to a particular level of Factor A.
Thus, if Factor B is nested within Factor A:
Level 1 of B within A = 1 has nothing in common with
Level 1 of B within A = 2.
Types of Factors
- Classification Factors: Factors that cannot be manipulated (e.g., geographical regions, subjects).
- Experimental Factors: Factors that are randomly assigned in an experiment.
24.4.1 Two-Factor Nested Design
We consider a nested two-factor model where:
Factor A has a levels.
Factor B is nested within Factor A, with b levels per level of A.
Both factors are fixed.
All treatment means are equally important.
The mean response at level i of Factor A:
μi.=1b∑jμij
The main effect of Factor A:
αi=μi.−μ..
where:
μ..=1ab∑i∑jμij=1a∑iμi.
with the constraint:
∑iαi=0
The nested effect of Factor B within A is denoted as βj(i), where:
βj(i)=μij−μi.=μij−αi−μ..
with the restriction:
∑jβj(i)=0,∀i=1,…,a
Since βj(i) is the specific effect of the j-th level of factor B nested within the i-th level of factor A, the full model can be written as:
μij=μ..+αi+βj(i)
or equivalently:
μij=μ..+(μi.−μ..)+(μij−μi.)
The statistical model for a two-factor nested design is:
Yijk=μ..+αi+βj(i)+ϵijk
where:
Yijk = response for the k-th observation when:
Factor A is at level i.
Factor B (nested within A) is at level j.
μ.. = overall mean.
αi = main effect of Factor A (subject to: ∑iαi=0).
βj(i) = nested effect of Factor B within A (subject to: ∑jβj(i)=0 for all i).
ϵijk∼iidN(0,σ2) = random error.
Thus, the expected value and variance are:
E(Yijk)=μ..+αi+βj(i)var(Yijk)=σ2
Note: There is no interaction term in a nested model, because Factor B levels are unique within each level of A.
The least squares and maximum likelihood estimates:
Parameter | Estimator |
---|---|
μ.. | ˉY... |
αi | ˉYi..−ˉY... |
βj(i) | ˉYij.−ˉYi.. |
ˆYijk | ˉYij. |
The residual error:
eijk=Yijk−ˉYij.
The total sum of squares (SSTO) is partitioned as:
SSTO=SSA+SSB(A)+SSE
where:
∑i∑j∑k(Yijk−ˉY...)2=bn∑i(ˉYi..−ˉY...)2+n∑i∑j(ˉYij.−ˉYi..)2+∑i∑j∑k(Yijk−ˉYij.)2
24.4.1.1 ANOVA Table for Nested Designs
Source of Variation | SS | df | MS | E(MS) |
---|---|---|---|---|
Factor A | SSA | a−1 | MSA | σ2+bn∑α2ia−1 |
Factor B (A) | SSB(A) | a(b−1) | MSB(A) | σ2+n∑β2j(i)a(b−1) |
Error | SSE | ab(n−1) | MSE | σ2 |
Total | SSTO | abn−1 |
24.4.1.2 Tests For Factor Effects
Factor A:
F=MSAMSB(A)∼F(a−1,a(b−1))
Reject H0 if F>f(1−α;a−1,a(b−1)).
Factor B within A:
F=MSB(A)MSE∼F(a(b−1),ab(n−1))
Reject H0 if F>f(1−α;a(b−1),ab(n−1)).
24.4.2 Unbalanced Nested Two-Factor Designs
When Factor B has different levels for different levels of Factor A, the design is unbalanced.
Yijk=μ..+αi+βj(i)+ϵijk2∑i=1αi=0,3∑j=1βj(1)=0,2∑j=1βj(2)=0
where:
Factor A: i=1,2.
Factor B (nested in A): j=1,…,bi.
Observations: k=1,…,nij.
Example case:
b1=3,b2=2 (Factor B has different levels for A).
n11=n13=2,n12=1,n21=n22=2.
Parameters: α1,β1(1),β2(1),β1(2).
Constraints:
α2=−α1,β3(1)=−β1(1)−β2(1),β2(2)=−β1(2)
The unbalanced design can be modeled using indicator variables:
Factor A (School Level): X1={1if observation from school 1−1if observation from school 2
Factor B (Instructor within School 1): X2={1if observation from instructor 1 in school 1−1if observation from instructor 3 in school 10otherwise
Factor B (Instructor within School 1): X3={1if observation from instructor 2 in school 1−1if observation from instructor 3 in school 10otherwise
Factor B (Instructor within School 1): X4={1if observation from instructor 1 in school 1−1if observation from instructor 2 in school 10otherwise
Using these indicator variables, the full regression model is:
Yijk=μ..+α1Xijk1+β1(1)Xijk2+β2(1)Xijk3+β1(2)Xijk4+ϵijk
where X1,X2,X3,X4 represent different factor effects.
24.4.3 Random Factor Effects
If factors are random:
α1∼iidN(0,σ2α)βj(i)∼iidN(0,σ2β)
Expected Mean Squares for Random Effects
Mean Square | Expected Mean Squares (A Fixed, B Random) | Expected Mean Squares (A Random, B Random) |
---|---|---|
MSA | σ2+nσ2β+bn∑α2ia−1 | σ2+bnσ2α+nσ2β |
MSB(A) | σ2+nσ2β | σ2+nσ2β |
MSE | σ2 | σ2 |
F-Tests for Factor Effects
Factor | F-Test (A Fixed, B Random) | F-Test (A Random, B Random) |
---|---|---|
Factor A | MSAMSB(A) | MSAMSB(A) |
Factor B(A) | MSB(A)MSE | MSB(A)MSE |
Another way to increase precision in treatment comparisons is by adjusting for covariates using regression models. This is called Analysis of Covariance (ANCOVA).
Why use ANCOVA?
Reduces variability by accounting for covariate effects.
Increases statistical power by removing nuisance variation.
Combines ANOVA and regression for more precise comparisons.