You are on page 1of 77

ONE– WAY AND

TWO – WAY
CLASSIFICATION
ANALYSIS OF
VARIANCE (ANOVA)
Adam Julian L. Che, Ph.D.
WHAT IS ANOVA?
• AnoVa stands for analysis of
variance.
• Statistical Analysis of at least two
population means can be performed
by conducting an ANOVA.
• This method partitions the total
variance of the variables of interest
into several components of sources.
ANOVA: Single Factor
A single factor or one-way ANOVA
is used to test the null hypothesis
that the means of several
populations are all equal.
PROCEDURES FOR ONE-WAY ANOVA
PROCEDURES:
1. Ho: μ1= μ2=…= μp , That the p population
means are equal
Ha: μi ≠ μk , At least two means are not equal.

2. Test-Statistic: Use F-Test at α level of


significance.
PROCEDURES:
3. Decision Criterion:
Reject Ho if Fc  F [( p−1),( n− p )]
4. Computations:
Notations:
yij = the ith observation in the jth group
y i. =total of the observations in the ith group
y.. = the grand total
y.. = the grand mean
The ANOVA Table
Source of Degrees of Sum of Mean Computed
Variation Freedom Squares Square F or F-
(SV) (DF) (SS) (MS) Ratio
Between Groups p–1 BSS MSB Fc
Within Groups n–p WSS MSW
Total n-1 TSS

ns= not significant * = significant at α level


PROCEDURES
5. State your decision based on the
decision criterion and computed F.

6. State your conclusion based on


your decision.
ILLUSTRATIVE EXAMPLE
FOR THE ONE-WAY ANOVA
PROBLEM

Three sections of the same


Mathematics subjects for
Grade 4 pupils are taught
by three different teachers.
The first quarter grades of
the pupils were presented
in the following table:
1st Quarter Grades
Students
Adonis Bong Carlito
Is there a
A 73 88 68
B 89 78 79 significant
C 82 48 56 difference in the
D 43 91 91
E 80 51 71 average grades
F 73 85 71 given by the three
G 66 74 87
H 60 77 41 teachers? Use
I 45 31 59 0.01 level of
J 93 73 68
K 36 62 53 significance.
L 77 76 79
M 96 15
N 80
O 56
SOLUTION:

1. Ho: μA= μB= μC , That the average grades given by


the three teachers do not differ significantly
Ha: μi ≠ μk , At least two of the average grades given
by the three teachers differ significantly.
SOLUTION:

2. Test-Statistic: Use F-Test at 1% level of significance.

3. Decision Criterion:

Fc  F0.01[(3−1),( 40−3)] = 5.18


a. Reject Ho if:
Final Grades
Students TOTAL
SOLUTION: Adonis Bong Carlito
A 73 88 68
B 89 78 79
4. Computation: C
D
82
43
48
91
56
91
E 80 51 71
F 73 85 71
G 66 74 87
H 60 77 41
I 45 31 59
J 93 73 68
K 36 62 53
L 77 76 79
M 96 15
N 80
O 56
n 12 15 13 40
Y 817 1066 838 2721
Y
2
59407 80306 58994 198707
Y 68.08 71.07 64.46 68.03
SOLUTION:
Computation Formulas:
2 2
a. CF = y.. ( 2721)
= = 185096.03
n 40
p ni
b. TSS =  yij − CF
2

i =1 j =1
= (73 + 892 + ... + 792 + 152 ) − 185096.03
2

= 198707 − 185096.03
= 13610.97
SOLUTION:

• c. p 2
yi.
BSS =  − CF
i =1 ni
 817 2 10662 8382 
=  + +  − 185096.03
 12 15 13 
= 185399.92 − 185096.03
= 303.89
• d. WSS = TSS − BSS = 13610.97 − 303.89
= 13307.08
SOLUTION:
Computation Formulas:
BSS 303.89
e. MSB = = = 151.95
( p − 1) (3 − 1)

WSS 13307.08
f. MSW = = = 359.65
(n − p ) (40 − 3)
SOLUTION:
Computation Formulas:

MSB 151.95
g. Fc = = = 0.4225
MSW 359.65
The ANOVA Table
Source of Degrees of Sum of Mean Computed
Variation Freedom Squares Square F or F-
(SV) (DF) (SS) (MS) Ratio
Between Groups p–1 BSS MSB Fc
Within Groups n–p WSS MSW
Total n-1 TSS

ns= not significant * = significant at α level


The ANOVA Table
Source of Degrees of Sum of Mean Computed
Variation Freedom Squares Square F or F-
(SV) (DF) (SS) (MS) Ratio
Between Groups 2 303.89 151.95 0.42ns
Within Groups 37 13307.08 359.65
Total 39 13610.97

ns= not significant * = significant at α level


SOLUTION:
5. Decision:
a. Since Fc = 0.4225  F0.01[ 2,37 ] = 5.18 , we failed to reject Ho .

6. Conclusion:
Therefore, the average grades given by the three teachers
do not differ significantly.
Roger is a pilot and he does extensive bad weather

Problem flights. He decides to buy a battery-powered radio as


an independent back-up for his regular radios which

Set # 10.A. depend on the airplane’s electrical system. He has a


choice of three brands of rechargeable batteries that

(MS EXCEL) vary in cost. He randomly selects four batteries for


each brand and tests them for operating time (in hours)
“One-Way before recharging is necessary. He obtains the sample
Classification ANOVA” data in the following table.
BRAND OPERATING TIME (In Hours) Do the three brands have
Evereday 20.7 21.9 20.9 22.2
the same mean usable
time before recharging is
Energeezer 21.0 25.6 24.7 24.5
required? Use the level
Imarfleex 26.5 26.7 25.0 24.6 of significance 𝜶 = 0.01.
Roger is a pilot and he does extensive bad weather

Problem flights. He decides to buy a battery-powered radio as


an independent back-up for his regular radios which

Set # 10.A. depend on the airplane’s electrical system. He has a


choice of three brands of rechargeable batteries that

(Jamovi) vary in cost. He randomly selects four batteries for


each brand and tests them for operating time (in hours)
“One-Way before recharging is necessary. He obtains the sample
Classification ANOVA” data in the following table.
BRAND OPERATING TIME (In Hours) Do the three brands have
Evereday 20.7 21.9 20.9 22.2
the same mean usable
time before recharging is
Energeezer 21.0 25.6 24.7 24.5
required? Use the level
Imarfleex 26.5 26.7 25.0 24.6 of significance 𝜶 = 0.01.
ANOVA: Two Factor without Replication

This tool is used when the variance


depends on two factors and if we
are collecting only a single data
point for a specified condition.
HYPOTHESIS TESTING
PROCEDURES FOR 2-WAY ANOVA
WITHOUT REPLICATION
PROCEDURES:
1. Ho’: α1=α2=…=αr , That the row means are equal
Ha’: At least two of the αi’s differ significantly
Ho’’: β1=β2=…=βc , That the column means are equal
Ha’’: At least two of the βj’s differ significantly

2. Test-Statistic: Use F-Test at α level of


significance.
PROCEDURES:

3. Decision Criterion:
a. Reject Ho’ if Fc( row ) ³ Fa [(r-1),(r-1)(c-1)]
b. Reject Ho’’ if Fc(column) ³ Fa [(c-1),( r-1)(c-1)]

4. Computation
The ANOVA Table
Source of Degrees of Sum of Mean Computed
Variation Freedom Squares Square F
Row r–1 SSRow MSRow Fc(row)
Column c–1 SSColumn MSColumn Fc(column)
Error (r – 1)(c – 1) SSError MSError

Total rc - 1 SSTotal

ns= not significant * = significant at 5% level


PROCEDURES
5. State your decision based on the decision
criterion and computed F.

6. State your conclusion based on your


decision.
ILLUSTRATIVE EXAMPLE
FOR THE TWO-WAY ANOVA
PROBLEM
A study is made to determine
the force required to pull apart
pieces of glued plastic. Three
types of plastics were tested
using four different levels of
humidity. The results, in
kilogram, are given as follows:
Plastic Humidity
Type 30% 50% 70% 90%
A 38.2 32.5 34.2 33.0
B 30.9 27.8 28.4 30.5
C 27.3 30.4 27.3 31.6

Use a 0.05 level of significance to test the hypothesis


that there is no significant difference in the mean force
required to pull the glued plastic apart:
a. When different types of plastic are used;
b. For different humidity conditions.
SOLUTION:

1. Ho’: αA=αB=αC, that there is no significant difference in


the mean force required to pull the glued plastic apart
when different types of plastic are used.
Ha’: αi ≠ αk ,At least two of the plastic types differ
significantly in terms of the mean force required to pull
the glued plastic apart.
SOLUTION:

1. Ho’’: β30%=β50%=β70%=β90%, that there is no significant


difference in the mean force required to pull the
glued plastic apart based on humidity conditions.

Ha’’: βi≠βk ,At least two of the humidity conditions differ


significantly in terms of the mean force required to
pull the glued plastic apart.
SOLUTION:

2. Test –Statistic: Use F-Test at α=0.05 level of


significance
3. Decision Criterion:
a. Reject Ho’ if:F
c( plastic )
³ F0.05[(3-1),(3-1)(4-1)] = 5.14
b. Reject Ho” if: Fc(humidity ) ³ F0.05[(4-1),(3-1)(4-1)] = 4.76
4. COMPUTATION:

Plastic Humidity
Total Mean
Type 30% 50% 70% 90%
A 38.2 32.5 34.2 33.0 137.9 34.48
B 30.9 27.8 28.4 30.5 117.6 29.40
C 27.3 30.4 27.3 31.6 116.6 29.15
Total 96.4 90.7 89.9 95.1 372.1
Mean 32.13 30.23 29.97 31.7 31.01
SOLUTION:

( 372.1)
2
a. 2
x..
CF = = = 11538.20083
rc ( 3 )( 4 )
SOLUTION:
c=4
Plastic Humidity
Total Mean
Type 30% 50% 70% 90%
A 38.2 32.5 34.2 33.0 137.9 34.48
B 30.9 27.8 28.4 30.5 117.6 29.40
C 27.3 30.4 27.3 31.6 116.6 29.15
Total 96.4 90.7 89.9 95.1 372.1
r=3 Mean 31.01
SOLUTION:
r c
SSTotal = å å x ij 2 -CF
b.
i=1 j=1

= éë 38.22 + 32.52 +...+ 31.62 ùû -11538.20083


=11651.89-11538.20083
SSTotal = 113.6892
SOLUTION:

Plastic Humidity
Total Mean
Type 30% 50% 70% 90%
A 38.2 32.5 34.2 33.0 137.9 34.48
B 30.9 27.8 28.4 30.5 117.6 29.40
C 27.3 30.4 27.3 31.6 116.6 29.15
Total 96.4 90.7 89.9 95.1 372.1
Mean 31.01
SOLUTION:
r
c.
å i.
x 2
é 137.92 +117.62 +116.62 ù
SSPlastic = i=1
-CF = ê ú -11538.20083
c ë 4 û
46441.73
= -11538.20083
4
SSPlastic = 72.23167
SOLUTION:
c=4
Plastic Humidity
Total Mean
Type 30% 50% 70% 90%
A 38.2 32.5 34.2 33.0 137.9 34.48
B 30.9 27.8 28.4 30.5 117.6 29.40
C 27.3 30.4 27.3 31.6 116.6 29.15
Total 96.4 90.7 89.9 95.1 372.1
Mean 31.01
SOLUTION:
c
d. åx .j
2

é 96.4 2 + 90.72 + 89.92 + 95.12 ù


j=1
SSHumidity = -CF = ê 3
ú -11538.20083
r ë û
é 34645.47 ù
=ê ú -11538.20083
ë 3 û
SSHumidity = 10.28917
SOLUTION:

Plastic Humidity
Total Mean
Type 30% 50% 70% 90%
A 38.2 32.5 34.2 33.0 137.9 34.48
B 30.9 27.8 28.4 30.5 117.6 29.40
C 27.3 30.4 27.3 31.6 116.6 29.15
Total 96.4 90.7 89.9 95.1 372.1
r=3
Mean 31.01
SOLUTION:
e. SSError = SSTotal -SSPlastic -SSHumidity
=113.6892- 72.2317-10.2892
SSError = 31.1683
SOLUTION:
f. SSPlastic 72.2317
MSPlastic = =
r -1 3 -1

MSPlastic = 36.1159
SOLUTION:
g.
SSHumidity 10.2892
MSHumidity = =
c -1 4 -1
MSHumidity = 3.4297
SOLUTION:
h.
SSError 31.1683
MSError = =
( )( ) ( )( )
r -1 c -1 3 -1 4 -1

MSError = 5.1947
SOLUTION:
i.
MSPlastic 36.1159
Fc(Plastic ) = =
MSError 5.1947

Fc(Plastic ) = 6.9525
SOLUTION:
j.
MSHumidity 3.4297
Fc(Humidity ) = =
MSError 5.1947

Fc(Humidity ) = 0.6602
The ANOVA Table
Source of Degrees of Sum of Mean Computed
Variation Freedom Squares Square F
Plastic Type 2 72.2317 36.1159 6.95*
Humidity 3 10.2892 3.4297 0.66ns
Error 6 31.1683 5.1947

Total 11 113.6892

ns= not significant * = significant at 5% level


SOLUTION:

5. Decision
a. Since Fc(plastic ) = 6.95 ³ F0.05[(3-1),(3-1)(4-1)] = 5.14 , reject Ho’.

b. Since Fc(humidity ) = 0.66 < F0.05[(4-1),(3-1)(4-1)] = 4.76 , we fail to


reject Ho’’
SOLUTION:

6. Conclusion:
a. At least two of the plastic types differ significantly at 5% level in
terms of the mean force required to pull glued plastic apart.
b. The mean force required to pull the glued plastic apart do not
differ significantly at 5% level of significance among humidity
conditions.
ANOVA IN EXCEL: IT’S YOUR TURN AGAIN!
To start with the ANOVA function, open the workbook
containing the data you want to run the test on. Then, follow these
steps:
1. Click in a cell on your spreadsheet where your output will begin. The
results, of course, will cover a range of cells.
2. Click on the Data tab from the main ribbon and select data analysis,
which should be in the analysis menu on the right.
3. Select the appropriate ANOVA test from the options in the Data
Analysis menu.
The following table presents the final grades obtained

Problem
by five students in Mathematics, English, ESP, and
Science:

Set # 11.A. STUDENTS Math


SUBJECTS
English ESP Science

(MS EXCEL) 1
2
80
86
78
90
85
93
79
91

– “Two-Way 3
4
75
78
78
80
83
84
79
76
Classification 5 83 87 85 87
ANOVA w/o Use 0.05 level of significance to test the ff. hypotheses:
Replication” a. Students have equal ability;
b. Subjects are of equal difficulty.
The following table presents the final grades obtained

Problem
by five students in Mathematics, English, ESP, and
Science:

Set # 11.B. STUDENTS Math


SUBJECTS
English ESP Science

(JAMOVI) 1
2
80
86
78
90
85
93
79
91

– “Two-Way 3
4
75
78
78
80
83
84
79
76
Classification 5 83 87 85 87
ANOVA w/o Use 0.05 level of significance to test the ff. hypotheses:
Replication” a. Students have equal ability;
b. Subjects are of equal difficulty.
ANOVA: Two Factor with Replication

This tool is used when we have two


factors on which the variance
depends and if we are collecting
multiple data points for a specified
condition.
HYPOTHESIS TESTING
PROCEDURES FOR 2-WAY ANOVA
WITH REPLICATION
PROCEDURES:
1. Ho’’’: There is no interaction between the two factors
Ha’’’: There is interaction between the two factors
Ho’: α1=α2=…=αr , That the row means are equal
Ha’: At least two of the αi’s differ significantly
Ho’’: β1=β2=…=βc , That the column means are equal
Ha’’: At least two of the βj’s differ significantly (p.689)

2. Test-Statistic: Use F-Test at α level of


significance.
PROCEDURES:

3. Decision Criterion:
a. Reject Ho’’’ if 𝐹𝑐(𝑖𝑛𝑡𝑒𝑟𝑎𝑐𝑡𝑖𝑜𝑛) ≥ 𝐹𝛼[ 𝑟−1 ,(𝑟−1)(𝑐−1]
b. Reject Ho’ if Fc ( row ) ³ Fa [( r -1),( r -1)(c-1)]
c. Reject Ho’’ if Fc (column ) ³ Fa [(c-1),( r -1)(c-1)]
4. Computation using Excel:
PROCEDURES
5. State your decision based on the decision
criterion and computed F.

6. State your conclusion based on your


decision.
SAMPLE PROBLEM:
SOLUTION:
Problem
Marathon Times. Listed below are New York Marathon
running times (in seconds) for randomly selected
runners who completed the marathon. At 0.05 level of
Set #12.A. significance, are the running times affected by an
interaction between gender and age bracket? Are
(MS running times affected by gender? Are running times
affected by age bracket?

EXCEL)–
“Two-Way
Classification
ANOVA with
Replication”
Problem
Marathon Times. Listed below are New York Marathon
running times (in seconds) for randomly selected
runners who completed the marathon. At 0.05 level of
Set #12.B. significance, are the running times affected by an
interaction between gender and age bracket? Are
(JAMOVI)– running times affected by gender? Are running times
affected by age bracket?
“Two-Way
Classification
ANOVA with
Replication”
REFERENCES

• Statistics Made Easy by Dr. Consuelo A. Tagaro


and Engr. Alipio T. Tagaro
• Statistics for Managers by Levine, et. al
• Slides by Dr. Joel E. Genzon
Thank you for
listening!
☺☺☺

You might also like