ch28testforindependence

ch28testforindependence - Chapter 28: Chapter CHI-SQUARED...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Chapter 28: Chapter CHI-SQUARED Test for Independence CHI-SQUARED NOT on Final exam!!!!!! Example 1: A butcher claimed that he treated customers of all ages in the same manner. You interviewed a sample of 400 customers, and obtained the following unbracketed count data. Is the butcher’s claim justified? Why? Is Example 1 data: Example Customer category Children Teenagers Adults Seniors 17 50 93 40 Meat of Today Yesterday Last week 29 24 42 25 24 11 15 30 First, calculate all the totals First, Customer category Children Teenagers Adults Seniors Total 17 50 93 40 200 Meat of Today Yesterday Last week 29 24 42 25 120 24 11 15 30 80 Total 70 85 150 95 400 Solution: Solution :The two criteria of classification are :The INDEPENDENT INDEPENDENT H A :They are dependent. :They Of 400 customers, 200 bought T (i.e. today’s meat.) Of If H 0 is true, then every customer (whatever his/her age) has the same chance, namely, P(T ) = 200 = 1 400 2 of getting T. of Hence, of the 70 children, e11 = 70 × 1 = 35(= 70 × 200 ) should Hence, 2 400 get T. get 1 85 × 200 e = 85 × = 42.5(= ) Similarly, of the 85 teenagers, Similarly, 2 400 should get T. should H0 12 In summary, corresponding to an observed number (in the i-th row and j-th column), the expected (or theoretical) number is: is: th th eij = i rowtotal × j columntotal ....(1) grandtotal For example, corresponding to o23 = 11 , the expected number is e For These 23 = 85 × 80 = 17 400 eij ' s have been put in brackets beside the oij ' s Now we compare each pair of oij and eij If H 0 is correct, then they should not be too different. If Thus, the difference o − e matters. Thus, ij ij Say, for the upper left box (1,1), o11 − e11 = 17 − 35 = −18 Somewhere down, in box (3,1), we have the same difference, but with the opposite sign: o31 − e31 = 93 − 75 = 18 then, calculate all the expected values then, Customer category Children Today Meat of Yesterday Last week Total 17 (35.0) Teenagers 50 (42.5) Adults 93 (75.0) Seniors 40 (47.5) Total 200 29 (21.0) 24 (25.5) 42 (45.0) 25 (28.5) 120 24 (14.0) 11 (17.0) 15 (30.0) 30 (19.0) 80 70 85 150 95 400 An aggregate measure of discrepancy is An X =∑ 2 (oij − eij ) eij 2 ........(2) For our data the test statistic is test (17 − 35) 2 (29 − 21) 2 (24 − 14) 2 (50 − 42.5) 2 (24 − 25.5) 2 (11 − 17) 2 X= + + + + + + 35 21 14 42.5 25.5 17 2 (93 − 75) 2 (42 − 45) 2 (15 − 30) 2 (40 − 47.5) 2 (25 − 28.5) (30 − 19) 2 + + + + + 75 45 30 47.5 28.5 19 = 9.2571 + 3.0476 + .......... + 6.3682 = 42.98 2 Is this discrepancy, 42.98, large or small? Is If large, then we accept H If If small, then we accept H 0 There should be a cut-off value, ie. a critical value. There This C.V. is given by Table 9. Table 9 classifies the C.V’s in terms of the d.f. Table associated with the sample size of the data table. associated The data table in our case has 4 rows (r =4) and three columns (c =3). three The appropriate degrees of freedom are d.f.=(r-1)(c-1)…..(3) d.f.=(r-1)(c-1)…..(3) ii.e. 6. The reason behind (3) will be explained later .e. in Note 5. in A With 6 degrees of freedom, Table 9 gives these C.V.’s C.V.’s As 42.98 exceeds even the biggest C.V. (i.e. 22.46), As we accept H A at a 0.001 S.L. we The discrepancy between the butcher’s claim and The your observations is extremely significant. The butcher lied. The First, calculate all the totals First, Customer category Children Teenagers Adults Seniors Today Meat of Yesterday Last week Total 70 85 150 95 400 free free free NOT free 200 free free free NOT free 120 NOT free NOT free NOT free NOT free 80 Total Note 1: Note Note 2: Note Note 3: Note Note 4: Note The alternate formula for the test statistic is: test X2 =∑ = n[∑ (oij − eij ) 2 eij 2 oij rowtotal × columntotal 17 2 50 2 30 2 = 400[ + + ....... + − 1] 70 × 200 85 × 200 95 × 80 = 400[1.10745 − 1] = 42.98 − 1] ON MODE COMP MODE ON SD 17 ²÷70÷200+50²÷85÷200+ 93²÷150÷200+40²÷95÷200+ 17 29²÷70÷120+24²÷85÷120+42²÷150÷120+25²÷95÷120+ 29²÷70÷120+24²÷85÷120+42²÷150÷120+25²÷95÷120+ 24²÷70÷80+11²÷85÷80+15²÷150÷80+30²÷95÷80 EXE -1 EXE x 400 EXE X²=42.98 Note 5: Note ...
View Full Document

This note was uploaded on 02/22/2010 for the course FBE STAT0302 taught by Professor Unknown during the Spring '10 term at HKU.

Ask a homework question - tutors are online