Вы находитесь на странице: 1из 33

Chapter 13A

Analysis of Variance

Copyright 2015, 2012, 2009 Pearson Education, Inc.

Chapter 11, Slide 1

One-Way Analysis of Variance


DCOVA

Evaluate the difference among the means of three


or more groups
Examples: Number of accidents for 1st, 2nd, and 3rd shift
Expected mileage for five brands of tires

Assumptions
Populations are normally distributed
Populations have equal variances
Samples are randomly and independently drawn
Copyright 2015, 2012, 2009 Pearson Education, Inc.

Chapter 11, Slide 2

Hypotheses of One-Way ANOVA


DCOVA

H0 : 1 2 3 c

All population means are equal

i.e., no factor effect (no variation in means among


groups)

H1 : Not all of the population means are equal

At least one population mean is different

i.e., there is a factor effect

Does not mean that all population means are


different (some pairs may be the same)
Copyright 2015, 2012, 2009 Pearson Education, Inc.

Chapter 11, Slide 3

One-Way ANOVA
H0 : 1 2 3 c

DCOVA

H1 : Not all j are equal


When The Null Hypothesis is True
All Means are the same:
(No Factor Effect)

1 2 3
Copyright 2015, 2012, 2009 Pearson Education, Inc.

Chapter 11, Slide 4

One-Way ANOVA

(continued)

DCOVA

H0 : 1 2 3 c
H1 : Not all j are equal
When The Null Hypothesis is NOT true
At least one of the means is different
(Factor Effect is present)
or

1 2 3
Copyright 2015, 2012, 2009 Pearson Education, Inc.

1 2 3
Chapter 11, Slide 5

Partitioning the Variation

Total variation can be split into two parts:

DCOVA

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)

Copyright 2015, 2012, 2009 Pearson Education, Inc.

Chapter 11, Slide 6

Partitioning the Variation


(continued)

DCOVA

SST = SSA + SSW

Total Variation = the aggregate variation of the individual


data values across the various factor levels (SST)
Among-Group Variation = variation among the factor
sample means (SSA)
Within-Group Variation = variation that exists among
the data values within a particular factor level (SSW)

Copyright 2015, 2012, 2009 Pearson Education, Inc.

Chapter 11, Slide 7

Partition of Total Variation


DCOVA

Total Variation (SST)

Variation Due to
Factor (SSA)

Variation Due to Random


Error (SSW)

Copyright 2015, 2012, 2009 Pearson Education, Inc.

Chapter 11, Slide 8

Total Sum of Squares

DCOVA

SST = SSA + SSW


c

nj

SST ( Xij X)
Where:

j1 i 1

SST = Total sum of squares


c = number of groups or levels
nj = number of values in group j
Xij = ith observation from group j
X = grand mean (mean of all data values)
Copyright 2015, 2012, 2009 Pearson Education, Inc.

Chapter 11, Slide 9

Total Variation

DCOVA
(continued)

SST ( X 11 X ) ( X 12 X ) ( X cn X )

R esponse, X

X
G ro u p 1

G ro u p 2

G ro u p 3

Copyright 2015, 2012, 2009 Pearson Education, Inc.

Chapter 11, Slide 10

Among-Group Variation

DCOVA

SST = SSA + SSW


c

SSA n j ( X j X)2
Where:

j1

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)
Copyright 2015, 2012, 2009 Pearson Education, Inc.

Chapter 11, Slide 11

Among-Group Variation
(continued)
c

SSA n j ( X j X)2

DCOVA

j 1

Variation Due to
Differences Among Groups

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

Copyright 2015, 2012, 2009 Pearson Education, Inc.

Chapter 11, Slide 12

Among-Group Variation

DCOVA
(continued)

SSA n 1 (X1 X) n 2 (X 2 X) n c (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

Copyright 2015, 2012, 2009 Pearson Education, Inc.

Chapter 11, Slide 13

Within-Group Variation

DCOVA

SST = SSA + SSW


c

SSW
j 1

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
Copyright 2015, 2012, 2009 Pearson Education, Inc.

Chapter 11, Slide 14

Within-Group Variation
(continued)
c

SSW
j1

nj

i 1

DCOVA

( 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

j
Copyright 2015, 2012, 2009 Pearson Education, Inc.

Chapter 11, Slide 15

Within-Group Variation

DCOVA
(continued)

SSW (X11 X1 ) (X12 X 2 ) (X cn c X c )


2

R esponse, X

X1
G ro u p 1

G ro u p 2

X2

X3

G ro u p 3

Copyright 2015, 2012, 2009 Pearson Education, Inc.

Chapter 11, Slide 16

Obtaining the Mean Squares


DCOVA
The Mean Squares are obtained by dividing the various
sum of squares by their associated degrees of freedom

SSA
MSA
c 1

Mean Square Among


(d.f. = c-1)

SSW
MSW
nc

Mean Square Within


(d.f. = n-c)

SST
MST
n 1

Mean Square Total


(d.f. = n-1)

Copyright 2015, 2012, 2009 Pearson Education, Inc.

Chapter 11, Slide 17

One-Way ANOVA Table


Source of
Variation

Degrees of
Freedom

Sum Of
Squares

Among
Groups

c-1

Within
Groups

n-c

SSW

Total

n1

SST

SSA

DCOVA

Mean Square
(Variance)

SSA
MSA =
c-1
SSW
MSW =
n-c

FSTAT =
MSA
MSW

c = number of groups
n = sum of the sample sizes from all groups
df = degrees of freedom
Copyright 2015, 2012, 2009 Pearson Education, Inc.

Chapter 11, Slide 18

One-Way ANOVA
F Test Statistic

DCOVA

H0: 1= 2 = = c
H1: At least two population means are different

Test statistic

MSA
FSTAT
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

(n = sum of sample sizes from all populations)

Copyright 2015, 2012, 2009 Pearson Education, Inc.

Chapter 11, Slide 19

Interpreting One-Way ANOVA


F Statistic
DCOVA

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
0
STAT > F,
otherwise do not reject
H0

Copyright 2015, 2012, 2009 Pearson Education, Inc.

Do not
reject H0

Reject H0

F
Chapter 11, Slide 20

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

Copyright 2015, 2012, 2009 Pearson Education, Inc.

DCOVA
Club 2
234
218
235
227
216

Club 3
200
222
197
206
204

Chapter 11, Slide 21

One-Way ANOVA Example:


Scatter Plot
Distance
Club 1
254
263
241
237
251

Club 2
234
218
235
227
216

Club 3
200
222
197
206
204

270
260
250
240
230

220

x1 249.2 x 2 226.0 x 3 205.8


x 227.0

DCOVA

210

X1

X2

200

X
X3

190
1

Copyright 2015, 2012, 2009 Pearson Education, Inc.

2
Club

3
Chapter 11, Slide 22

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

DCOVA

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
FSTAT
25.275
93.3

Copyright 2015, 2012, 2009 Pearson Education, Inc.

Chapter 11, Slide 23

One-Way ANOVA Example


Solution
Test Statistic:

H0: 1 = 2 = 3
H1: j not all equal
= 0.05
df1= 2
df2 = 12
Critical
Value:
F = 3.89
= .05

Do not
reject H0

DCOVA

Reject H0

F0.05 = 3.89

MSA 2358.2
FSTAT

25.275
MSW
93.3

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

Copyright 2015, 2012, 2009 Pearson Education, Inc.

Chapter 11, Slide 24

One-Way ANOVA
Excel Output

DCOVA

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

Copyright 2015, 2012, 2009 Pearson Education, Inc.

F
25.275

P-value
0.0000

F crit
3.89

Chapter 11, Slide 25

Multiple Comparison Procedures

Suppose that analysis of variance has provided


statistical evidence to reject the null hypothesis of
equal population means.

Fishers least significant difference (LSD)


procedure can be used to determine where
the differences occur.

Copyright 2015, 2012, 2009 Pearson Education, Inc.

Chapter 11, Slide 26

Fishers LSD Procedure Based on the Test


Statistic xi - xj
Hypotheses

Test Statistic
Rejection Rule
where

H 0 : i j
H a : i j
xi xj
Reject H0 ifxi xj

> LSD

LSD t / 2 MSE( 1n 1n )
i
j

Copyright 2015, 2012, 2009 Pearson Education, Inc.

Chapter 11, Slide 27

Example
Club 1
254
263
241
237
251

Club 2
234
218
235
227
216

DCOVA
Club 3
200
222
197
206
204

1. Compute absolute mean


differences:

x1 x 2 249.2 226.0 23.2


x1 x 3 249.2 205.8 43.4
x 2 x 3 226.0 205.8 20.2

Copyright 2015, 2012, 2009 Pearson Education, Inc.

Chapter 11, Slide 28

Example

(continued)

3. Compute Critical Range:


LSD Critical Range t / 2

DCOVA

1
1
1 1

MSW

2.179 93.3 13.31


n

5 5
j n j'

4. Compare:
5. All of the absolute mean differences
x1 x 2 23.2
are greater than the critical range.
Therefore there is a significant
x1 x 3 43.4
difference between each pair of
means at 5% level of significance.
x 2 x 3 20.2
Thus, with 95% confidence we conclude that
the mean distance for club 1 is greater than
club 2 and 3, and club 2 is greater than club 3.
Copyright 2015, 2012, 2009 Pearson Education, Inc.

Chapter 11, Slide 29

ANOVA Assumptions

Randomness and Independence

Select random samples from the c groups (or


randomly assign the levels)

Normality

DCOVA

The sample values for each group are from a normal


population

Homogeneity of Variance

All populations sampled from have the same


variance
Can be tested with Levenes Test
Copyright 2015, 2012, 2009 Pearson Education, Inc.

Chapter 11, Slide 30

ANOVA Assumptions
Levenes Test

DCOVA

Tests the assumption that the variances of each


population are equal.
First, define the null and alternative hypotheses:

H0: 21 = 22 = =2c

H1: Not all 2j are equal

Second, compute the absolute value of the difference


between each value and the median of each group.
Third, perform a one-way ANOVA on these absolute
differences.

Copyright 2015, 2012, 2009 Pearson Education, Inc.

Chapter 11, Slide 31

Levene Homogeneity Of Variance


Test Example
DCOVA
H0: 21 = 22 = 23
H1: Not all 2j are equal
Calculate Medians
Club 1

Club 2

Calculate Absolute Differences

Club 3

Club 1

Club 2

Club 3

237

216

197

14

11

241

218

200

10

251

227

204 Median

254

234

206

263

235

222

12

18

Copyright 2015, 2012, 2009 Pearson Education, Inc.

Chapter 11, Slide 32

Levene Homogeneity Of Variance


Test Example
(continued)
DCOVA

Anova: Single Factor


SUMMARY
Groups

Count

Sum Average Variance

Club 1

39

7.8

36.2

Club 2

35

17.5

Club 3

31

6.2

50.2

Pvalue

Source of Variation
Between Groups
Within Groups

Total

SS

df

6.4

415.6

12

422

14

MS

3.2 0.092

F crit

0.912 3.885

34.6

Copyright 2015, 2012, 2009 Pearson Education, Inc.

Since the
p-value is
greater
than 0.05
there is
insufficient
evidence
of a
difference
in the
variances
Chapter 11, Slide 33

Вам также может понравиться