Beruflich Dokumente
Kultur Dokumente
Problem: Why can't we just carry out repeated t-tests on pairs of the variables?
If many independent tests are carried out pairwise then the probability of being correct
for the combined results is greatly reduced. For example, if we compare the average
marks of two students at the end of a semester to see if their mean scores are significantly
different we would have, at a 5% level, 0.95 probability of being correct. Comparing more
students:
Solution: We need therefore to use methods of analysis which will allow the variation
between all n means to be tested simultaneously giving an overall probability of 0.95 of
being correct at the 5% level. This type of analysis is referred to as Analysis of Variance
or 'ANOVA' in short. In general, it:
• measures the overall variation within a variable;
• finds the variation between its group means;
• combines these to calculate a single test statistic;
• uses this to carry out a hypothesis test in the usual manner.
In general, Analysis of Variance, ANOVA, compares the variation between groups and
the variation within samples by analysing their variances.
One-way ANOVA: Is there any difference between the average sales at various
departmental stores within a company?
Two-way ANOVA: Is there any difference between the average sales at various stores
within a company and/or the types of department? The overall variation is split 'two ways'.
1
One-way ANOVA
Total variation
(SST)
Two-way ANOVA
Total variation
(SST)
where SST = Total Sum of Squares; SSG = Treatment Sum of Squares between the
groups; SSBl = Blocks Sum of Squares; SSE = Sum of Squares of Errors.
(At this stage just think of 'sums of squares' as being a measure of variation.)
The method of measuring this variation is variance, which is standard deviation squared.
Total variance = between groups variance + variance due to the errors
It follows that: Total sum of = Sum of squares between + Sum of squares due
squares (SST) the groups (SSG) to the errors (SSE)
If we find any two of the three sums of squares then the other can be found by difference.
In practice we calculate SST and SSG and then find SSE by difference.
Since the method is much easier to understand with a numerical example, it will be
explained in stages using theory and a numerical example simultaneously.
2
Example 1
One important factor in selecting software for word processing and database management
systems is the time required to learn how to use a particular system. In order to evaluate
three database management systems, a firm devised a test to see how many training hours
were needed for five of its word processing operators to become proficient in each of three
systems.
System A 16 19 14 13 18 hours
System B 16 17 13 12 17 hours
System C 24 22 19 18 22 hours
Using a 5% significance level, is there any difference between the training time needed for
the three systems?
In this case the 'groups' are the three database management systems. These account for
some, but not all, of the total variance. Some, however, is not explained by the difference
between them. The residual variance is referred to as that due to the ‘errors’.
sum is to tabulate the values; subtract the mean from each value; square the results; and
finally sum the squares. The use of a statistical calculator is preferable!
In the lecture on summary statistics we saw that the standard deviation is calculated by:
∑ (x − x )
2
sn = so ∑ (x − x )2 = ns 2n with s from the calculator using [xσn]
n
∑ (x − x )
2
or s n −1 = so ∑ (x − x )2 = (n − 1)s 2n −1 with s from the calculator using [xσn-1]
n −1
Both methods estimate exactly the same value for the total sum of squares.
TotalSS Input all the data individually and output the values for n , x and σn from the
calculator in SD mode. Use these values to calculate σ2n and nσ2n .
n x σn σn2 σn2 .
nσ
15 17.33 3.419 11.69 175.3 = SS Total
3
SSSys Calculate n and x for each of the management systems separately:
n x
System A 5 16
System B 5 15
System C 5 21
n x σn σn2 σ n2 .
nσ
SS for Systems 15 17.33 2.625 6.889 103.3 = SSSys
SSG MSG
Between groups SSG k-1 = MSG =F
k −1 MSE
SSE
Errors SSE (N-1) - (k-1) = MSE
N−k
Method
• Fill in the total sum of squares, SST, and the between groups sum of squares, SSG,
after calculation; find the sum of squares due to the errors, SSE, by difference;
• the degrees of freedom, d.f., for the total and the groups are one less than the total
number of values and the number of groups respectively; find the error degree of
freedom by difference;
• the mean sums of squares, M.S.S., is found in each case by dividing the sum of
squares, SS, by the corresponding degrees of freedom.
• The test statistic, F, is the ratio of the mean sum of squares due to the differences
between the group means and that due to the errors.
4
In this example: (k = 3 systems, N = 15 values)
Total 175.3 15 - 1 = 14
The null hypothesis, H0, is that all the group means are equal. H0: µ1 = µ2 = µ3 = µ4 etc.
The alternative hypothesis, H1, is that at least two of the group means are different.
The critical value is from the F-tables, Fα (ν1, ν 2 ) , with the two degrees of freedom from
the groups, ν1, and the errors, ν2.
The test statistic is the F-value calculated from the sample in the ANOVA table.
The conclusion is reached by comparing the test statistic with the critical value and
rejecting the null hypothesis if the test statistic is the larger of the two.
Example 1 (cont.)
5
Example1 (cont.)
1 1 1 1
CD = t MSE + ⇒ 1.78 6.00 + = 2.76
n1 n 2 5 5
Two-way ANOVA
In the above example it might have been reasonable to suggest that the five Operators
might have different learning speeds and were therefore responsible for some of the
variation in the time needed to master the three Systems. By extending the analysis from
one-way ANOVA to two-way ANOVA we can find our whether Operator variability is a
significant factor or whether the differences found previously were just due to the Systems.
Example 2 Operators
1 2 3 4 5
System A 16 19 14 13 18
System B 16 17 13 12 17
System C 24 22 19 18 22
Again we ask the same question: using a 5% level, is there any difference between the
training time for the three systems? We can use the Operator variation just to explain some
of the unexplained error thereby reducing it, 'blocked' design, or we can consider it in a
similar manner to the System variation in the last example in order to see if there is a
difference between the Operators.
In the first case the 'groups' are the three database management systems and the 'blocks'
being used to reduce the error are the different operators who themselves may differ in
speed of learning. In the second we have a second set of groups - the Operators.
In 2-way ANOVA we find SST, SSSys, SSOps and then find SSE by difference.
SSE = SST - SSSys - SSOps
We already have SST and SSSys from 1-way ANOVA but still need to find SSOps.
6
Operators
1 2 3 4 5 Means
System A 16 19 14 13 18 16.00
System B 16 17 13 12 17 15.00
System C 24 22 19 18 22 21.00
Means 18.67 19.33 15.33 14.33 19.00 17.33
7
Table 4 PERCENTAGE POINTS OF THE F DISTRIBUTION α = 5%