 3. Production Process Characterization
3.2. Assumptions / Prerequisites
3.2.3. Analysis of Variance Models (ANOVA)

## Two-Way Nested ANOVA

Description Sometimes, constraints prevent us from crossing every level of one factor with every level of the other factor. In these cases we are forced into what is known as a nested layout. We say we have a nested layout when fewer than all levels of one factor occur within each level of the other factor. An example of this might be if we want to study the effects of different machines and different operators on some output characteristic, but we can't have the operators change the machines they run. In this case, each operator is not crossed with each machine but rather only runs one machine.
Model If Factor B is nested within Factor A, then a level of Factor B can only occur within one level of Factor A and there can be no interaction. This gives the following model:

$$y_{ijk} = m + a_{i} + b_{j(i)} + \epsilon_{ijk}$$

This equation indicates that each data value is the sum of a common value (grand mean), the level effect for Factor A, the level effect of Factor B nested within Factor A, and the residual.

Estimation For a nested design we typically use variance components methods to perform the analysis.  We can sweep out the common value, the Factor A effects, the Factor B within A effects and the residuals using  value-splitting techniques. Sums of squares can be calculated and summarized in an ANOVA table as shown below.
splitting example
It is important to note that with this type of layout, since each level of one factor is only present with one level of the other factor, we can't estimate interaction between the two.
ANOVA table for nested case
Source Sum of Squares DoF Mean Square F0
A $$SSA = JK\sum{(\bar{y}_{i..} - \bar{y}_{...})^2}$$ I - 1 MSA = SSA/(I - 1) MSA/MSB
B within A $$SSB = K\sum\sum{(\bar{y}_{ij.} - \bar{y}_{i..})^2}$$ I(J - 1) MSB = SSB/(I(J - 1)) MSB/MSE
Residuals $$SSE = \sum\sum\sum{(y_{ijk} - \bar{y}_{ij.})^2}$$ IJ(K - 1) MSE = SSE/(IJ(K - 1))
Corr. Total $$SST = \sum\sum\sum{(y_{ijk} - \bar{y}_{...})^2}$$ IJK - 1

$$\bar{y}_{i..} = \frac{1}{JK} \sum_{j=1}^{J}{\sum_{k=1}^{K}{y_{ijk}}}$$

$$\bar{y}_{ij.} = \frac{1}{K} \sum_{k=1}^{K}{y_{ijk}}$$

$$\bar{y}_{...} = \frac{1}{IJK} \sum_{i=1}^{I}{\sum_{j=1}^{J}{\sum_{k=1}^{K}{y_{ijk}}}}$$

The row labeled, "Corr. Total", in the ANOVA table contains the corrected total sum of squares and the associated degrees of freedom (DoF).
As with the crossed layout, we can also use CLM techniques. We still have the problem that the model is saturated and no unique solution exists. We overcome this problem by applying to the model the constraints that the two main effects sum to zero.
Testing We are testing that two main effects are zero. Again we just form a ratio (F0) of each main effect mean square to the appropriate mean-squared error term. (Note that the error term for Factor A is not MSE, but is MSB.) If the assumptions stated below are true then those ratios follow an F distribution and the test is performed by comparing the F0 ratios to values in an F table with the appropriate degrees of freedom and confidence level.
Assumptions For estimation purposes, we assume the data can be adequately modeled by the model above and that there is more than one variance component. It is assumed that the random component can be modeled with a Gaussian distribution with fixed location and spread.
Uses The two-way nested ANOVA is useful when we are constrained from combining all the levels of one factor with all of the levels of the other factor. These designs are most useful when we have what is called a random effects situation. When the levels of a factor are chosen at random rather than selected intentionally, we say we have a random effects model. An example of this is when we select lots from a production run, then select units from the lot. Here the units are nested within lots and the effect of each factor is random.
Example Let's change the two-way machining example slightly by assuming that we have five different machines making the same part and each machine has two operators, one for the day shift and one for the night shift. We take five samples from each machine for each operator to obtain the following data:

 Machine Operator Day 1 2 3 4 5 0.125 0.118 0.123 0.126 0.118 0.127 0.122 0.125 0.128 0.129 0.125 0.120 0.125 0.126 0.127 0.126 0.124 0.124 0.127 0.120 0.128 0.119 0.126 0.129 0.121 Operator Night 0.124 0.116 0.122 0.126 0.125 0.128 0.125 0.121 0.129 0.123 0.127 0.119 0.124 0.125 0.114 0.126 0.125 0.126 0.130 0.124 0.129 0.120 0.125 0.124 0.117
Analyze For analysis details see the nested two-way value splitting example. We can summarize the analysis results in an ANOVA table as follows:
 F0 Source Sum of Squares Deg. of Freedom Mean Square Machine 3.03e-4 4 7.58e-5 20.38 Operator(Machine) 1.86e-5 5 3.72e-6 0.428 Residuals 3.46e-4 40 8.70e-6 Corrected Total 6.68e-4 49
Test By dividing the mean square for Machine by the mean square for Operator within Machine, or Operator(Machine), we obtain an F0 value of 20.38 which is greater than the critical value of 5.19 for 4 and 5 degrees of freedom at the 0.05 significance level. The F0 value for Operator(Machine), obtained by dividing its mean square by the residual mean square, is less than the critical value of 2.45 for 5 and 40 degrees of freedom at the 0.05 significance level.
Conclusion From the ANOVA table we can conclude that the Machine is the most important factor and is statistically significant. The effect of Operator nested within Machine is not statistically significant. Again, any improvement activities should be focused on the tools. 