Chaptr 6 Studnt Lctur Nots 6-1 Chaptr Goals QM353: Busnss Statstcs Chaptr 6 Goodnss-of-Ft Tsts and Contngncy Analyss Aftr compltng ths chaptr, you should b abl to: Us th ch-squar goodnss-of-ft tst to dtrmn whthr data fts a spcfd dstrbuton St up a contngncy analyss tabl and prform a ch-squar tst of ndpndnc Ch-Squar Goodnss-of-Ft Tst Dos sampl data conform to a hypothszd dstrbuton? Exampls: Ar tchncal support calls qual across all days of th wk? (.., do calls follow a unform dstrbuton?) Do masurmnts from a producton procss follow a normal dstrbuton? Ch-Squar Goodnss-of-Ft Tst (contnud) Ar tchncal support calls qual across all days of th wk? (.., do calls follow a unform dstrbuton?) Sampl data for 10 days pr day of wk: Sum of calls for ths day: Monday 90 Tusday 50 Wdnsday 38 Thursday 57 Frday 65 Saturday 30 Sunday 19 = 17 Logc of Goodnss-of-Ft Tst If calls ar unformly dstrbutd, th 17 calls would b xpctd to b qually dvdd across th 7 days: 17 46 7 xpctd calls pr day f unform Ch-Squar Goodnss-of-Ft Tst: tst to s f th sampl rsults ar consstnt wth th xpctd rsults (.., actual (obsrvd) data = xpctd data) Obsrvd vs. Expctd Frquncs Monday Tusday Wdnsday Thursday Frday Saturday Sunday Obsrvd o 90 50 38 57 65 30 19 Expctd 46 46 46 46 46 46 46 TOTAL 17 17
Chaptr 6 Studnt Lctur Nots 6- Ch-Squar Tst Statstc Th Rjcton Rgon H 0 : Th dstrbuton of calls s unform ovr days of th wk (obsrvd = xpctd) H A : Th dstrbuton of calls s not unform Th tst statstc s whr: (o (whr df k 1) k = numbr of catgors o = obsrvd cll frquncy for catgory = xpctd cll frquncy for catgory Rjct H 0 f H 0 : Th dstrbuton of calls s unform ovr days of th wk H A : Th dstrbuton of calls s not unform (o α (wth k 1 dgrs of frdom) 0 Do not rjct H 0 Rjct H 0 Ch-Squar Tst Statstc Goodnss-of-Ft Tst (90 46) 46 H 0 : Th dstrbuton of calls s unform ovr days of th wk H A : Th dstrbuton of calls s not unform (50 46) 46 k 1 = 6 (7 days of th wk) so us 6 dgrs of frdom (Appndx G): 0.05 = 1.5916 Concluson: = 3.05 > = 1.5916 so rjct H 0 and conclud that th dstrbuton s not unform 0 (19 46)... 46 3.05 = 0.05 Do not Rjct H 0 rjct H 0 0.05 = 1.5916 1. Stat th approprat hypothss. Spcfy sgnfcanc lvl 3. Dtrmn th crtcal valu (Appndx G) 4. Comput th tst statstcs, χ 5. Rach a dcson 6. Draw a concluson Normal Dstrbuton Exampl Do masurmnts from a producton procss follow a normal dstrbuton wth μ = 50 and σ = 15? Procss: Gt sampl data Group sampl rsults nto classs (clls) (Expctd cll frquncy must b at last 5 for ach cll) Compar actual cll frquncs wth xpctd cll frquncs Normal Dstrbuton Exampl (contnud) Sampl data and valus groupd nto classs: 150 Sampl Masurmnts 80 65 36 66 50 38 57 77 59 tc Class Frquncy lss than 30 10 30 but < 40 1 40 but < 50 33 50 but < 60 41 60 but < 70 6 70 but < 80 10 80 but < 90 7 90 or ovr TOTAL 150
Chaptr 6 Studnt Lctur Nots 6-3 Normal Dstrbuton Exampl (contnud) What ar th xpctd frquncs for ths classs for a normal dstrbuton wth μ = 50 and σ = 15? Class Obsrvd Frquncy lss than 30 10 Expctd Frquncy 30 but < 40 1 40 but < 50 33? 50 but < 60 41 60 but < 70 6 70 but < 80 10 80 but < 90 7 90 or ovr TOTAL 150 Valu Expctd Frquncs P(X < valu) Expctd frquncy lss than 30 0.0911 13.68 30 but < 40 0.1618 4.19 40 but < 50 0.4751 37.13 50 but < 60 0.4751 37.13 60 but < 70 0.1618 4.19 70 but < 80 0.06846 10.7 80 but < 90 0.0189.84 90 or ovr 0.00383 0.57 TOTAL 1.00000 150.00 Expctd frquncs n a sampl of sz n=150, from a normal dstrbuton wth μ=50, σ=15 Exampl: 30 50 P(x 30) Pz 15 P(z 1.3333) 0.091 (0.091)(150) 13.68 Th Tst Statstc Th Rjcton Rgon Frquncy Expctd Class (obsrvd, o ) Frquncy, lss than 30 10 13.68 30 but < 40 1 4.19 40 but < 50 33 37.13 50 but < 60 41 37.13 60 but < 70 6 4.19 70 but < 80 10 10.7 80 but < 90 7.84 90 or ovr 0.57 TOTAL 150 150.00 Th tst statstc s (o Rjct H 0 f α (wth k 1 dgrs of frdom) 8 classs so us 7 d.f.: H 0 : Th dstrbuton of valus s normal wth μ = 50 and σ = 15 H A : Th dstrbuton of calls dos not hav ths dstrbuton (o 0.05 = 14.0671 Concluson: (10 13.68) 13.68 ( 0.57)... 0.57 =0.05 1.097 = 1.097 < = 14.0671 so 0 do not rjct H 0 Do not Rjct H 0 rjct H 0 0.05 = 14.0671 Contngncy Analyss Contngncy Analyss Exampl Stuatons nvolvng multpl populaton proportons Catgorcal data Usd to classfy sampl obsrvatons accordng to two or mor charactrstcs Us Ch-Squar to dtrmn ndpndnc of th charactrstcs of ntrst Data summarzd n a contngncy tabl Also calld a crosstabulaton tabl Lft-Handd vs. Gndr (two varabls) Domnant Hand: Lft vs. Rght Gndr: Mal vs. Fmal H 0 : Hand prfrnc s ndpndnt of gndr H A : Hand prfrnc s not ndpndnt of gndr
Chaptr 6 Studnt Lctur Nots 6-4 Contngncy Analyss Exampl Sampl rsults organzd n a contngncy tabl: (contnud) Logc of th Tst H 0 : Hand prfrnc s ndpndnt of gndr H A : Hand prfrnc s not ndpndnt of gndr sampl sz = n = 300: 10 Fmals, 1 wr lft handd 180 Mals, 4 wr lft handd Hand Prfrnc Gndr Lft Rght Fmal 1 108 10 Mal 4 156 180 36 64 300 If H 0 s tru, thn th proporton of lft-handd fmals should b th sam as th proporton of lft-handd mals Th two proportons abov should b th sam as th proporton of lft-handd popl ovrall Fndng Expctd Frquncs Expctd Cll Frquncs (contnud) 10 Fmals, 1 wr lft handd Ovrall: Expctd cll frquncs: 180 Mals, 4 wr lft handd If ndpndnt, thn P(Lft Handd) = 36/300 = 0.1 ( th th Row total)( j Column total) Total sampl sz P(Lft Handd Fmal) = P(Lft Handd Mal) = 0.1 So w would xpct 1% of th 10 fmals and 1% of th 180 mals to b lft handd.., w would xpct (10)(0.1) = 14.4 fmals to b lft handd (180)(0.1) = 1.6 mals to b lft handd Exampl: 11 (10)(36) 14.4 300 Obsrvd vs. Expctd Frquncs Obsrvd frquncs vs. xpctd frquncs: Gndr Fmal Mal Lft Obsrvd = 1 Expctd = 14.4 Obsrvd = 4 Expctd = 1.6 Hand Prfrnc Rght Obsrvd = 108 Expctd = 105.6 Obsrvd = 156 Expctd = 158.4 10 180 36 64 300 Margnal Frquncs A margnal frquncy s th sum of th row or column.g., Th margnal frquncy for fmals n th study was 10 Th xpctd margnal frquncy for a varabl MUST match th obsrvd margnal frquncy for that sam varabl.., Th xpctd margnal frquncy for fmals n th study must also b 10
Chaptr 6 Studnt Lctur Nots 6-5 Th Ch-Squar Tst Statstc Th Ch-squar contngncy tst statstc s: r 1 j1 whr: o = obsrvd frquncy n cll (, j) = xpctd frquncy n cll (, j) r = numbr of rows c = numbr of columns c (o ) wth d.f. (r 1)(c 1) NOTE: All rows and columns must b usd Gndr Fmal Mal (1 14.4) 14.4 Obsrvd vs. Expctd Frquncs Lft Obsrvd = 1 Expctd = 14.4 Obsrvd = 4 Expctd = 1.6 (108 105.6) 105.6 Hand Prfrnc Rght Obsrvd = 108 Expctd = 105.6 Obsrvd = 156 Expctd = 158.4 10 180 36 64 300 (4 1.6) 1.6 (156 158.4) 158.4 0.6848 Contngncy Analyss Ch-Squar Tst Cautons 0.6848 Do not rjct H 0 wth 0.05 = 3.841 d.f. (r -1)(c -1) (1)(1) 1 Dcson Rul: If > 3.841, rjct H 0, othrws, do not rjct H 0 = 0.05 Rjct H 0 Hr, = 0.6848 < 3.841, so w do not rjct H 0 and conclud that gndr and hand prfrnc ar ndpndnt Th ch-squar dstrbuton s only an approxmaton for th tru dstrbuton But t s qut good whn all xpctd cll frquncs ar > 5 Whn frquncs ar >5, th ch-squar valu may nflat th tru probablty of a Typ I rror If frquncs ar small: Incras sampl sz frst If ndd combn th catgors of th varabls Chaptr Summary Usd th ch-squar goodnss-of-ft tst to dtrmn whthr data fts a spcfd dstrbuton Exampl of a dscrt dstrbuton (unform) Exampl of a contnuous dstrbuton (normal) Usd contngncy tabls to prform a ch-squar tst of ndpndnc (contngncy analyss) Compard obsrvd cll frquncs to xpctd cll frquncs