You are on page 1of 25

Session 5

Analysis of Variance

Pre University-Mathematics for Business


1

Learning Objectives
Be able to use one-way analysis of variance to
test for differences among the means of several
populations

Hypotheses of One-Way
ANOVA
H0 : 1 2 3 c
All population means are equal
i.e., no treatment effect (no variation in means among
groups)

H1 : 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)
3

One-Factor ANOVA
H0 : 1 2 3 c
H1 : Not all j are the same
All Means are the same:
The Null Hypothesis is True
(No Treatment Effect)

1 2 3
4

One-Factor ANOVA

(continued)

H0 : 1 2 3 c
H1 : Not all j 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
5

Partitioning the Variation


Total variation can be split into two parts:
SST = SSA + SSW
SST = Total Sum of Squares
(Total variation)
SSA = Sum of Squares Among Groups
(Among-group variation)
SSW = Sum of Squares Within Groups
(Within-group variation)

Partitioning the Variation


(continued)

SST = SSA + SSW


Total Variation = the aggregate dispersion of the individual data
values across the various factor levels (SST)
Among-Group Variation = dispersion between the factor
sample means (SSA)
Within-Group Variation = dispersion that exists among the
data values within a particular factor level (SSW)
7

Partition of Total Variation


Total Variation (SST)
d.f. = n 1

Variation Due to
Factor (SSA)

Variation Due to Random


Sampling (SSW)

d.f. = c 1

d.f. = n c
Commonly referred to as:
Sum of Squares Within
Sum of Squares Error
Sum of Squares Unexplained
Within-Group Variation
8

Total Sum of Squares


SST = SSA + SSW
c

nj

SST ( Xij X)
Where:

j1 i 1

SST = Total sum of squares


c = number of groups (levels or treatments)
nj = number of observations in group j
Xij = ith observation from group j
X = grand mean (mean of all data values)
9

Total Variation
(continued)

SST ( X11 X)2 ( X12 X)2 ... ( Xcnc X)2


R esponse, X

X
G ro u p 1

G ro u p 2

G ro u p 3
10

Among-Group Variation
SST = SSA + SSW
c

SSA n j ( X j X)2
j1

Where:

SSA = Sum of squares among groups


c = number of groups
nj = sample size from group j
Xj = sample mean from group j
X = grand mean (mean of all data values)
11

Among-Group Variation
(continued)
c

SSA n j ( X j X)2
j 1

Variation Due to
Differences Among Groups

SSA
MSA
c 1
Mean Square Among =
SSA/degrees of freedom

j
12

Among-Group Variation
(continued)

SSA n1 ( x1 x ) n2 ( x 2 x ) ... nc ( x c x )
2

R esponse, X

X3
X1
G ro u p 1

G ro u p 2

X2
G ro u p 3
13

Within-Group Variation
SST = SSA + SSW
c

SSW
j1

nj

i 1

( Xij X j )

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

14

Within-Group Variation
(continued)
c

SSW
j1

nj

i 1

( Xij X j )2

Summing the variation within


each group and then adding
over all groups

SSW
MSW
nc
Mean Square Within =
SSW/degrees of freedom

15

Within-Group Variation
(continued)

SSW ( x11 X1 ) ( X12 X 2 ) ... ( Xcnc Xc )


2

R esponse, X

X1
G ro u p 1

G ro u p 2

X3

X2
G ro u p 3

16

Obtaining the Mean Squares


SSA
MSA
c 1
SSW
MSW
nc
SST
MST
n 1
17

One-Way ANOVA Table


Source of
Variation

SS

df

Among
Groups

SSA

c-1

Within
Groups

SSW

n-c

Total

SST =
SSA+SSW

MS

(Variance)
SSA
MSA
MSA =
c - 1 F = MSW
SSW
MSW =
n-c

n-1

c = number of groups
n = sum of the sample sizes from all groups
df = degrees of freedom

F ratio

18

One-Way ANOVA
F Test Statistic
H0: 1= 2 = = c
H1: At least two population means are different

Test statistic

MSA
F
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
populations)

(n = sum of sample sizes from all


19

Interpreting One-Way ANOVA


F Statistic
The F statistic is the ratio of the
among estimate of variance and the
within estimate of variance
The ratio must always be positive
df1 = c -1 will typically be small
df2 = n - c will typically be large

Decision Rule:
Reject H if F > F ,
0
U
otherwise do not
reject H0

= .05

Do not
reject H0

Reject H0
20

FU

One-Way ANOVA
F Test Example
You want to see if three
different golf clubs yield
different distances. You
randomly select five
measurements from trials on
an automated driving
machine for each club. At the
0.05 significance level, is
there a difference in mean
distance?

Club 1
254
263
241
237
251

Club 2
234
218
235
227
216

21

Club 3
200
222
197
206
204

One-Way ANOVA Example:


Scatter Diagram
Club 1
254
263
241
237
251

Club 2
234
218
235
227
216

Club 3
200
222
197
206
204

Distance
270
260
250
240
230

220
210

x1 249.2 x 2 226.0 x 3 205.8

200

x 227.0

190

X1

X2

222
Club

X
X3

One-Way ANOVA Example


Computations
Club 1
254
263
241
237
251

Club 2
234
218
235
227
216

Club 3
200
222
197
206
204

X1 = 249.2

n1 = 5

X2 = 226.0

n2 = 5

X3 = 205.8

n3 = 5

X = 227.0

n = 15
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
MSA = 4716.4 / (3-1) = 2358.2
MSW = 1119.6 / (15-3) = 93.3

2358.2
F
25.275
93.3
23

One-Way ANOVA Example


Solution
Test Statistic:

H 0: 1 = 2 = 3
H1: j not all equal
= 0.05
df1= 2
df2 = 12

MSA 2358.2
F

25.275
MSW
93.3

Critical
Value:
FU = 3.89
= .05

Do not
reject H0

Reject H0

FU = 3.89

F = 25.275

Decision:
Reject H0 at = 0.05
Conclusion:
There is evidence that at
least one j differs from
24
the rest

One-Way ANOVA Output


SUMMARY
Groups

Count

Sum

Average

Variance

Club 1

1246

249.2

108.2

Club 2

1130

226

77.5

Club 3

1029

205.8

94.2

ANOVA
Source of
Variation

SS

df

MS

Between
Groups

4716.4

2358.2

Within
Groups

1119.6

12

93.3

Total

5836.0

14

F
25.275

P-value
4.99E-05

25

F crit
3.89

You might also like