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 i and machine j is taken from a normal distribution with mean

μ i j = μ + α i + β j

Here α i is an operator effect and β j is a machine effect. Our hypotheses may be stated as follows.

Operator Effects H 0 : μ 1 j = μ 2 j = μ 3 j = μ 4 j = μ 5 j = μ + β j That is  α 1 = α 2 = α 3 = α 4 = α 5 = 0 H 1 : At least one of the operator effects is different to the others

 Machine Effects H 0 : μ i 1 = μ i 2 = μ i 3 = μ i 4 = μ + α i That is β 1 = β 2 = β 3 = β 4 = 0 H 1 : At least one of the machine effects is different to the others

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

S S T = S S T r + S S E

to become

S S T = S S A + S S B + S S E

where S S A represent the sums of squares corresponding to factors A and B . In order to calculate the required sums of squares we lay out the table slightly more efficiently as follows.

No alt text was set. Please request alt text from the person who provided you with this resource.

Note 1

The . notation means that summation takes place over that variable. For example, the five operator means X ̄ . j are obtained as X ̄ .1 = 46 + 56 + 55 + 47 4 = 51 and so on, while the four machine means X ̄ i . are obtained as X ̄ 1 . = 46 + 54 + 48 + 46 + 51 5 = 49 and so on. Put more generally (and this is just an example)

X ̄ . j = i = 1 m x i j m

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 S S O = 24 and S S M = 150 .

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 ( X i j X ̄ ̄ ) 2 for the table of entries. Subtracting X ̄ ̄ = 53 from each table member and squaring gives:

Operator  ( j )
Machine   ( i )
 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 S S T = 330 .

The error sum of squares is given by the result

S S E = S S T S S A S S B = 330 24 150 = 156

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

No alt text was set. Please request alt text from the person who provided you with this resource.

Hence the two-way ANOVA table for the example under consideration is

No alt text was set. Please request alt text from the person who provided you with this resource.

From the F -tables (at the end of the Workbook) F 4 , 12 = 3.26 and F 3 , 12 = 3.49 . Since 0.46 < 3.26 we conclude that we do not have sufficient evidence to reject the null hypothesis that there is no difference between the operators. Since 3.85 > 3.49 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, A and B , with a levels of factor A and b levels of factor B , and one observation per cell, we can calculate the sum of squares as follows.

The sum of squares for factor A is

S S A = 1 b i = 1 a A i 2 G 2 N with a 1 degrees of freedom

and the sum of squares for factor B is

S S B = 1 a j = 1 b B j 2 G 2 N with b 1 degrees of freedom

where

A i = j = 1 b X i j is the total for level i of factor A ,

B j = i = 1 a X i j is the total for level j of factor B ,

G = i = 1 a j = 1 b X i j  is the overall total of the data, and

N = a b is the total number of observations.

The total sum of squares is

S S T = i = 1 a j = 1 b X i j 2 G 2 N with N 1 d e g r e e s o f f r e e d o m

The within-samples, or ‘error’, sum of squares can be found by subtraction. So

S S E = S S T S S A S S B

with

( N 1 ) ( a 1 ) ( b 1 ) = ( a b 1 ) ( a 1 ) ( b 1 )

= ( a 1 ) ( b 1 ) degrees of freedom

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 H 0 : μ 1 = μ 2 = μ 3 H 1 : At least one of the means is different from the others

Steel-Alloy H 0 : μ 1 = μ 2 = μ 3 H 1 : At least one of the means is different from the others

Following the methods of calculation outlined above we obtain:

No alt text was set. Please request alt text from the person who provided you with this resource.

Hence S S P a = 24 and S S S t = 78 . We now require S S E . The calculations are as follows.

In the table below, the predicted outputs are given in parentheses.

No alt text was set. Please request alt text from the person who provided you with this resource.

A table of squared residuals is easily obtained as

Paint ( j )
Steel ( i )
 1   2   3 
1 25 1 36
2 25 1 16
3 0 4 4

Hence the residual sum of squares is S S E = 112 . The total sum of squares is given by subtracting X ̄ ̄ = 51 from each table member and squaring to obtain

Paint ( j )
Steel ( i )
 1   2   3 
1 121 0 25
2 9 16 1
3 16 25 1

The total sum of squares is S S T = 214 . We should now check to see that S S T = S S P a + S S S t + S S E . Substitution gives 214 = 24 + 78 + 112 which is correct.

The values of F are calculated as shown in the ANOVA table below.

No alt text was set. Please request alt text from the person who provided you with this resource.

From the F -tables the critical values of F 2 , 4 = 6.94 and since both of the calculated F values are less than 6.94 we conclude that we do not have sufficient evidence to reject either null hypothesis.