Topic 9 - ANOVA Background - pages 354 - 357354 - 357 ANOVA - pages 357 - 367357 - 367.

Post on 31-Dec-2015

223 views 0 download

Tags:

Transcript of Topic 9 - ANOVA Background - pages 354 - 357354 - 357 ANOVA - pages 357 - 367357 - 367.

Topic 9 - ANOVA

• Background - pages 354 - 357 • ANOVA - pages 357 - 367

Comparing several means

• Does the average number of words per sentence in advertisements differ across magazine types?

• Does the expected survival time vary for different types of cancer among patients treated with a specific drug?

• Is the mean response time not the same for three different types of circuits?

Comparing several means• Suppose that instead of comparing two

means we want to test for the equivalence of several means

H0: 1 = 2 = …= I

HA: at least two i’s are different• Each of the groups we are comparing are

called treatments.• We make our decision based on samples

from each of the I treatment groups. • Let Xi,j represent the jth sample from the ith

treatment group with j = 1,…,ni.• We assume each sample comes from a

Normal population with common variance.

ANOVA – Analysis of Variance• We partition the variability of the data into

treatment and error components.

2,

1 1 1

2

1 1

2,

1 1 1

( ) , 1

( ) , 1

( ) ,

,

i

i

i

nI I

tot i j tot ii j i

nI

trt i trti j

nI I

err i j i err ii j i

tot trt err tot trt err

SS X X DF n

SS X X DF I

SS X X DF n I

SS SS SS DF DF DF

ANOVA - Means squares• MStrt = SStrt/DFtrt, MSerr = SSerr/DFerr, F = MStrt/MSerr

• If H0 is true, then F should be close to 1.

• If H0 is false, then F should be much larger than 1.

ANOVA – Decision rule

• Reject H0 if F > FDFtrt,DFerr

• F Calculator

ANOVA table

Source df SS MS F-Stat P-value

Treatments 2 5.756057 2.8780284 64.97913 <0.0001

Error 6 0.26574945 0.044291575

Total 8 6.0218062

Magazine ads example• 30 magazines were grouped by educational level:

– Group 1 – High educational level– Group 2 – Medium educational level– Group 3 – Low educational level

• 3 magazines randomly selected from each group:– Group 1: 1. Scientific American, 2. Fortune, 3. The New

Yorker – Group 2: 4. Sports Illustrated, 5. Newsweek, 6. People – Group 3: 7. National Enquirer, 8. Grit, 9. True Confessions

• 6 ads randomly selected from each of the 9 magazines and the variables below recorded:– WDS - number of words in advertisement copy – SEN - number of sentences in advertising copy – 3SYL - number of 3+ syllable words in advertising copy – MAG - magazine (1 through 9 as above) – GROUP - educational level

Magazine Ads in StatCrunch• Is the average number of words per sentence

the same across magazine groups?

• StatCrunch

0 1 2 3:

: at least two groups have a different

average words per sentenceA

H

H

Cancer Survival example

• Patients with advanced cancers of the stomach, bronchus, colon, ovary and breast were treated with ascorbate.

• The variables recorded for each patient were– Survival: Survival time in days– Organ: Organ affected by the cancer

• The purpose of the study was to determine if the survival times differ with respect to the organ affected by the cancer.

Cancer Survival in StatCrunch

0 var:

: at least two cancer types have a different

average survival time with ascorbate

Breast Bronchus Colon O y Stomach

A

H

H

Circuit example• Response times in milliseconds were recorded for three

different types of circuits used in a shutoff mechanism. Does the data suggest at level 0.05 that all three circuits have the same mean response time?

Multiple comparisons• If we reject H0 in favor of the alternative HA,

then we are only concluding that at least two of the means are different.

• If we want to drill down to see which means are actually different, we might be tempted to do two-sample t tests for all mean pairs.

• The problem is that the overall level of significance is much higher than the level of significance for each pair wise test.

• To do these multiple comparisons, we must use Tukey’s method to maintain an overall level of significance. See STAT 212.