Topic 5 Analysis of Variance
Topic 5 Analysis of Variance
Analysis of Variance
Chapter Outcomes
One-Way Two-factor
ANOVA ANOVA
with replication
F-test
Tukey-
Kramer
test
General ANOVA Setting
Investigator controls one or more independent
variables
Called factors (or treatment variables)
Each factor contains two or more levels (or
categories/classifications)
Observe effects on dependent variable
Response to levels of independent variable
Experimental design: the plan used to test
hypothesis
One-Way Analysis of Variance
Assumptions
Populations are normally distributed
H0 : μ1 μ2 μ3 μk
All population means are equal
i.e., no treatment effect (no variation in means among
groups)
HA : Not all of the population means are the same
At least one population mean is different
i.e., there is a treatment effect
Does not mean that all population means are different (some
pairs may be the same)
One-Factor ANOVA
H0 : μ1 μ2 μ3 μk
HA : Not all μi are the same
μ1 μ2 μ3
One-Factor ANOVA
(continued)
H0 : μ1 μ2 μ3 μk
HA : Not all μi are the same
At least one mean is different:
The Null Hypothesis is NOT true
(Treatment Effect is present)
or
μ1 μ2 μ3 μ1 μ2 μ3
Partitioning the Variation
Total variation can be split into two parts:
i1 j1
Where:
SST = Total sum of squares
k = number of populations (levels or treatments)
ni = sample size from population i
xij = jth measurement from population i
x = grand mean (mean of all data values)
Total Variation
(continued)
Resp o n se , X
i 1
Where:
SSB = Sum of squares between
k = number of populations
ni = sample size from population i
xi = sample mean from population i
x = grand mean (mean of all data values)
Between-Group Variation
k
SSB ni ( x i x ) 2
i 1
SSB
Variation Due to
MSB
Differences Among Groups
k 1
Mean Square Between =
SSB/degrees of freedom
i j
Between-Group Variation
(continued)
SSB n1 ( x1 x ) n 2 ( x 2 x ) ... nk ( x k x )
2 2 2
Re s p o n s e , X
X3
X2 X
X1
SSW ( x ij x i ) 2
i1 j1
Where:
SSW = Sum of squares within
k = number of populations
ni = sample size from population i
xi = sample mean from population i
xij = jth measurement from population i
Within-Group Variation
k nj
SSW ( x ij x i )2
i1 j1
SSW
Summing the variation within
MSW
each group and then adding
over all groups Nk
Mean Square Within =
SSW/degrees of freedom
i
Within-Group Variation
(continued)
Re s p o n s e , X
X3
X2
X1
i 1
One-Way ANOVA Table
Source of SS df MS F ratio
Variation
Between SSB MSB
SSB k-1 MSB = F=
Samples k-1 MSW
Within SSW
SSW N-k MSW =
Samples N-k
Total SST = N-1
SSB+SSW
k = number of populations
N = sum of the sample sizes from all populations
df = degrees of freedom
One-Factor ANOVA
F Test Statistic
H0: μ1= μ2 = … = μ k
HA: At least two population means are different
Test statistic
MSB
F
MSW
MSB is mean squares between variances
MSW is mean squares within variances
Degrees of freedom
df1 = k – 1 (k = number of populations)
df2 = N – k (N = sum of sample sizes from all populations)
Interpreting One-Factor ANOVA
F Statistic
The F statistic is the ratio of the between
estimate of variance and the within estimate of
variance
The ratio must always be positive
df1 = k -1 will typically be small
df2 = N - k will typically be large
1 2 3
Club
One-Factor 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
237 227 206 N = 15
x = 227.0
251 216 204 k=3
SSB = 5 [ (249.2 – 227)2 + (226 – 227)2 + (205.8 – 227)2 ] = 4716.4
SSW = (254 – 249.2)2 + (263 – 249.2)2 +…+ (204 – 205.8)2 = 1119.6
ANOVA
Source of
Variation SS df MS
Between
Groups 5011583.333 2 2505791.667
Within
Groups 21080416.67 27 780756.1728
Total 26092000 29