ANOVA
ANOVA
ANOVA
Variance
Introduction
• Analysis of variance compares two
or more populations of interval
data.
• Specifically, we are interested in
determining whether differences
exist between the population
means.
• The procedure works by analyzing
the sample variance.
One Way Analysis of
Variance
• Solution
– The data are interval
– The problem objective is to
compare sales in three cities.
– We hypothesize that the three
population means are equal
Defining the Hypotheses
•Solution
H 0: µ 1 = µ 2= µ 3
H1: At least two means differ
To build the statistic needed to
test the
hypotheses use the following
notation:
Notation
e n d e n t sa m p le s a re d ra w n fro m k p o p u la tio n s ( tre a t
1 2 k
First observation, X 11 X 12 X 1k
first sample x 21 x 22 x 2k
. . .
. . .
Second observation, . . .
second sample X n1,1 X n2,2 X nk,k
n1
n2 nk
x1
x2 xk
Sample size
Sample
mean
X is the “response variable”.
The variables’ value are called “responses”.
Terminology
25
x3 = 20
x3 = 20
20 20
19
x2 = 15
16 x2 = 15
15
14
x1 = 10 12
11 x1 = 10
10 10
9 9
T h is su m is ca lle d th e
S u m o f S quares for Treatments
In ourexample treatments are SST
represented by the different
advertising strategies.
Sum of squares for
treatments (SST)
k
SST= ∑ nj (xj − x) 2
j=1
H0: µ 1 = µ 2 = …=µ k
H1: At least two means differ
SUMM ARY
G roups Count Sum Average Variance
Conv enience 20 11551 577. 55 10775. 00
Q uality 20 13060 653. 00 7238. 11
Price 20 12173 608. 65 8670. 24
ANO VA
Source of Variation SS df MS F P-value F crit
Between G roups 57512 2 28756 3. 23 0. 0468 3. 16
W ithin G roups 506984 57 8894
Total 564496 59
Response
Treatment 3 (level 1)
Treatment 2 (level 2)
Treatment 1 (level 3)
Level 3
Level2
Level 1 Fa cto r A
Level2 Level 1
Factor B
Two-Factor Analysis of
Variance -
• Example
– Suppose in the Example, two factors
are to be examined:
• The effects of the marketing strategy
on sales.
– Emphasis on convenience
– Emphasis on quality
– Emphasis on price
• The effects of the selected media on
sales.
– Advertise on TV
– Advertise in newspapers
Attempting one-way ANOVA
• Solution
– We may attempt to analyze
combinations of levels, one from
each factor using one-way ANOVA.
– The treatments will be:
• Treatment 1: Emphasize convenience
and advertise in TV
• Treatment 2: Emphasize convenience
and advertise in newspapers
• …………………………………………………
………………….
• Treatment 6: Emphasize price and
Attempting one-way ANOVA
• Solution
– The hypotheses tested are:
• H0: µ 1= µ 2= µ 3= µ 4= µ 5= µ 6
• H1: At least two means differ.
Attempting one-way ANOVA
•S o lu–tiIon e a ch o n e o f six citie s sa le s a re
n re co rd e d fo r te n
weeks .
– In e a ch city a d iffe re n t co m b in a tio n o f
m a rke tin g
•
emphasis and media usage is
• e m p lo ye dCity2
City1 . City3 City4 City5
City6
Convnce Convnce Quality Quality Price
Price
• TV Paper TV Paper TV
Paper
Attempting one-way ANOVA
• Solutio
C ity1
n C ity2 C ity3 C ity4 C ity5
C ity6
C o n vn ce C o n vn ce Q u a lity Q u a lity Price
Price
TV Pa p e r TV Pa p e r TV
Pa p e r
T h e p -va lu e =. 0 4 5 2 .
W e co n clu d e th a t th e re is e vid e n ce th a t d iffe re n ce s
exist in the mean weekly sales among the six cities.
Interesting questions – no
answers
A re th e re d iffe re n ce s in th e m e a n sa le s
ca u se d b y d iffe re n t a d ve rtisin g m e d ia ?
Two-way ANOVA (two
factors)
y e
C ity 1 City C ity 5
TV
TV
Factor B:
3
sa le s sales sa le s
∑
SS(A) = rb
i=1
(x[A]i − x)2 (10(2){(xconv. − x) 2 + ( xquality − x) 2 + ( x price − x) 2 }
∑
SS(B) = ra
j=1
(x[B]j − x)2 (10 )(3){( xTV − x) 2 + ( x Newspaper − x ) 2 }
a b
SS(AB) = r∑ ∑ (x[AB]ij − x[A]i − x[B]j + x)2
i=1 j=1
a b r
SSE = ∑∑∑
i =1 j =1 k =1
( xijk − x[ AB ]ij ) 2
F tests for the Two-way ANOVA
• Example – continued
– Test of the difference in mean sales between the
three marketing strategies
• H0: µ conv. =µ quality =µ price
• H1: At least two mean sales are different
ANOVA
Source of Variation SS df MS F P-value F crit
Sample 13172.0 1 13172.0 1.42 0.2387 4.02
Columns 98838.6 2 49419.3 5.33 0.0077 3.17
Interaction 1609.6 2 804.8 0.09 0.9171 3.17
Within 501136.7 54 9280.3
Total 614757.0 59
• Example - continued
– Test of the difference in mean sales
between the two advertising media
• H0: µ TV. = µ Nespaper
• H1: The two mean sales differ
ANOVA
Source of Variation SS df MS F P-value F crit
Sample 13172.0 1 13172.0 1.42 0.2387 4.02
Columns 98838.6 2 49419.3 5.33 0.0077 3.17
Interaction 1609.6 2 804.8 0.09 0.9171 3.17
Within 501136.7 54 9280.3
Total 614757.0 59
Fa cto r B = A d ve rtisin g m e d ia
F tests for the Two-way ANOVA
• Example - continued
– Test of the difference in mean sales
between the two advertising media
• H 0: µ TV. =µ Nespaper
• H1: The two mean salesMdiffer
S ( B ) /M S E
•
F = MS(Media)/MSE = 1.42
• Fcritical = Fα , a-1,n-ab = F.05,2-1,60-(3)(2) = 4.02 (p-
value = .2387)
–
– At 5% significance level there is
insufficient evidence to infer that
differences in weekly sales exist
F tests for the Two-way ANOVA
• Example - continued
– Test for interaction between factors A
and B
• H 0: µ TV*conv. =µ TV*quality =…=µ newsp.*price
• H1: At least two means differ
ANOVA
Source of Variation SS df MS F P-value F crit
Sample 13172.0 1 13172.0 1.42 0.2387 4.02
Columns 98838.6 2 49419.3 5.33 0.0077 3.17
Interaction 1609.6 2 804.8 0.09 0.9171 3.17
W ithin 501136.7 54 9280.3
Total 614757.0 59
• Example - continued
– Test for interaction between factor A and
B
• H 0: µ TV*conv. =µ =…=µ
TV*qualityB ) /M
M S ( A new SE
sp.*price
• H1: At least two means differ
•
F = MS(Marketing*Media)/MSE = .09