ANOVA
The beauty of ANOVA is that it performs the
test of equality of more than two population
means by actually analyzing the variance.
In simple terms, ANOVA decomposes the
total variation into components of variation.
That is, explaining the changes in the
response
variable
caused
by
these
components. To put it succinctly, the total
sum of squares is equal to the sum of
squares due to causes.
Chain1
15
14
20
15
16
Chain2
10
14
9
10
11
Chain3
17
12
14
15
12
SS
df
MS
68.8
34.40
Error(Within Groups)
54.8
12
4.57
123.6
14
Total
F computed
7.53
F critical
3.89
H0 :
The population means of percentage stock out position
for all the
three chains are equal
H1 :
The population means of percentage stock out position
for all the
three chains are not equal
One-Way ANOVA
Purpose: Examines two or more levels of
an independent variable to determine if
their population means could be equal.
Hypotheses:
H0: 1 = 2 = ... = t *
H1: At least one of the treatment group
means differs from the rest. OR At least
two of the population means are not
equal.
* where t = number of treatment groups or levels
Calculations, cont.:
Sum of squares treatment (SSTR) = sum of squared
differences between each group mean and the grand mean,
balanced by sample size... between-groups variation (not
variance).
SSTR
n ( x x)2
j
j
SSE (x x )2
ij j
64 50 71 55 67 61 80 56 59
1+ rider(s): 44 52 54 48 69 67 54 57 58
51 62 67
a. What are the null and alternative hypotheses?
H 0: 1 = 2
where Group 1 = driver alone
H 1: 1 2
x 63.7,s 9.3577,n 10
1
1
1
x 56.916,s 7.806,n 12
2
2
2
x 60.0
2
2
H1: 1 2
c. p-value:
To find the p-value, in a cell within a Microsoft Excel
spreadsheet, type: =FDIST(3.38,1,20)
The answer is: p-value = 0.0809
56
.
917
2
.
086
x
Sample
for
One
or
More
Riders:
n
12
Store
79
78
81
80
70
81
86
87
83
74
74
89
84
81
77
77
97
94
88
89
66
86
82
83
68
SS
617.36
461.76
282.64
1361.76
df
4
4
16
24
MS
F
P-value F crit
154.34 8.737051 0.000614 3.006917
115.44 6.534956 0.002575 3.006917
17.665
Calculations:
Variations - Sum of Squares:
SST = SSTR + SSB + SSE
ij
Calculations, cont.:
Sum of squares treatment (SSTR) = sum of
squared differences between each treatment
group mean and the grand mean, balanced by
sample size... between-treatment-groups variation
(not variance). SSTR n( x x)2
j
Calculations, cont.:
Sum of squares error (SSE):
SSE = SST SSTR SSB
Variances - Mean Squares:
Mean square treatment (MSTR) = SSTR/(t
1) where t is the number of treatment groups...
between-treatment-groups variance.
Calculations, cont.:
(t 1)(n1)
Mean square error:
where t is the number of treatment groups and n is
the number of block groups... within-groups variance
unexplained by either the treatment or the block
group.
Two-Way ANOVA
Purpose: Examines (1) the
effect of Factor A on the
dependent variable, y; (2) the
effect of Factor B on the
dependent variable, y; along
with (3) the effects of the
interactions between different
levels of the two factors on the
dependent variable , y.
Two-Way ANOVA
Factor A Effect:
H0: 1 = 2 = ... = a for treatment groups 1 through a
H1: At least one Factor A level mean differs from the
rest.
Factor B Effect:
H0: 1 = 2 = ... = b for block groups 1 through b
H1: At least one Factor B level mean differs from the
rest.
Interaction Effect:
H0: There are no interaction effects.
H1: At least one combination of Factor A and Factor B
levels has an effect on the dependent variable.
Two-Way ANOVA
Two-Way ANOVA
Calculations, cont.:
Sum of squares Factor A (SSA) = sum
of squared differences between each group
mean for Factor A and the grand mean, balanced
by sample size... between-factor-groups variation
(not
SSAvariance).
rb(x x)2
Two-Way ANOVA
Calculations, cont.:
Sum of squares Error (SSE) = sum of
squared differences between individual values
and their cell mean... within-groups variation
(not variance).
2
SSE (x x )
ij
Two-Way ANOVA
Calculations: Variances - Mean
Squares
Mean Square Factor A (MSA) = SSA/(a
1), where a = the number of levels of
Factor A ... between-levels variance,
Factor A.
Mean Square Factor B (MSB) = SSB/(b
1), where b = the number of levels of
Factor B ... between-levels variance,
Factor B.
Two-Way ANOVA
Calculations - Variances, cont.:
Mean Square Interaction (MSAB) =
SSAB/(a 1)(b 1). Controls the size of
SSE by removing fluctuation due to the
combined effect of Factor A and Factor B.
Mean Square Error (MSE) = SSE/ab(r
1), where ab(r 1) = the degrees of
freedom on error ... the within-groups
variance.
Two-Way ANOVA
Calculations - F-Ratios:
F-Ratio, Factor A = MSA/MSE, where
numerator degrees of freedom are a 1
and denominator degrees of freedom are
ab(r 1). This F-ratio is the test statistic
for the hypothesis that the Factor A group
means are equal. To reject the null
hypothesis means that at least one Factor
A group had a different effect on the
dependent variable than the rest.
Two-Way ANOVA
Calculations - F-Ratios:
F-Ratio, Factor B = MSB/MSE, where
numerator degrees of freedom are b 1
and denominator degrees of freedom are
ab(r 1). This F-ratio is the test statistic
for the hypothesis that the Factor B group
means are equal. To reject the null
hypothesis means that at least one
Factor B group had a different effect on
the dependent variable than the rest.
Two-Way ANOVA
Calculations - F-Ratios:
F-Ratio, Interaction = MSAB/MSE,
where numerator degrees of freedom are
(a 1)( b 1) and denominator degrees
of freedom are ab(r 1). This F-ratio is
the test statistic for the hypothesis that
Factors A and B operate independently.
To reject the null hypothesis means that
there is some relationship where levels of
Factor A operate differently with different
levels of Factor B.