BACS 2213 Chapter 9 : ANOVA .
CHAPTER 10 :
ANALYSIS OF VARIANCE ( ANOVA )
OBJECTIVES
To use the one-way ANOVA technique to determine if there is a significant difference
among three or more means.
To determine the difference among means when Ho in ANOVA is rejected.
10.0 Analysis of Variance (ANOVA)
When F test is used to test a hypothesis concerning the means of three or more
populations, the technique is called analysis of variance (ANOVA).
10.1 One Way ANOVA
With the F test, two different estimates of the population variance are made.
i) The first estimate is called the between-group variance, and it involves
finding the variance of the means.
ii) The second estimate, the within-group variance, is made by computing the
variance using all the data and is not affected by differences in the means.
For a test of the difference among three or more means, the following hypotheses
should be used:
H0: µ1 = µ 2 = … = µ k
H1: At least two of the means are not equal
Steps to conduct test of the difference among three or more means:
Step 1 : State the hypothesis and identify the claim.
Step 2 : Find the critical value.
Step 3 : Compute the F test value.
Step 4 : Make the Decision.
Step 5 : Summarize the results.
Procedure for finding the F test value for the Analysis of Variance:
Step 1 : Find the mean and variance of each sample
2 2 2 2
( x ,s
1 1
) ,( x 2
, s 2
) ,( x 3
, s 3
) ,……, ( x k
, s k
)
∑x ( ∑ x)
2
x= s2 =
∑x 2
−
n , n −1 n( n − 1)
1
BACS 2213 Chapter 9 : ANOVA .
Step 2 : Find the grand mean
∑X
X GM
=
N
Step 3 : Find the between-group variance.
∑n (X
2
S i − X GM ) 2
MSB = SSB/ k-1 = B = i
k −1 k −1
Step 4 : Find the within-group variance.
∑ (n − 1)s
2
2 i
MSW= SSW/ N-k = S W =
i
N −k
∑ (n − 1) i
Step 5 : Find the F test value.
MSB
F=
MSW
The degrees of freedom are d.f.N = k-1, and d.f.D = N-k
Where k is the number of groups
N is the sum of the sample sizes of the groups,
N = n1 + n 2 + n3 + n4 + ..... + n k
ANOVA table for one way classification:
Source of Sum of Degree of Mean of Squares F test Statistic
variation Squares Freedom
SSB
Between SSB k-1 MSB =
k −1 MSB
F=
N-k SSW MSW
Within SSW MSW =
N-k
Total
SSB – Sum of Squares between groups
SSW – Sum of Squares within groups
** Critical Region : Reject H 0 if F > Fα, k −1, N −k
(refer to upper critical values of F-distribution)
2
BACS 2213 Chapter 9 : ANOVA .
Example 10.1 :
A state employee wishes to see if there is a significant difference in the number of
employees at the interchanges of three state toll roads. The data are shown next. At
α = 0.05 can it be concluded that there is a significant difference in the average number
of employees at each interchange ?
PA Turnpike Greensburg Bypass Valley Express
7 10 1
14 1 12
32 1 1
19 0 9
10 11 1
11 1 11
X 1 =15.5 X 2 =4.0 X 3 =5.8
2 2 2
s 1
=81.9 s 2
=25.6 s 3
=29.0
Step 1 : State the hypothesis and identify the claim.
H0: µ1 = µ 2 = … = µ k
H1: At least two of the means are not equal
Step 2 : Find the critical value. Since k=3, N= 18, and α = 0.05 ,
d.f.N = k-1 = 3-1 = 2
d.f.D = N-k = 18-3 = 15
The critical value is 3.68
3
BACS 2213 Chapter 9 : ANOVA .
Step 3 : Compute the test value.
a) Find the mean and variance of each sample.
b) Find the grand mean
X GM
= ∑X =
7 + 14 + 32 + ........ + 11 152
= = 8.4
18 18
N
c) Find the between-group variance.
MSB= ∑ n i
( X i − X GM ) 2 6(15.5 − 8.4) 2 + 6(4 − 8.4)2 + 6(5.8 − 8.4)2
=
3 −1
k −1
=459.18/2 =229.59
d) Find the within-group variance.
∑ (n − 1)s
2
s 2
w
i i (6 − 1)(81.9) + (6 − 1)(25.6) + (6 − 1)(29.0)
MSW = = =
N −k (6 − 1) + (6 − 1) + (6 − 1)
∑ (n − 1)i
682.5
= 15 = 45.5
e) Find the F test value.
MSB 229.59
= 5.05
F = MSW = 45.5
Step 4 : Make the Decision. Since 5.05 >3.68, the decision is to reject the
null Hypothesis.
Step 5 : Summarize the results. There is enough evidence to support the
claim that there is a different among the means.
The ANOVA Summary table for this example is shown below :
Source of Sum of Degree of Mean of F test Statistic
variation Squares Freedom Squares
SSB
Between 459.18 2 = 229.59 MSB
2 F= =
MSW
15 SSW
= 45.5
Within 682.5 5.05
15
Total 1141.68 17
(i) H 0 : µ1 = µ2 = µ3
H1: At least two of the means are not equal
4
BACS 2213 Chapter 9 : ANOVA .
(ii) α = 0.05
(iii) Critical region : Reject H 0 if F > f 0.05,2,15 = 3.68
MSB
(iv) Test statistics F = = 5.05
MSW
Since F > 3.68 , ⇒ Reject H 0
Example 10.2:
In an effort to improve the quality of recording tapes, the effects of four kinds of
coatings A,B,C,D on the reproducing quality of sound are compared. Suppose that the
measurements of sound distortion (given in the table below) are obtained from tapes
treated with four coatings.
A B C D
45 58 54 42
43 56 50 37
51 62 55 49
Does any significant difference exist among the mean distortions obtained using the
four coatings? Use a 0.01 level of significance.
Solution:
A B C D
45 58 54 42
43 56 50 37
51 62 55 49
X 1 =46.33 X 2 =58.67 X 3 =36.33 X 3 =42.67
2 2 2
s42 =36.3
s 1
=17.3 s 2
=9.3 s 3
=7.0
Step 1 : State the hypothesis and identify the claim.
H0: µ1 = µ 2 = … = µ k
H1: At least two of the means are not equal
Step 2 : Find the critical value. Since k=4, N= 12, and α = 0.01 ,
d.f.N = k-1 = 4-1 = 3
d.f.D = N-k = 12-4 = 8
The critical value is 7.59
Step 3 : Compute the test value.
c) Find the mean and variance of each sample.
d) Find the grand mean
X GM
= ∑X = 602 / 12 = 50.17
N
c) Find the between-group variance.
5
BACS 2213 Chapter 9 : ANOVA .
MSB= ∑n (Xi i − X GM ) 2
=
3(14 .75 ) + 3(72 .25 ) + 3(191 .55 ) + 3(56 .25 )
4 −1
k −1
= 453.67/3 = 151.22
d) Find the within-group variance.
∑ (n − 1)s
2
2
s w
i i
MSW = =
N −k ∑ (n − 1)
i
(3 −1)(17 .3) + (3 −1)( 9.3) + (3 −1)( 7.0) + (3 −1)( 36 .3)
=
(3 −1) + (3 −1) + (3 −1) + (3 −1)
139 .8
= =17 .5
8
e) Find the F test value.
MSB 151 .22
F= = = 8.64
MSW 17 .5
Step 4 : Make the Decision. Since 8.64 >7.59, the decision is to reject the null
Hypothesis.
Step 5 : Summarize the results. We can conclude that there is a significant difference in
treatment effects.
The ANOVA Summary table for this example is shown below :
Source of Sum of Degree of Mean of F test Statistic
variation Squares Freedom Squares
SSB
Between 453.67 3 =151 .22 MSB
3 F= =
SSW MSW
Within 139.8 8 =17 .5
8 8.64
Total 1148.18 11
(v) H 0 : µ1 = µ2 = µ3
H1: At least two of the means are not equal
(vi) α = 0.05
(vii) Critical region : Reject H 0 if F > f 0.01,3,8 = 7.59
MSB
(viii) Test statistics F = = 8.64
MSW
(ix) Since F > 7.59 , ⇒ Reject H 0
6
BACS 2213 Chapter 9 : ANOVA .
Example 10.3:
A researcher wishes to try three different techniques to lower the blood pressure of
individuals diagnosed with high blood pressure. The subjects are randomly assigned to
three groups; the first group takes medication; the second group exercises, and the third
group follows a special diet. After four weeks, the reduction in each person’s blood
pressure is recorded. At α = 0.05, test the claim that there is no difference among the
means.
Medication Exercise Diet
10 6 5
12 8 9
9 3 12
15 0 8
13 2 4
X 1 =11.8 X 2 =3.8 X 3 =7.6
2 2 2
s 1
=5.7 s 2
=10.2 s 3
=10.3
Step 1 : State the hypothesis and identify the claim.
H0: µ1 = µ 2 = µ 3
H1: At least one mean is different from the others
Step 2 : Find the critical value. Since k=3, N= 15, and α = 0.05 ,
d.f.N = k-1 = 3-1 = 2
d.f.D = N-k = 15-3 = 12
The critical value is 3.89
Step 3 : Compute the test value.
a) Find the mean and variance of each sample.
X 1 =11.8 X 2 =3.8 X 3 =7.6
2 2 2
s
=5.71 s 2
=10.2 s 3
=10.3
b) Find the grand mean
X GM
= ∑X =
116
= 7.73
15
N
c) Find the between-group variance.
MSB= ∑ n i
( X i − X GM ) 2 160 .13
= =80.07
2
k −1
d) Find the within-group variance.
7
BACS 2213 Chapter 9 : ANOVA .
∑ (n − 1)s
2
i i
2
MSW = S W
=
∑ (n − 1)
i
104 .80
= = 8.73
12
e) Find the F test value.
MSB 80 .07
F= = = 9.17
MSW 8.73
Step 4 : Make the Decision. Since 9.17 >3.89, the decision is to reject the null
Hypothesis.
Step 5 : Summarize the results. There is enough evidence to support the claim that there
is a different among the means.
The ANOVA Summary table for this example is shown below :
Source of Sum of Degree of Mean of Squares F test Statistic
variation Squares Freedom
SSB
Between 160.13 2 = 80.07
2 MSB
F= = 9.17
12 SSW MSW
Within 104.80 = 8.73
12
Total 264.93 14
(x) H 0 : µ1 = µ2 = µ3
H1: At least two of the means are not equal
(xi) α = 0.05
(xii) Critical region : Reject H 0 if F > f 0.05,2,12 = 3.89
MSB
(xiii) Test statistics F= = 9.17
MSW
Since F > 3.89 , ⇒ Reject H 0
Exercises
8
BACS 2213 Chapter 9 : ANOVA .
1. Six different machines are being considered for use in manufacturing rubber seals
the machines are being compared with respect to tensile strength of the product. A
random sample of 4 seals from each machine is used to determine whether the mean
tensile strength varies from machine to machine. The following are the tensile-
strength measurements in kilograms per square centimeter × 10-1.
Machine
1 2 3 4 5 6
17.5 16.4 20.3 14.6 17.5 18.3
16.9 19.2 15.7 16.7 19.2 16.2
15.8 17.7 17.8 20.8 16.5 17.5
18.6 15.4 18.9 18.9 20.5 20.1
Perform the analysis of variance at the 0.05 level of significance and indicate
whether or not the mean tensile strengths differ significantly for the 6 machines.
2. The data in the following table represent the number of hours of relief provided by 5
different brands of headache tablets administrated to 25 subjects of variance fever of
38°C or more. Perform the analysis of variance and test the hypothesis at the level
of 0.05 level of significance that the mean number of hours if relief provided by the
tablets is the same for all 5 brands. Discuss the results.
Tablet
A B C D E
5.2 9.1 3.2 2.4 7.1
4.7 7.1 5.8 3.4 6.6
8.1 8.2 2.2 4.1 9.3
6.2 6.0 3.1 1.0 4.2
3.0 9.1 7.2 4.0 7.6
3. Immobilization of free-ranging white-tailed deer by drugs allows researchers the
opportunity to closely examine deer and gather valuable physiological information.
In the study Influence of Physical Restraint and Restraint-Facilitating Drugs on
Blood Measurements of White-Tailed Deer and Other Selected Mammals conducted
at the Virginia Polytechnic Institute and State University, wildlife biologists tested
the "knockdown" time (time from injection to immobilization) of three different
immobilizing drugs. Immobilization, in this case, is defined as the point to remain
standing thirty male white-tailed deer were randomly assigned to each of three
treatments. Group A received 5 mg of liquid succinylcholine chloride (SCC); group
B received 8 mg of powdered SCC; and group C received 200 mg of phencyclidine
hydrochloride. Knockdown times, in minutes, were recorded as follows:
Group
9
BACS 2213 Chapter 9 : ANOVA .
A B C
11 10 4
5 7 4
14 16 6
7 7 3
10 7 5
7 5 6
23 10 8
4 10 3
11 6 7
11 12 3
Perform an analysis of variance at the 0.01 level of significance and determine
whether or not the average knockdown time for the 3 drugs is the same.
Solution for the Exercises
Solution 1:
H 0 : µ1 = µ 2 = µ 3 = µ 4 = µ 5 = µ 6
H 1 : at least two of the means are not equal
α = 0.05
Critical region: f > 2.77 with v1 = 5 and v 2 = 18 dof.
Source of Sum of Degree of Mean of F-Test
Variation Squares Freedom Squares Statistics
Between 5.34 5 1.07 F=0.31
Within 62.64 18 3.48
Total 67.98 23
F<2.77
Decision: The treatment means do not differ significantly.
Solution 2:
H 0 : µ1 = µ 2 = µ 3 = µ 4 = µ 5
H 1 : at least two of the means are not equal
α = 0.05
Critical region: f > 2.87 with v1 = 4 and v 2 = 20 dof.
Source of Sum of Degree of Mean of F-Test
Variation Squares Freedom Squares Statistics
Between 79.440 4 19.86 F=6.90
Within 57.600 20 2.880
Total 137.040 24
F>2.87
Decision: Reject H 0 . The mean number of hours of relief differ.
10
BACS 2213 Chapter 9 : ANOVA .
Solution 3:
H 0 : µ A = µ B = µC
H 1 : at least two of the means are not equal
α = 0.01
Critical region: f > 5.49 with v1 = 2 and v 2 = 27 dof.
Source of Sum of Degree of Mean of F-Test
Variation Squares Freedom Squares Statistics
Between 158.8667 2 79.4334 F=5.46
Within 393.0000 27 14.5556
Total 551.8667 29
F<5.49
Decision: The average knockdown time did not differ significantly.
11