chapter 11 chi- square test for homogeneity target goal: i can use a chi-square test to compare 3 or...

23
Chapter 11 Chapter 11 Chi- Square Test for Chi- Square Test for Homogeneity Homogeneity Target Goal: Target Goal: I can use a chi-square test to compare I can use a chi-square test to compare 3 or more proportions. 3 or more proportions. I can use a chi-square test for I can use a chi-square test for homogeneity to determine whether the homogeneity to determine whether the distribution of a categorical variable distribution of a categorical variable differs for several populations or differs for several populations or treatments. treatments. 11.2a 11.2a h.w: pg h.w: pg 694: 19 – 22; pg 724: 27 – 35 694: 19 – 22; pg 724: 27 – 35 odd, 43 odd, 43

Upload: samantha-oneal

Post on 13-Jan-2016

218 views

Category:

Documents


4 download

TRANSCRIPT

Page 1: Chapter 11 Chi- Square Test for Homogeneity Target Goal: I can use a chi-square test to compare 3 or more proportions. I can use a chi-square test for

Chapter 11Chapter 11 Chi- Square Test for Chi- Square Test for Homogeneity Homogeneity Target Goal: Target Goal: I can use a chi-square test to compare 3 or I can use a chi-square test to compare 3 or more proportions.more proportions.I can use a chi-square test for homogeneity I can use a chi-square test for homogeneity to determine whether the distribution of a to determine whether the distribution of a categorical variable differs for several categorical variable differs for several populations or treatments.populations or treatments.

11.2a 11.2a h.w: pgh.w: pg 694: 19 – 22; pg 724: 27 – 35 odd, 694: 19 – 22; pg 724: 27 – 35 odd, 43 43

Page 2: Chapter 11 Chi- Square Test for Homogeneity Target Goal: I can use a chi-square test to compare 3 or more proportions. I can use a chi-square test for

• To compare two proportions, we use To compare two proportions, we use a 2-Proportion Z.a 2-Proportion Z.

• If we want to compare If we want to compare three or three or more proportionsmore proportions, we need a new , we need a new procedure.procedure.

Page 3: Chapter 11 Chi- Square Test for Homogeneity Target Goal: I can use a chi-square test to compare 3 or more proportions. I can use a chi-square test for

Two Way TablesTwo Way Tables

The first step in the overall test for The first step in the overall test for comparing several proportions is to comparing several proportions is to arrange the dataarrange the data in a in a two-way table two-way table that gives countsthat gives counts for both for both successes successes and failures.and failures.

Think of the Think of the counts as elements of counts as elements of a matrixa matrix with r rows and c columns. with r rows and c columns. This is called an This is called an r x c tabler x c table with (r) with (r)(c) cells.(c) cells.

Page 4: Chapter 11 Chi- Square Test for Homogeneity Target Goal: I can use a chi-square test to compare 3 or more proportions. I can use a chi-square test for

Our Our null hypothesisnull hypothesis is that there is no is that there is no difference among the proportions.difference among the proportions.

HHoo: : pp11 = = pp22 = = pp33

• The The alternative hypothesisalternative hypothesis is that there is that there is is some differencesome difference among the among the proportions.proportions.

HHaa:: not allnot all of of pp11, , pp22, and , and pp33 are equalare equal

Page 5: Chapter 11 Chi- Square Test for Homogeneity Target Goal: I can use a chi-square test to compare 3 or more proportions. I can use a chi-square test for

We will use the We will use the chi-square testchi-square test to to measuremeasure

how far the how far the observed valuesobserved values are from are from the expected values.the expected values.

Page 6: Chapter 11 Chi- Square Test for Homogeneity Target Goal: I can use a chi-square test to compare 3 or more proportions. I can use a chi-square test for

Expected CountsExpected Counts

to calculate, multiply the row total to calculate, multiply the row total by the column total, and divide by by the column total, and divide by the table total:the table total:

row total column totalexpected count

table total

Page 7: Chapter 11 Chi- Square Test for Homogeneity Target Goal: I can use a chi-square test to compare 3 or more proportions. I can use a chi-square test for

Chi-Square StatisticChi-Square Statistic

is the sum over all r x c cells in the is the sum over all r x c cells in the table table

The The degrees of freedomdegrees of freedom is is (r – 1)(c – 1). (r – 1)(c – 1). The The P-valueP-value is the is the area to the right of the area to the right of the

X X 22 statistic statistic under the chi-square density under the chi-square density curve.curve.

2

2 O E

E

Page 8: Chapter 11 Chi- Square Test for Homogeneity Target Goal: I can use a chi-square test to compare 3 or more proportions. I can use a chi-square test for

Ex: Treating Cocaine AddictionEx: Treating Cocaine AddictionRead aloud pg. 710Read aloud pg. 710

Group Group TreatmentTreatment Subjects No relapseSubjects No relapse ProportionProportion

11 DesipramineDesipramine 24 24 1414 0.583 0.583

2 2 LithiumLithium 24 24 6 60.2500.250

33 PlaceboPlacebo 24 24 4 40.1670.167

• Plot data:Plot data: compares the success rates of 3 compares the success rates of 3 treatments for cocaine additiontreatments for cocaine addition..

Page 9: Chapter 11 Chi- Square Test for Homogeneity Target Goal: I can use a chi-square test to compare 3 or more proportions. I can use a chi-square test for

Two way tableTwo way table

Observed CountsObserved Counts

RelapseRelapseTreatmentTreatment no yesno yes Total Total

DesipramineDesipramine 1414 1010 2424

LithiumLithium 6 6 1818 2424

PlaceboPlacebo 4 4 20 20 2424

TotalTotal 2424 4848 7272

How many subjects relapsed? How many subjects relapsed?

48/72 subjects relapsed: (2/3)48/72 subjects relapsed: (2/3)

Page 10: Chapter 11 Chi- Square Test for Homogeneity Target Goal: I can use a chi-square test to compare 3 or more proportions. I can use a chi-square test for

Calculate Expected CountsCalculate Expected Counts

RelapseRelapse Observed Observed ExpectedExpected (s) (f)(s) (f) (s) (s) (f) (f) TreatmentTreatment no yes no yes no yes no yes Desipramin 14Desipramin 14 10 10 1616LithiumLithium 6 6 18 18 1616PlaceboPlacebo 4 4 20 20 16 16

( )Calculate Expected s

(24)(48)16

72

1 2( )

row total column totalExpected f

table total

1(24)8

1(24)

(72)

row total column total

table total

8

8

8

Page 11: Chapter 11 Chi- Square Test for Homogeneity Target Goal: I can use a chi-square test to compare 3 or more proportions. I can use a chi-square test for

What do you observe?What do you observe? We expect We expect 2/3’s of the subjects2/3’s of the subjects to to relapserelapse..

How did How did Desipramin Desipramin do? do? Fewer relapsesFewer relapses (10) and (10) and more successesmore successes

(14) (14) than expected.than expected.

How did the How did the PlaceboPlacebo do? do? More relapsesMore relapses (20) and (20) and fewer successesfewer successes

(4) (4) than expected.than expected.

How did How did LithiumLithium do? do?

BetweenBetween desipramin and the placebo desipramin and the placebo

More directly:More directly: Desipramin does much better Desipramin does much better than the placebo with lithium in between.than the placebo with lithium in between.

Page 12: Chapter 11 Chi- Square Test for Homogeneity Target Goal: I can use a chi-square test to compare 3 or more proportions. I can use a chi-square test for

As in the test for As in the test for goodness of fit of the goodness of fit of the X X 2 2 statisticstatistic, think of, think of

as a as a measure of the distance of the measure of the distance of the observed counts observed counts from thefrom the expected expected countscounts..

Large values of Large values of X X 22 are evidence are evidence against Hagainst Hoo , because they say that the , because they say that the observed counts observed counts are far from are far from what we what we would expect would expect if Hif Hoo were true were true..

Small values are not.Small values are not.

2

2 O E

E

Page 13: Chapter 11 Chi- Square Test for Homogeneity Target Goal: I can use a chi-square test to compare 3 or more proportions. I can use a chi-square test for

Remember: Remember: Although the HAlthough the Haa is many- is many-sided, sided,

the the chi-square test is alwayschi-square test is always one one sided!sided!

Any violation of HAny violation of Hoo tends to produce a tends to produce a large value of large value of X X 22..

Page 14: Chapter 11 Chi- Square Test for Homogeneity Target Goal: I can use a chi-square test to compare 3 or more proportions. I can use a chi-square test for

Chi-Square Test for Chi-Square Test for HomogeneityHomogeneity

In the Cocaine addiction example we In the Cocaine addiction example we had three examples. had three examples.

We can use the same chi-square We can use the same chi-square procedure with several populations if procedure with several populations if we take we take separate and independent separate and independent random samplesrandom samples from from each each population.population.

Page 15: Chapter 11 Chi- Square Test for Homogeneity Target Goal: I can use a chi-square test to compare 3 or more proportions. I can use a chi-square test for

Cell Counts required for theCell Counts required for the Chi-Square Test Chi-Square Test

Expected counts conditions:Expected counts conditions:No more than 20%No more than 20% of the of the

Expected countsExpected counts are less than 5are less than 5AllAll individual individual expected counts expected counts

are are 1 or greater1 or greaterFor For 2x2 table2x2 table,, all expected counts all expected counts

should be should be 5 or greater5 or greater..

Page 16: Chapter 11 Chi- Square Test for Homogeneity Target Goal: I can use a chi-square test to compare 3 or more proportions. I can use a chi-square test for

Ex.Ex. Treating Cocaine Addiction Treating Cocaine Addiction continuedcontinued..

We have examined the data from the three We have examined the data from the three cocaine treatment groups informally. Now we cocaine treatment groups informally. Now we proceed formallyproceed formally..

Step 1:Step 1: State State

We want to We want to perform a test ofperform a test of

HHoo: : pp11 = = pp22 = = pp33 The proportion of cocaine The proportion of cocaine addicts who avoid relapse are addicts who avoid relapse are the same.the same.

HHaa: : Not allNot all three of the proportions three of the proportions are are equalequal..Make sure to define pp1, 1, pp2, and 2, and pp33

Page 17: Chapter 11 Chi- Square Test for Homogeneity Target Goal: I can use a chi-square test to compare 3 or more proportions. I can use a chi-square test for

Step 2:Step 2: PlanPlanIf conditions are met, we should carry out a If conditions are met, we should carry out a chi-chi-square test for homogeneity.square test for homogeneity.

Random:Random: the subjects were assigned the subjects were assigned to three treatment groups.to three treatment groups.

Large Sample Size: Large Sample Size: Expected counts? Expected counts?

Yes, all 5Yes, all 5

No more than 20% are less than No more than 20% are less than 5: 5:

the smallest expected count was the smallest expected count was 8.8.

Page 18: Chapter 11 Chi- Square Test for Homogeneity Target Goal: I can use a chi-square test to compare 3 or more proportions. I can use a chi-square test for

Independent:Independent:The random assignment helps create The random assignment helps create

three independent groups. three independent groups. If the If the experiment is conducted properly, experiment is conducted properly, then then knowing one subject’s relapse knowing one subject’s relapse status should give us no information status should give us no information about another subject’s outcomeabout another subject’s outcome. So . So individual observations are individual observations are independent.independent.

Page 19: Chapter 11 Chi- Square Test for Homogeneity Target Goal: I can use a chi-square test to compare 3 or more proportions. I can use a chi-square test for

Step 3: Do - Step 3: Do - Since the conditions are satisfied, we Since the conditions are satisfied, we can a perform chi-test for homogeneity. We begin can a perform chi-test for homogeneity. We begin by calculating the test statistic. by calculating the test statistic.

The test statistic is The test statistic is

(for success and (for success and failure):failure):

= + + += + + + + + + = 10.5 + = 10.5

df = (r-1)(c-1) = df = (r-1)(c-1) = (3-1)(2-1) = 2(3-1)(2-1) = 2

2

2 O E

E

214 8

8

Page 20: Chapter 11 Chi- Square Test for Homogeneity Target Goal: I can use a chi-square test to compare 3 or more proportions. I can use a chi-square test for

Find P-value from table C or Find P-value from table C or X X 22cdf(10.5, cdf(10.5, E99, 2)E99, 2)

Falls between .01 and .005.Falls between .01 and .005.

P = .0052P = .0052

Page 21: Chapter 11 Chi- Square Test for Homogeneity Target Goal: I can use a chi-square test to compare 3 or more proportions. I can use a chi-square test for

Step 4.Step 4. ConcludeConclude - Interpret the - Interpret the results in the context of the problem.results in the context of the problem.

Since the P-value Since the P-value is less than 0.01is less than 0.01, , the the difference between the three difference between the three proportionsproportions are statistically are statistically significant at the significant at the α =α = 0.010.01 level. level.

We would reject the null hypothesis We would reject the null hypothesis and conclude that and conclude that not all three of the not all three of the proportions proportions of cocaine addicts who of cocaine addicts who avoid relapseavoid relapse are the same.are the same.

Page 22: Chapter 11 Chi- Square Test for Homogeneity Target Goal: I can use a chi-square test to compare 3 or more proportions. I can use a chi-square test for

Do the Chi square Tests on Do the Chi square Tests on the TI-38/89: the TI-38/89: see page 705see page 705

Use MatrixUse Matrix for for observedobserved and and expected countsexpected counts and and then use then use Stat:Test: XStat:Test: X22 test to calculate X test to calculate X22 value and value and P-value. P-value.

o Note, you only need to enter the Note, you only need to enter the “observed “observed count”.count”. When you use When you use Stat:Test: XStat:Test: X22 : :TestTest, the , the calculator does the expected counts for youcalculator does the expected counts for you and puts them in matrix B.and puts them in matrix B.

o You do need to be able to You do need to be able to calculate an calculate an individual cell expected value for the test.individual cell expected value for the test.

Page 23: Chapter 11 Chi- Square Test for Homogeneity Target Goal: I can use a chi-square test to compare 3 or more proportions. I can use a chi-square test for

Quiz tomorrow 11.1Quiz tomorrow 11.1