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:
\[ \mu_{i.} = \frac{1}{b} \sum_j \mu_{ij} \]
The main effect of Factor A:
\[ \alpha_i = \mu_{i.} - \mu_{..} \]
where:
\[ \mu_{..} = \frac{1}{ab} \sum_i \sum_j \mu_{ij} = \frac{1}{a} \sum_i \mu_{i.} \]
with the constraint:
\[ \sum_i \alpha_i = 0 \]
The nested effect of Factor B within A is denoted as \(\beta_{j(i)}\), where:
\[ \begin{aligned} \beta_{j(i)} &= \mu_{ij} - \mu_{i.} \\ &= \mu_{ij} - \alpha_i - \mu_{..} \end{aligned} \]
with the restriction:
\[ \sum_j \beta_{j(i)} = 0, \quad \forall i = 1, \dots, a \]
Since \(\beta_{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:
\[ \mu_{ij} = \mu_{..} + \alpha_i + \beta_{j(i)} \]
or equivalently:
\[ \mu_{ij} = \mu_{..} + (\mu_{i.} - \mu_{..}) + (\mu_{ij} - \mu_{i.}) \]
The statistical model for a two-factor nested design is:
\[ Y_{ijk} = \mu_{..} + \alpha_i + \beta_{j(i)} + \epsilon_{ijk} \]
where:
\(Y_{ijk}\) = response for the \(k\)-th observation when:
Factor A is at level \(i\).
Factor B (nested within A) is at level \(j\).
\(\mu_{..}\) = overall mean.
\(\alpha_i\) = main effect of Factor A (subject to: \(\sum_i \alpha_i = 0\)).
\(\beta_{j(i)}\) = nested effect of Factor B within A (subject to: \(\sum_j \beta_{j(i)} = 0\) for all \(i\)).
\(\epsilon_{ijk} \sim iid N(0, \sigma^2)\) = random error.
Thus, the expected value and variance are:
\[ \begin{aligned} E(Y_{ijk}) &= \mu_{..} + \alpha_i + \beta_{j(i)} \\ var(Y_{ijk}) &= \sigma^2 \end{aligned} \]
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 |
---|---|
\(\mu_{..}\) | \(\bar{Y}_{...}\) |
\(\alpha_i\) | \(\bar{Y}_{i..} - \bar{Y}_{...}\) |
\(\beta_{j(i)}\) | \(\bar{Y}_{ij.} - \bar{Y}_{i..}\) |
\(\hat{Y}_{ijk}\) | \(\bar{Y}_{ij.}\) |
The residual error:
\[ e_{ijk} = Y_{ijk} - \bar{Y}_{ij.} \]
The total sum of squares (SSTO) is partitioned as:
\[ SSTO = SSA + SSB(A) + SSE \]
where:
\[ \begin{aligned} \sum_i \sum_j \sum_k (Y_{ijk} - \bar{Y}_{...})^2 &= bn \sum_i (\bar{Y}_{i..} - \bar{Y}_{...})^2 + n \sum_i \sum_j (\bar{Y}_{ij.} - \bar{Y}_{i..})^2 \\ &+ \sum_i \sum_j \sum_k (Y_{ijk} - \bar{Y}_{ij.})^2 \end{aligned} \]
24.4.1.1 ANOVA Table for Nested Designs
Source of Variation | SS | df | MS | E(MS) |
---|---|---|---|---|
Factor A | \(SSA\) | \(a-1\) | \(MSA\) | \(\sigma^2 + bn \frac{\sum \alpha_i^2}{a-1}\) |
Factor B (A) | \(SSB(A)\) | \(a(b-1)\) | \(MSB(A)\) | \(\sigma^2 + n \frac{\sum \beta_{j(i)}^2}{a(b-1)}\) |
Error | \(SSE\) | \(ab(n-1)\) | \(MSE\) | \(\sigma^2\) |
Total | \(SSTO\) | \(abn -1\) |
24.4.1.2 Tests For Factor Effects
Factor A:
\[ F = \frac{MSA}{MSB(A)} \sim F_{(a-1, a(b-1))} \]
Reject \(H_0\) if \(F > f_{(1-\alpha; a-1, a(b-1))}\).
Factor B within A:
\[ F = \frac{MSB(A)}{MSE} \sim F_{(a(b-1), ab(n-1))} \]
Reject \(H_0\) if \(F > f_{(1-\alpha; a(b-1), ab(n-1))}\).
24.4.1.3 Testing Factor Effect Contrasts
A contrast is a linear combination of factor level means:
\[ L = \sum c_i \mu_i, \quad \text{where} \quad \sum c_i = 0 \]
The estimated contrast:
\[ \hat{L} = \sum c_i \bar{Y}_{i..} \]
The confidence interval for \(L\):
\[ \hat{L} \pm t_{(1-\alpha/2; df)} s(\hat{L}) \]
where:
\[ s^2(\hat{L}) = \sum c_i^2 s^2(\bar{Y}_{i..}), \quad \text{where} \quad s^2(\bar{Y}_{i..}) = \frac{MSE}{bn}, \quad df = 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.
\[ \begin{aligned} Y_{ijk} &= \mu_{..} + \alpha_i + \beta_{j(i)} + \epsilon_{ijk} \\ \sum_{i=1}^2 \alpha_i &= 0, \quad \sum_{j=1}^3 \beta_{j(1)} = 0, \quad \sum_{j=1}^2 \beta_{j(2)} = 0 \end{aligned} \]
where:
Factor A: \(i = 1, 2\).
Factor B (nested in A): \(j = 1, \dots, b_i\).
Observations: \(k = 1, \dots, n_{ij}\).
Example case:
\(b_1 = 3, b_2 = 2\) (Factor B has different levels for A).
\(n_{11} = n_{13} = 2, n_{12} = 1, n_{21} = n_{22} = 2\).
Parameters: \(\alpha_1, \beta_{1(1)}, \beta_{2(1)}, \beta_{1(2)}\).
Constraints:
\[ \alpha_2 = -\alpha_1, \quad \beta_{3(1)} = -\beta_{1(1)} - \beta_{2(1)}, \quad \beta_{2(2)} = -\beta_{1(2)} \]
The unbalanced design can be modeled using indicator variables:
Factor A (School Level): \[ X_1 = \begin{cases} 1 & \text{if observation from school 1} \\ -1 & \text{if observation from school 2} \end{cases} \]
Factor B (Instructor within School 1): \[ X_2 = \begin{cases} 1 & \text{if observation from instructor 1 in school 1} \\ -1 & \text{if observation from instructor 3 in school 1} \\ 0 & \text{otherwise} \end{cases} \]
Factor B (Instructor within School 1): \[ X_3 = \begin{cases} 1 & \text{if observation from instructor 2 in school 1} \\ -1 & \text{if observation from instructor 3 in school 1} \\ 0 & \text{otherwise} \end{cases} \]
Factor B (Instructor within School 1): \[ X_4 = \begin{cases} 1 & \text{if observation from instructor 1 in school 1} \\ -1 & \text{if observation from instructor 2 in school 1} \\ 0 & \text{otherwise} \end{cases} \]
Using these indicator variables, the full regression model is:
\[ Y_{ijk} = \mu_{..} + \alpha_1 X_{ijk1} + \beta_{1(1)} X_{ijk2} + \beta_{2(1)} X_{ijk3} + \beta_{1(2)} X_{ijk4} + \epsilon_{ijk} \]
where \(X_1, X_2, X_3, X_4\) represent different factor effects.
24.4.3 Random Factor Effects
If factors are random:
\[ \begin{aligned} \alpha_1 &\sim iid N(0, \sigma^2_\alpha) \\ \beta_{j(i)} &\sim iid N(0, \sigma^2_\beta) \end{aligned} \]
Expected Mean Squares for Random Effects
Mean Square | Expected Mean Squares (A Fixed, B Random) | Expected Mean Squares (A Random, B Random) |
---|---|---|
MSA | \(\sigma^2 + n \sigma^2_\beta + bn \frac{\sum \alpha_i^2}{a-1}\) | \(\sigma^2 + bn \sigma^2_{\alpha} + n \sigma^2_\beta\) |
MSB(A) | \(\sigma^2 + n \sigma^2_\beta\) | \(\sigma^2 + n \sigma^2_\beta\) |
MSE | \(\sigma^2\) | \(\sigma^2\) |
F-Tests for Factor Effects
Factor | F-Test (A Fixed, B Random) | F-Test (A Random, B Random) |
---|---|---|
Factor A | \(\frac{MSA}{MSB(A)}\) | \(\frac{MSA}{MSB(A)}\) |
Factor B(A) | \(\frac{MSB(A)}{MSE}\) | \(\frac{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.