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

## Two-Way Crossed ANOVA

Description When we have two factors with at least two levels and one or more observations at each level, we say we have a two-way layout. We say that the two-way layout is crossed when every level of Factor A occurs with every level of Factor B. With this kind of layout we can estimate the effect of each factor (Main Effects) as well as any interaction between the factors.
Model If we assume that we have K observations at each combination of I levels of Factor A and J levels of Factor B, then we can model the two-way layout with an equation of the form:

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

This equation just says that the kth data value for the jth level of Factor B and the ith level of Factor A is the sum of five components: the common value (grand mean), the level effect for Factor A, the level effect for Factor B, the interaction effect, and the residual. Note that (ab) does not mean multiplication; rather that there is interaction between the two factors.

Estimation Like the one-way case, the estimation for the two-way layout can be done either by calculating the variance components or by using CLM techniques.
Click here for the value splitting example For the two-way ANOVA, we display the data in a two-dimensional table with the levels of Factor A in columns and the levels of Factor B in rows. The replicate observations fill each cell. We can sweep out the common value, the row effects, the column effects, the interaction effects and the residuals using  value-splitting techniques. Sums of squares can be calculated and summarized in an ANOVA table as shown below.

Source Sum of Squares DoF Mean Square F0
Rows $$SSR = JK\sum{(\bar{y}_{i..} - \bar{y}_{...})^2}$$ I - 1 MSR = SSR/(I - 1) MSR/MSE
Columns $$SSC = IK\sum{(\bar{y}_{.j.} - \bar{y}_{...})^2}$$ J - 1 MSC = SSC/(J - 1) MSC/MSE
Interaction $$SSI = K\sum\sum{(\bar{y}_{ij.} - \bar{y}_{i..} - \bar{y}_{.j.} + \bar{y}_{...})^2}$$ (I - 1)(J - 1) MSI = SSC/((I - 1)(J - 1)) MSI/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}_{.j.} = \frac{1}{IK} \sum_{i=1}^{I}{\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).

We can use CLM techniques to do the estimation. We still have the problem that the model is saturated and no unique solution exists. We overcome this problem by applying the constraints to the model that the two main effects and interaction effects each sum to zero.

Testing Like testing in the one-way case, we are testing that two main effects and the interaction are zero. Again we just form a ratio of each main effect mean square and the interaction mean square to the residual mean square. 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 as described in the model above. It is assumed that the random component can be modeled with a Gaussian distribution with fixed location and spread.
Uses The two-way crossed ANOVA is useful when we want to compare the effect of multiple levels of two factors and we can combine every level of one factor with every level of the other factor. If we have multiple observations at each level, then we can also estimate the effects of interaction between the two factors.
Example Let's extend the one-way machining example by assuming that we want to test if there are any differences in pin diameters due to different types of coolant. We still have five different machines making the same part and we take five samples from each machine for each coolant type to obtain the following data:

 Machine Coolant A 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 Coolant B 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 crossed 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 0.000303 4 0.000076 8.8 coolant 0.00000392 1 0.00000392 0.45 interaction 0.00001468 4 0.00000367 0.42 residuals 0.000346 40 0.0000087 corrected total 0.000668 49
Test By dividing the mean square for machine by the mean square for residuals we obtain an F0 value of 8.8 which is greater than the critical value of 2.61 based on 4 and 40 degrees of freedom and a 0.05 significance level. Likewise the F0 values for Coolant and Interaction, obtained by dividing their mean squares by the residual mean square, are less than their respective critical values of 4.08 and 2.61 (0.05 significance level).
Conclusion From the ANOVA table we can conclude that machine is the most important factor and is statistically significant. Coolant is not significant and neither is the interaction. These results would lead us to believe that some tool-matching efforts would be useful for improving this process.