Analysis of Variance (ANOVA)
Analysis of Variance (ANOVA)
groups
Experimental
Designs
One-Way Two-Way
Anova Anova
2. Variables
– One categorical Independent Variable
– One Continuous Dependent Variable
9
Hypotheses
H0: 1 = 2 = 3 = ... = p
– All Population Means
f(X)
are Equal
– No Treatment Effect
X
Ha: Not All j Are Equal 1 = 2 = 3
– At Least 1 Pop. Mean
is Different f(X)
– Treatment Effect
– NOT 1 = 2 = ... = p
X
– Or i ≠ j for some i, j. 1 = 2 3
10
One-Way ANOVA Basic Idea
1. Compares 2 Types of Variation to Test
Equality of Means
2. If Treatment Variation Is Significantly Greater
Than Random Variation then Means Are Not
Equal
3.Variation Measures Are Obtained by
‘Partitioning’ Total Variation
Total variation
Response, x
x
Response, x
x3
x
x2
x1
Response, x
x3
x2
x1
Do Not
Reject H0
0 F
Fa ( p 1, n p)
Always One-Tail!
© 1984-1994 T/Maker Co.
School of Public Health 20
HOW TO CALCULATE ANOVA’S BY HAND…
y
10 10 10
1j y2 j y3 j y 4j The group
j 1 j 1
y1 y 2
j 1
y 3
j 1 y 4 means
10 10 10 10
10 10 10
(y
10
y 2 ) 2 (y
j 1
( y1 j y1 ) 2
j 1
2j
j 1
( y 3 j y 3 ) 2
j 1
4j y 4 ) 2
The (within) 21
10 1 10 1 10 1 10 1 group
variances
School of Public Health
SSW/SSE
10 10 10
(y
10 2
( y1 j y1 ) 2
j 1
2j y 2 )
j 1
( y 3 j y 3 ) 2
(y
j 1
4j y 4 ) 2
The (within)
j 1
group
10 1 10 1 10 1 10 1 variances
10 10
10 10
(y 1j y1 ) +2
(y 2j y 2 ) + 2
( y 3 j y 3 ) 2 + j 1
( y 4 j y 4 ) 2
j 1 j 3
j 1
4 10
i 1 j 1
22
SSB/SSR
4 10
Overall
mean of all y
i 1 j 1
ij
40
observation y
s (“grand 40
mean”)
4 Sum of Squares
(y y ) 2 Between (SSB).
10x i
Variability of the
group means
i 1 compared to the
grand mean (the
variability due to the
treatment).
23
Total Sum of Squares (SST)
Total sum of
4 10 squares(TSS).
Squared difference
( y ij y ) 2 of every observation
from the overall
i 1 j 1 mean. (numerator of
variance of Y!)
24
Partitioning of Variance
4 10 4 4 10
( y
i 1 j 1
ij y i ) 2
+10x ( y i y ) 2 = ( y ij y ) 2
i 1 i 1 j 1
SSW + SSB =
TSS
25
ANOVA Table
Mean Sum
Source of Sum of
of Squares
variation d.f. squares
F-statistic p-value
TSS
Total nk-1 (sum of squared deviations of
variation observations from grand mean)
TSS=SSB + SSW
26
Example
Treatment 1 Treatment 2 Treatment 3 Treatment 4
60 inches 50 48 47
67 52 49 67
42 43 50 54
67 67 55 67
56 67 56 68
62 59 61 65
64 67 61 65
59 64 60 56
72 63 59 60
71 65 64 65
27
Example
28
Example
42 43 50 54
squared deviations) = 71 65 64 65
2060.6
29
Fill in the ANOVA table
Total 39 2257.1
30
Fill in the ANOVA table
Total 39 2257.1
INTERPRETATION of ANOVA:
How much of the variance in height is explained by treatment
group?
R2=“Coefficient of Determination” = SSB/TSS =
196.5/2275.1=9%
31
Coefficient of Determination
2 SSB SSB
R
SSB SSE SST
The amount of variation in the outcome variable
(dependent variable) that is explained by the predictor
(independent variable).
32
34
35
36
38
Steps in Performing Tukey Tests
• Take the difference of the means of the
conditions you are comparing
• If the difference of the means is at least as large
as the HSD, you can reject H0
• Repeat for whatever other comparisons need to
be made
39
40
43
44
Bonferroni and Sidak test
Bonferroni procedures
Bonferroni adjustment simply reduces the
comparisons of interest based on the number of
comparisons being made
Use ` = where c is the number of comparisons
Technically we could adjust in such a fashion that
some comparisons are more liberal than others, but
this is the default approach in most statistical
packages
45
46
48
49
50
52
54
55
56
57
58
TWO-WAY ANOVA
TOTAL VARIATION PARTITIONING
Total
Total Variation
Variation
SS(Total)
Variation
VariationDue
Dueto
to Variation
VariationDue
Dueto
to
Treatment
TreatmentAA Treatment
Treatment BB
SSA SSB
Variation
VariationDue
Dueto
to
Random
Random Sampling
Sampling
SSE
59
Two-Way Summary Table
61
Example
• A physical therapist wished to compare three methods
for teaching patients to use a certain prosthetic device.
He felt that the rate of learning would be different for
patients of different ages and wished to design an
experiment in which the influence of age could be taken
into account.
62
63
64
65
66
67
70
73
74
75
81
Total
Total Variation
Variation
SS(Total)
Variation
VariationDue
Dueto
to Variation
VariationDue
Dueto
to
Treatment
TreatmentAA Treatment
Treatment BB
• SSA SSB
Variation
VariationDue
Duetoto Variation
VariationDue
Dueto
to
Interaction
Interaction Random
Random Sampling
Sampling
SS(AB) • SSE
82
83
86
91