Professional Documents
Culture Documents
girishchadha.gc@gmail.com
JV65UCK2AH
Proprietary content. ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
This file is meant for personal use by girishchadha.gc@gmail.com only.
Sharing or publishing the contents in part or full is liable for legal action.
Learning Objectives
In this chapter, you learn:
• The basic concepts of experimental design
• How to use one-way analysis of variance to test for differences among
the means of several groups
girishchadha.gc@gmail.com
JV65UCK2AH
• How to use two-way analysis of variance and interpret the interaction
effect
• How to perform multiple comparisons in a one-way analysis of variance
and a two-way analysis of variance
Proprietary content. ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
This file is meant for personal use by girishchadha.gc@gmail.com only.
Sharing or publishing the contents in part or full is liable for legal action.
General ANOVA Setting
• Investigator controls one or more factors of interest
• Each factor contains two or more levels
• Levels can be numerical or categorical
girishchadha.gc@gmail.com
• Different levels produce different groups
JV65UCK2AH
• Think of each group as a sample from a different
population
• Observe effects on the dependent variable
• Are the groups the same?
• Experimental design: the plan used to collect the data
Proprietary content. ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
This file is meant for personal use by girishchadha.gc@gmail.com only.
Sharing or publishing the contents in part or full is liable for legal action.
Completely Randomized Design
Proprietary content. ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
This file is meant for personal use by girishchadha.gc@gmail.com only.
Sharing or publishing the contents in part or full is liable for legal action.
One-Way Analysis of Variance
• Evaluate the difference among the means of three or
more groups
Examples: Number of accidents for 1st, 2nd, and 3rd shift
girishchadha.gc@gmail.com
JV65UCK2AH Expected mileage for five brands of tires
• Assumptions
• Populations are normally distributed
• Populations have equal variances
• Samples are randomly and independently drawn
Proprietary content. ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
This file is meant for personal use by girishchadha.gc@gmail.com only.
Sharing or publishing the contents in part or full is liable for legal action.
Hypotheses of One-Way ANOVA
• H0 : μ1 = μ2 = μ3 = = μc
• All population means are equal
• i.e., no factor effect (no variation in means among groups)
girishchadha.gc@gmail.com
JV65UCK2AH
•
H• 1At: Not
leastall
oneofpopulation
the population
mean ismeans are equal
different
• i.e., there is a factor effect
• Does not mean that all population means are different
(some pairs may be the same)
Proprietary content. ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
This file is meant for personal use by girishchadha.gc@gmail.com only.
Sharing or publishing the contents in part or full is liable for legal action.
One-Way ANOVA
H0 : μ1 = μ2 = μ3 = = μc
H1 : Not all μ j are equal
The Null Hypothesis is True
girishchadha.gc@gmail.com
All Means are the same:
JV65UCK2AH
(No Factor Effect)
μ1 = μ 2 = μ 3
This file is meant for personal use by girishchadha.gc@gmail.com only.
Sharing or publishing the contents in part or full is liable for legal action.
Proprietary content. ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
One-Way ANOVA
(continued)
H0 : μ1 = μ2 = μ3 = = μc
H1 : Not all μ j are equal
The Null Hypothesis is NOT true
girishchadha.gc@gmail.com
JV65UCK2AH
At least one of the means is different
(Factor Effect is present)
or
μ1 = μ2 μ3 μ1 μ2 μ3
This file is meant for personal use by girishchadha.gc@gmail.com only.
Proprietary content. ©Great Learning.
Sharing All Rights
or publishing Reserved.
the contents Unauthorized
in part or full is liable for use
legal or distribution
action. prohibited.
Partitioning the Variation
• Total variation can be split into two parts:
girishchadha.gc@gmail.com
JV65UCK2AH
SST = ( Xij − X) 2
girishchadha.gc@gmail.com
JV65UCK2AH
Where: j=1 i=1
2 2 2
SST = ( X 11 − X ) + ( X 12 − X ) + + ( X cn − X )
c
girishchadha.gc@gmail.com
JV65UCK2AH
Response, X
SSA
Variation Due to
MSA =
girishchadha.gc@gmail.com
JV65UCK2AH
Differences Among Groups
c −1
Mean Square Among =
SSA/degrees of freedom
i j
This file is meant for personal use by girishchadha.gc@gmail.com only.
Proprietary content. ©Great Learning.
Sharing All Rights
or publishing Reserved.
the contents Unauthorized
in part or full is liable for use
legal or distribution
action. prohibited.
Among-Group Variation
(continued)
SSA = n1 (X1 − X) + n 2 (X 2 − X) + + n c (X c − X)
2 2 2
girishchadha.gc@gmail.com
JV65UCK2AH
Response, X
X3
X2 X
X1
SSW = ( Xij − X j ) 2
girishchadha.gc@gmail.com
JV65UCK2AH
j=1 i=1
Where:
SSW = Sum of squares within groups
c = number of groups
nj = sample size from group j
Xj = sample mean from group j
Xij = ith observation in group j
This file is meant for personal use by girishchadha.gc@gmail.com only.
Proprietary content. ©Great Learning.
Sharing All Rights
or publishing Reserved.
the contents Unauthorized
in part or full is liable for use
legal or distribution
action. prohibited.
Within-Group Variation
(continued)
c nj
SSW = ( Xij − X j )2
j=1 i=1
SSW
Summing the variation
MSW =
girishchadha.gc@gmail.com
JV65UCK2AH
within each group and then
adding over all groups n−c
Mean Square Within =
SSW/degrees of freedom
μj
This file is meant for personal use by girishchadha.gc@gmail.com only.
Proprietary content. ©Great Learning.
Sharing All Rights
or publishing Reserved.
the contents Unauthorized
in part or full is liable for use
legal or distribution
action. prohibited.
Within-Group Variation
(continued)
girishchadha.gc@gmail.com
JV65UCK2AH Response, X
X3
X2
X1
SST
MST = Mean Square Total
n −1 (d.f. = n-1)
This file is meant for personal use by girishchadha.gc@gmail.com only.
Proprietary content. ©Great Learning.
Sharing All Rights
or publishing Reserved.
the contents Unauthorized
in part or full is liable for use
legal or distribution
action. prohibited.
One-Way ANOVA Table
c = number of groups
n = sum of the sample sizes from all groups
df = degrees of freedom
This file is meant for personal use by girishchadha.gc@gmail.com only.
Proprietary content. ©Great Learning.
Sharing All Rights
or publishing Reserved.
the contents Unauthorized
in part or full is liable for use
legal or distribution
action. prohibited.
One-Way ANOVA
F Test Statistic
H0: μ1= μ2 = … = μc
H1: At least two population means are different
• Test statistic
MSA
girishchadha.gc@gmail.com
JV65UCK2AH FSTAT =
MSW
MSA is mean squares among groups
MSW is mean squares within groups
• Degrees of freedom
• df1 = c – 1 (c = number of groups)
• df2 = n – c (n = sum of sample sizes from all populations)
Decision Rule:
◼ Reject H0 if FSTAT > Fα,
otherwise do not reject
H0 0 Do not Reject H0
reject H0
This file is meant for personal use by girishchadha.gc@gmail.com only.
Fα
Proprietary content. ©Great Learning.
Sharing All Rights
or publishing Reserved.
the contents Unauthorized
in part or full is liable for use
legal or distribution
action. prohibited.
One-Way ANOVA
F Test Example
1
This file is meant for personal use by girishchadha.gc@gmail.com only.
2 3
Proprietary content. ©Great Learning.
Sharing All Rights
or publishing Reserved.
the contents Unauthorized
in part or full is liable for use
legal or Club
distribution
action. prohibited.
One-Way ANOVA Example
Computations
Club 1 Club 2 Club 3 X1 = 249.2 n1 = 5
254 234 200 X2 = 226.0 n2 = 5
263 218 222
X3 = 205.8 n3 = 5
241 235 197
girishchadha.gc@gmail.com
JV65UCK2AH 237 227 206 n = 15
X = 227.0
251 216 204 c=3
SSA = 5 (249.2 – 227)2 + 5 (226 – 227)2 + 5 (205.8 – 227)2 = 4716.4
SSW = (254 – 249.2)2 + (263 – 249.2)2 +…+ (204 – 205.8)2 = 1119.6
Critical Decision:
Value:
Reject H0 at = 0.05
Fα = 3.89
= .05 Conclusion:
There is evidence that
0 Do not Reject H 0
at least one μj differs
reject H0
FSTAT = 25.275 from the rest
Fα = 3.89
This file is meant for personal use by girishchadha.gc@gmail.com only.
Proprietary content. ©Great Learning.
Sharing All Rights
or publishing Reserved.
the contents Unauthorized
in part or full is liable for use
legal or distribution
action. prohibited.
One-Way ANOVA
Excel Output
SUMMARY
Groups Count Sum Average Variance
Club 1 5 1246 249.2 108.2
Club 2 5 1130 226 77.5
girishchadha.gc@gmail.com
JV65UCK2AH
Club 3 5 1029 205.8 94.2
ANOVA
Source of
SS df MS F P-value F crit
Variation
Between
4716.4 2 2358.2 25.275 0.0000 3.89
Groups
Within
1119.6 12 93.3
Groups
Total 5836.0 14
This file is meant for personal use by girishchadha.gc@gmail.com only.
Proprietary content. ©Great Learning.
Sharing All Rights
or publishing Reserved.
the contents Unauthorized
in part or full is liable for use
legal or distribution
action. prohibited.
ANOVA Assumptions
• Randomness and Independence
• Select random samples from the c groups (or randomly
assign the levels)
girishchadha.gc@gmail.com
JV65UCK2AH
• Normality
• The sample values for each group are from a normal
population
• Homogeneity of Variance
• All populations sampled from have the same variance
• Can be tested with Levene’s Test
• Assumptions
Total Variation: r c n
SST = ( Xijk − X) 2
i=1 j=1 k =1
girishchadha.gc@gmail.com
JV65UCK2AH
Factor A Variation: r
SSA = cn ( Xi.. − X)
2
i=1
Factor B Variation: c
SSB = rn ( X. j. − X)2
j=1
This file is meant for personal use by girishchadha.gc@gmail.com only.
Proprietary content. ©Great Learning.
Sharing All Rights
or publishing Reserved.
the contents Unauthorized
in part or full is liable for use
legal or distribution
action. prohibited.
Two-Way ANOVA Equations
(continued)
Interaction Variation:
r c
girishchadha.gc@gmail.com
JV65UCK2AH SSAB = n ( Xij. − Xi.. − X.j. + X)2
i =1 j=1
i =1 j =1 k =1
where: X
i=1 j=1 k =1
ijk
X= = Grand Mean
c n
rcn
X
j=1 k =1
ijk
girishchadha.gc@gmail.com
JV65UCK2AH Xi.. = = Mean of ith level of factor A (i = 1, 2, ..., r)
cn
r n
X ijk
X. j. = i=1 k =1
= Mean of jth level of factor B (j = 1, 2, ..., c)
rn
n
Xijk
Xij. =
r = number of levels of factor A
= Mean of cell ij
k =1 n
c = number of levels of factor B
n’ = number of replications in each cell
This file is meant for personal use by girishchadha.gc@gmail.com only.
Proprietary content. ©Great Learning.
Sharing All Rights
or publishing Reserved.
the contents Unauthorized
in part or full is liable for use
legal or distribution
action. prohibited.
Mean Square Calculations
SSA
MSA = Mean square factor A =
r −1
SSB
girishchadha.gc@gmail.com MSB = Mean square factor B =
JV65UCK2AH
c −1
SSAB
MSAB = Mean square interactio n =
(r − 1)(c − 1)
SSE
MSE = Mean square error =
rc(n'−1)
This file is meant for personal use by girishchadha.gc@gmail.com only.
Proprietary content. ©Great Learning.
Sharing All Rights
or publishing Reserved.
the contents Unauthorized
in part or full is liable for use
legal or distribution
action. prohibited.
Two-Way ANOVA:
The F Test Statistics
F Test for Factor A Effect
H0: μ1..= μ2.. = μ3..= • • = µr..
MSA Reject H0 if
H1: Not all μi.. are equal FSTAT =
MSE FSTAT > Fα
girishchadha.gc@gmail.com
JV65UCK2AH F Test for Factor B Effect
H0: μ.1. = μ.2. = μ.3.= • • = µ.c.
MSB Reject H0 if
H1: Not all μ.j. are equal FSTAT =
MSE FSTAT > Fα
MSA MSA
Factor A SSA r–1
girishchadha.gc@gmail.com
= SSA /(r – 1) MSE
JV65UCK2AH
MSB MSB
Factor B SSB c–1
= SSB /(c – 1) MSE
AB MSAB MSAB
SSAB (r – 1)(c – 1)
(Interaction) = SSAB / (r – 1)(c – 1) MSE
MSE =
Error SSE rc(n’ – 1)
SSE/rc(n’ – 1)
Total SST n–1
This file is meant for personal use by girishchadha.gc@gmail.com only.
Proprietary content. ©Great Learning.
Sharing All Rights
or publishing Reserved.
the contents Unauthorized
in part or full is liable for use
legal or distribution
action. prohibited.
Features of Two-Way ANOVA
F Test
• Degrees of freedom always add up
• n-1 = rc(n’-1) + (r-1) + (c-1) + (r-1)(c-1)
• Total = error + factor A + factor B + interaction
girishchadha.gc@gmail.com
JV65UCK2AH
• The denominators of the F Test are always the same
but the numerators are different
• The sums of squares always add up
• SST = SSE + SSA + SSB + SSAB
• Total = error + factor A + factor B + interaction
girishchadha.gc@gmail.com
JV65UCK2AH Factor B Level 1
Mean Response
Mean Response
Factor B Level 1
Factor B Level 3
Factor B Level 2
Factor B Level 2
Factor B Level 3