Sie sind auf Seite 1von 52

Week 6 Analysis of Variance (ANOVA)

Week 6-1

Week 6 - Learning Objectives


Recognize situations in which to use analysis of variance Understand different Analysis of Variance (ANOVA) designs Perform a single-factor hypothesis test and interpret results Conduct and interpret post-hoc multiple comparisons procedures
Week 6-2

Parametric Hypothesis Testing


Single sample Two independent samples Two dependent samples or paired samples More than two independent samples ***

Week 6-3

Chapter Overview
Analysis of Variance (ANOVA) One-Way ANOVA F-test TukeyKramer test

Week 6-4

ANOVA

ANalysis Of VAriance
Not discussed in this chapter

One-Way ANOVA/ Completely Randomized Design

Two-Way ANOVA/ ANOVA for Randomized Block Design


Week 6-5

General ANOVA Setting


Investigator controls one or more independent variables
Called factors (or treatment variables) Each factor contains two or more levels.

Observe effects on the dependent variable


Response to levels of independent variable

Experimental design: the plan used to collect the data

Week 6-6

Completely Randomized Design


Experimental units (subjects) are assigned randomly to treatments Subjects are assumed homogeneous Only one factor or independent variable With two or more treatment levels Analyzed by one-factor analysis of variance (one-way ANOVA)
Week 6-7

The Assumptions of One-Way ANOVA Hypothesis Testing


Before we test, we must assume that the populations are normally distributed. samples are randomly or independently selected. sample sizes must be large enough. Populations have the same variances (each group has equal population variance).

Week 6-8

The Steps in One-Way ANOVA Hypothesis Testing


Step 1: State the null and alternative hypothesis Step 2: State the significance level. Step 3: State the statement of decision rule to determine the rejection region(s). Step 4: Find the critical value of the test from the statistical table. Step 5: Determine the appropriate statistical technique and the test statistic to use. Step 6: Make the comparison between test statistics value and critical value to make statistical decision. Step 7: Making conclusion.
Week 6-9

The Steps in One-Way ANOVA Hypothesis Testing (continue)


Additional steps (more information): Find the p-value from statistical table based on test statistic value. Conduct the Tukey-Kramer test.

Week 6-10

Step 1: State the null and alternative hypothesis


H 0 : 1 = 2 = 3 = = k
All population means are equal i.e., no treatment effect (no variation in means among groups)

H 1 : At least one of

is not equal,

whe re i = 1,2,3,....
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)
Week 6-11

Step 1 (Continue)

H0 : 1 = 2 = 3 = = k
All Means are the same: The Null Hypothesis is True (No Treatment Effect)

1 = 2 = 3
Week 6-12

Step 1 (Continue)
H 1 : At least one of

is not equal,

whe re i = 1,2,3,.... , k
At least one mean is different: The Null Hypothesis is NOT true (Treatment Effect is present)
i

or

1 = 2 3

1 2 3
Week 6-13

Step 2: State the significance level


What is the significance level? It is the criteria to be used for rejecting the null hypothesis before the testing is implemented. It is the probability of rejecting Ho given that Ho is true at desire level, which is set by researcher. Normally, significance level set by researcher is at 1%, 5% and 10% level.

Significance Level =

=Type 1 error
Week 6-14

Step 3: State the decision rule


In the decision rule, we can only reject null hypothesis when the test statistic value is greater than upper bound critical value.

Decision Rule: Reject H0 if F > FU, otherwise do not reject H0

= .05

Do not reject H0

Reject H0

Upper critical value Week 6-15

Step 4: Find critical value


There is two types of degree of freedom
v1=df1 = k -1 will typically be small v2=df2 = n - k will typically be large k= the number of independent groups n = the sum of sample sizes from all populations = n1+n2+....nk

F , k 1 , n k
Week 6-16

Step 5: Compute the test statistic


The F statistic is the ratio of the among estimate of variance and the within estimate of variance (The ratio must always positive)

Before you compute the test statistic value, you need to develop ANOVA table

Week 6-17

Step 5 (continue)
One-Way ANOVA Table
Source of Variation Among Groups Within Groups Total Sum of Square SSA SSW SST Degree of Freedom k-1 n-k n-1 Mean Square MSA = SSA k-1 SSW MSW = n-k F statistic MSA F= MSW

Test Statistic
Week 6-18

Step 5 (Continue) Partition of Total Variation


Total Variation (TSS)
Variation Due to Random Sampling (SSW)
Commonly referred to as: Sum of Squares Within Sum of Squares Error Sum of Squares Unexplained Within Groups Variation
Week 6-19

Variation Due to Factor (SSA)

Commonly referred to as: Sum of Squares Between Sum of Squares Among Sum of Squares Explained Among Groups Variation

Step 5 (Continue)
Total variation can be split into two parts:

TSS = SSA + SSW TSS = SSR + SSE


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)
Week 6-20

Step 5 (Continue)
TSS = 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)

Week 6-21

Step 5 (Continue)
Total Sum of Squares/ Total Variation
Where:

TSS = SSA + SSW

TSS = ( X ij X )
j =1 i =1

nj

TSS = Total sum of squares

k = 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)
Week 6-22

Step 5 (Continue)
TSS = ( X 11 X ) 2 + ( X 12 X ) 2 + ... + ( X kni X ) 2
Response, X

X
Group 1 Group 2 Group 3
Week 6-23

Step 5 (Continue)
Sum Squares Among the Groups/ AmongGroup Variation
Where:

TSS = SSA + SSW

SSA = n j ( X j X )
j =1

SSA = Sum of squares among groups k = number of groups or populations nj = sample size from group j Xj = sample mean from group j X = grand mean (mean of all data values)
Week 6-24

Step 5 (Continue)
SSA =

j =1

nj(X

X )2

Variation Due to Differences Among Groups

j
Week 6-25

Step 5 (Continue)
SSA = n1 ( x1 x ) + n2 ( x2 x ) + ... + nk ( xk x )
Response, X
2 2 2

X3
X1
Group 1 Group 2

X2
Group 3

Week 6-26

Step 5 (Continue)
TSS = SSA + SSW
Sum Squares of Within Group/WithinGroup Variation
2

SSW =
Where:
j =1

i =1

nj

( X ij X j )

SSW = Sum of squares within groups k = number of groups nj = sample size from group j Xj = sample mean from group j Xij = ith observation in group j
Week 6-27

Step 5 (Continue)
SSW =


j =1 i =1

(X

ij

Summing the variation within each group and then adding over all groups

i
Week 6-28

Step 5 (Continue)
SSW = ( x11 X 1 ) + ( X 12 X 2 ) + ... + ( X knk X k )
Response, X
2 2 2

X3

X1
Group 1 Group 2

X2
Group 3
Week 6-29

Step 5 (Continue)
Obtaining the Mean Squares = Sum Squares / Degree of Freedom
Mean Square Among Groups

SSA MSA = k 1
SSW MSW = nk

= SSA/degrees of freedom for sum squares among groups

Mean Square Within Group = SSW/degrees of freedom for sum squares within group
Week 6-30

Step 5 (Continue)
Test statistic for One-Way ANOVA is computed as

MSA F= MSW
MSA is mean squares among variances MSW is mean squares within variances

Week 6-31

TSS = SSR + SSE

Week 6-32

Step 6: State the decision making


Decision making is the process to make decision either to reject or do not reject Ho after making comparison between F test statistic values and upper critical value (from F table).

Week 6-33

Step 7: Making conclusion


The process to make the statement regarding whether the populations means from different groups are significantly different or not based on the decision making at the certain significance level.

Week 6-34

Additional step: Find p-value


P-value is the probability of rejecting Ho given that Ho is true based on F test statistic value.

P-value is the probability that we make the type 1 error (reject Ho given that Ho is true) after conclusion is drawn.

Week 6-35

Additional step: Find p-value (Continue)


How to obtain the power of the test? How to find the p-value? Use F Table
Obtain from

Not discussed in this chapter

Bounded p-value

Use Computer Software (Microsoft Excel)

Obtain from

Actual p-value

Week 6-36

Additional Step: Tukey-Kramer Test


This test is more meaningful when we have sufficient evidence to reject Ho in One-Way ANOVA hypothesis testing..

Tells which population means are significantly different


e.g.: 1 = 2 3 Done after rejection of equal means in ANOVA

Allows pair-wise comparisons


Compare absolute mean differences with critical range

1= 2

x
Week 6-37

The Steps in Tukey-Kramer Hypothesis Testing


Step 1: State the null and alternative hypothesis Step 2: State the significance level. Step 3: State the statement of decision rule to determine the rejection region(s). Step 4: Find the critical value of the test from the statistical table. Step 5: Determine the appropriate statistical technique and the test statistic to use. Step 6: Make the comparison between test statistics value and critical value to make statistical decision. Step 7: Making conclusion.
Week 6-38

Additional Step: Tukey-Kramer Test (Continue)


1. Ho: H1:

i = j i j

,where

i j

2. Significance level:

3. Decision rule: We reject Ho when test statistic is greater than critical value.
Week 6-39

Additional Step: Tukey-Kramer Test (Continue)

4. Tukey-Kramer Critical Range


Critical Range = Qu = , k , n k MSW 2 1 1 + n n j' j

where: QU = Value from Studentized Range Distribution with k and n - k degrees of freedom for the desired level of (see appendix E.9 table) MSW = Mean Square Within ni and nj = Sample sizes from groups j and j
Week 6-40

Additional Step: Tukey-Kramer Test (Continue)

5.Test Statistic
Absolute Different Two Sample Means =
where:
j

Xi X

X i = Sample mean from group i.

X j = Sample mean from group j


Week 6-41

Additional Step: Tukey-Kramer Test (Continue)


6. Decision making: If the test statistic value is greater than absolute critical value, it is shows that we have strong evidence from sample to reject Ho and otherwise. 7. Conclusion: To make the statement regarding which groups are significantly difference at certain significance level.

Week 6-42

One-Factor 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 Club 3 234 200 218 222 235 197 227 206 216 204

Week 6-43

One-Factor ANOVA Example: Scatter Diagram


Club 1 254 263 241 237 251 Club 2 Club 3 234 200 218 222 235 197 227 206 216 204
Distance 270 260 250 240 230 220 210

X1

X2

X
X3

x1 = 249.2 x 2 = 226.0 x 3 = 205.8 x = 227.0

200 190 1 2 Club

3
Week 6-44

One-Factor 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 X2 = 226.0 X3 = 205.8 X = 227.0 n1 = 5 n2 = 5 n3 = 5 n = 15 k=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


Week 6-45

One-Factor ANOVA Example Solution


H0: 1 = 2 = 3 H1: At least one of i is not equal, where i=1,2, and 3 = 0.05 df1= 2 df2 = 12 Critical Value: FU = 3.89 = .05

Test Statistic:
MSA 2358.2 F= = = 25.275 MSW 93.3

Decision: Reject H0 at = 0.05 Conclusion: There is evidence that at least one i differs from F = 25.275 the rest at = 0.05.
Week 6-46

Do not reject H0

Reject H0

FU = 3.89

ANOVA -- Single Factor: Excel Output


EXCEL: tools | data analysis | ANOVA: single factor SUMMARY Groups Club 1 Club 2 Club 3 ANOVA Source of Variation Between Groups Within Groups Total SS 4716.4 1119.6 5836.0 df 2 12 14
Week 6-47

Count 5 5 5

Sum 1246 1130 1029

Average 249.2 226 205.8

Variance 108.2 77.5 94.2

MS 2358.2 93.3

F 25.275

P-value 4.99E-05

F crit 3.89

The Tukey-Kramer Procedure: Example


Club 1 254 263 241 237 251 Club 2 Club 3 234 200 218 222 235 197 227 206 216 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

2. Find the QU value from the Studentized Range Q table with k = 3 and (n k) = (15 3) = 12 degrees of freedom for the desired level of ( = .05 used here):

QU = 3.77
Week 6-48

The Tukey-Kramer Procedure: Example


3. Compute Critical Range:
Critical Range = QU

(continued)

MSW 1 1 1 + 1 = 3.77 93.3 + = 16.285 2 n j n j' 2 5 5

4. Compare: 5. All of the absolute mean differences are greater than critical range. Therefore there is a significant difference between each pair of means at 5% level of significance.
x1 x 2 = 23.2 x1 x 3 = 43.4 x 2 x 3 = 20.2

Week 6-49

Tukey Kramer Multiple Comparisons Sample Sample Mean Size 4.75 8 1 4.625 8 2 7.75 8 3 Absolute Difference Comparison 0.125 Group 1 to Group 2 3 Group 1 to Group 3 3.125 Group 2 to Group 3 Std. Error of Difference 0.71910576 0.71910576 0.71910576 Critical Range 2.5744 2.5744 2.5744

Group

Results Means are not different Means are different Means are different

Other Data Level of significance 0.05 Numerator d.f. 3 Denominator d.f. 21 MSW 4.136905 Q Statistic 3.58

Week 6-50

Summary
Described one-way analysis of variance The logic of ANOVA ANOVA assumptions F test for difference in c means The Tukey-Kramer procedure for multiple comparisons
Week 6-51

Week 6-52

Das könnte Ihnen auch gefallen