1 Two-way ANOVA without interaction
The previous Section considered a one-way classification analysis of variance, that is we looked at the variations induced by one set of values of a factor (or treatments as we called them) by partitioning the variation in the data into components representing ‘between treatments’ and ‘within treatments.’
In this Section we will look at the analysis of variance involving two factors or, as we might say, two sets of treatments. In general terms, if we have two factors say A and B, there is no absolute reason to assume that there is no interaction between the factors. However, as an introduction to the two-way analysis of variance, we will consider the case occurring when there is no interaction between factors and an experiment is run only once. Note that some authors take the view that interaction may occur and that the residual sum of squares contains the effects of this interaction even though the analysis does not, at this stage, allow us to separate it out and check its possible effects on the experiment.
The following example builds on the previous example where we looked at the one-way analysis of variance.
1.1 Example of variance in data
In Section 44.1 we considered an example concerning four machines producing alloy spaces. This time we introduce an extra factor by considering both the machines producing the spacers and the performance of the operators working with the machines. In this experiment, the data appear as follows (spacer lengths in mm). Each operator made one spacer with each machine.
Operator | Machine 1 | Machine 2 | Machine 3 | Machine 4 |
1 | 46 | 56 | 55 | 47 |
2 | 54 | 55 | 51 | 56 |
3 | 48 | 56 | 50 | 58 |
4 | 46 | 60 | 51 | 59 |
5 | 51 | 53 | 53 | 55 |
In a case such as this we are looking for discernible difference between the operators (‘operator effects’) on the one hand and the machines (‘machine effects’) on the other.
We suppose that the observation for operator and machine is taken from a normal distribution with mean
Here is an operator effect and is a machine effect. Our hypotheses may be stated as follows.
Operator Effects
Machine Effects
Note that the five operators and four machines give rise to data which has only one observation per ‘cell.’ For example, operator 2 using machine 3 produces a spacer 51 mm long, while operator 1 using machine 2 produces a spacer which is 56 mm long. Note also that in this example we have referred to the machines by number and not by letter. This is not particularly important but it will simplify some of the notation used when we come to write out a general two-way ANOVA table shortly. We obtain one observation per cell and cannot measure variation within a cell. In this case we cannot check for interaction between the operator and the machine - the two factors used in this example. Running an experiment several times results in multiple observations per cell and in this case we should assume that there may be interaction between the factors and check for this. In the case considered here (no interaction between factors), the required sums of squares build easily on the relationship used in the one-way analysis of variance
to become
where represent the sums of squares corresponding to factors and . In order to calculate the required sums of squares we lay out the table slightly more efficiently as follows.
Note 1
The notation means that summation takes place over that variable. For example, the five operator means are obtained as and so on, while the four machine means are obtained as and so on. Put more generally (and this is just an example)
Note 2
Multiplying factors were used in the calculation of the machine sum of squares (four in this case since there are four machines) and the operator sum of squares (five in this case since there are five operators).
Note 3
The two statements ‘Sum = 0’ are included purely as arithmetic checks.
We also know that and .
Calculating the error sum of squares
Note that the total sum of squares is easy to obtain and that the error sum of squares is then obtained by straightforward subtraction.
The total sum of squares is given by summing the quantities for the table of entries. Subtracting from each table member and squaring gives:
Operator |
Machine
|
|||
1 | 2 | 3 | 4 | |
1 | 49 | 9 | 4 | 36 |
2 | 1 | 4 | 4 | 9 |
3 | 25 | 9 | 9 | 25 |
4 | 49 | 49 | 4 | 36 |
5 | 4 | 0 | 0 | 4 |
The total sum of squares is .
The error sum of squares is given by the result
At this stage we display the general two-way ANOVA table and then particularise the table for the example we are engaged in and draw conclusions by using the test as we have previously done with one-way ANOVA.
A General Two-Way ANOVA Table
Hence the two-way ANOVA table for the example under consideration is
From the -tables (at the end of the Workbook) and . Since we conclude that we do not have sufficient evidence to reject the null hypothesis that there is no difference between the operators. Since we conclude that we do have sufficient evidence at the 5% level of significance to reject the null hypothesis that there in no difference between the machines.
Key Point 2
If we have two factors, and , with levels of factor and levels of factor , and one observation per cell, we can calculate the sum of squares as follows.
The sum of squares for factor is
and the sum of squares for factor is
where
is the total for level of factor ,
is the total for level of factor ,
is the overall total of the data, and
is the total number of observations.
The total sum of squares is
The within-samples, or ‘error’, sum of squares can be found by subtraction. So
with
Task!
A vehicle manufacturer wishes to test the ability of three types of steel-alloy panels to resist corrosion when three different paint types are applied. Three panels with differing steel-alloy composition are coated with three types of paint. The following coded data represent the ability of the painted panels to resist weathering.
Paint Type | Steel-Alloy 1 | Steel-Alloy 2 | Steel-Alloy 3 |
1 | 40 | 51 | 56 |
2 | 54 | 55 | 50 |
3 | 47 | 56 | 50 |
Use a two-way ANOVA procedure to determine whether any difference in the ability of the panels to resist corrosion may be assigned to either the type of paint or the steel-alloy composition of the panels.
Our hypotheses may be stated as follows.
Paint type
Steel-Alloy
Following the methods of calculation outlined above we obtain:
Hence and . We now require . The calculations are as follows.
In the table below, the predicted outputs are given in parentheses.
A table of squared residuals is easily obtained as
Paint |
Steel
|
||
1 | 2 | 3 | |
1 | 25 | 1 | 36 |
2 | 25 | 1 | 16 |
3 | 0 | 4 | 4 |
Hence the residual sum of squares is . The total sum of squares is given by subtracting from each table member and squaring to obtain
Paint |
Steel
|
||
1 | 2 | 3 | |
1 | 121 | 0 | 25 |
2 | 9 | 16 | 1 |
3 | 16 | 25 | 1 |
The total sum of squares is . We should now check to see that . Substitution gives which is correct.
The values of are calculated as shown in the ANOVA table below.
From the -tables the critical values of and since both of the calculated values are less than 6.94 we conclude that we do not have sufficient evidence to reject either null hypothesis.