Class 7 Daiel B. Rowe, Ph.D. Departmet of Mathematics, Statistics, ad Computer Sciece Copyright 013 by D.B. Rowe 1
Ageda: Skip Recap Chapter 10.5 ad 10.6 Lecture Chapter 11.1-11. Review Chapters 9 ad 10 for Fial Problem Solvig Sessio
Lecture Chapter 11.1-11.3 3
Chapter 11: Applicatios of Chi-Square Daiel B. Rowe, Ph.D. Departmet of Mathematics, Statistics, ad Computer Sciece 4
Recall Marquette Uiversity MATH 1700 1: Statistics 1. What is Statistics? Data: The set of values collected from the variable from each of the elemets that belog to the sample. Data Qualitative Quatitative Nomial Ordial Discrete Cotiuous (ames) (ordered) (gap) (cotiuum) 5
11: Applicatios of Chi-Square 11.1 Chi-Square Statistic Coolig a Great Hot Taste Quite ofte we have qualitative data i categories. Example: Coolig mouth after hot spicy food. Method Water Bread Milk Beer Soda Nothig Other Number 73 9 35 19 0 13 11 6
11: Applicatios of Chi-Square 11.1 Chi-Square Statistic Data Setup Example: Coolig mouth after hot spicy food. Method Water Bread Milk Beer Soda Nothig Other Number 73 9 35 19 0 13 11 Data set up: k cells C 1,,C k that observatios sorted ito Observed frequecies i each cell O 1,,O k. O 1 + +O k = Expected frequecies i each cell E 1,,E k. E 1 + +E k = Cell C 1 C... C k Observed O 1 O... O k Expected E 1 E... E k 7
11: Applicatios of Chi-Square 11.1 Chi-Square Statistic Outlie of Test Procedure Whe we have observed cell frequecies O 1,,O k, we ca test to see if they match with some expected cell frequecies E 1,,E k. Test Statistic for Chi-Square k ( Oi Ei) * E df k 1 i1 i If the O i s are differet from E i s the χ * is large. Go through 5 hypothesis testig steps as before. (11.1) Figure from Johso & Kuby, 01. 8
11: Applicatios of Chi-Square 11.1 Chi-Square Statistic Assumptio for usig the chi-square statistic to make ifereces based upo eumerative data: a radom sample draw from a populatio where each idividual is classified accordig to the categories k ( Oi Ei) * df k 1 E i1 observed cell frequecies O 1,,O k, expected cell frequecies E 1,,E k. i 9
11: Applicatios of Chi-Square 11. Ifereces Cocerig Multiomial Experimets Example: We work for Las Vegas Gamig Commissio. We have received may complaits that dice at particular casio are loaded (weighted, ot fair). We cofiscate all dice ad test oe. We roll it =60 times. We get followig data. Cell, i 1 3 4 5 6 Observed, O i 7 1 10 1 8 11 Expected, E i 10 10 10 10 10 10 I Expected Value for Multiomial Experimet: E p i i (11.3) 10
11: Applicatios of Chi-Square 11. Ifereces Cocerig Multiomial Experimets Example: We roll it =60 times. We get followig data. Cell, i 1 3 4 5 6 Observed, O i 7 1 10 1 8 11 Expected, E i 10 10 10 10 10 10 E 60(1/ 6) i Is the die fair? Need to go through the hypothesis testig procedure to determie if it is fair. 11
11: Applicatios of Chi-Square 11. Ifereces Cocerig Multiomial Experimets Example: Is the die fair? Calculatig χ k ( Oi Ei) * E i1 i D of F for Mult: df k 1 (11.) * O 1 + +O k = E 1 + +E k = Figure from Johso & Kuby, 01. 1
11: Applicatios of Chi-Square 11. Iferece for Mea Differece Two Depedet Samples Cell 1 3 4 5 6 Observed 7 1 10 1 8 11 Expected 10 10 10 10 10 10 Observed differet tha expected? Step 1 Fill i. k 6 Step χ Step 3 Step 4 Step 5 Figures from Johso & Kuby, 01. χ 13
Chapter 11: Applicatios of Chi-Square Questios? Homework: Chapter 11 # 3, 5, 11, 15, 1, 49, 53 19
Review Chapters 9 ad 10 (Fial Exam Chapters) Just the highlights! 0
Recap Chapter 9 1
9: Ifereces Ivolvig Oe Populatio 9.1 Iferece about the Mea μ (σ Ukow) I Chapter 8, we performed hypothesis tests o the mea by x 1) assumig that was ormally distributed ( large ), ) assumig the hypothesized mea μ 0 were true, 3) assumig that σ was kow, so that we could form z* x / 0 which with 1) 3) has stadard ormal dist.
9: Ifereces Ivolvig Oe Populatio 9.1 Iferece about the Mea μ (σ Ukow) However, i real life, we ever kow σ for z* x / 0 so we would like to estimate σ by s, the use t* x s / 0. But t* does ot have a stadard ormal distributio. It has what is called a Studet t-distributio. 3
9: Ifereces Ivolvig Oe Populatio 9.1 Iferece about the Mea μ (σ Ukow) Usig the t-distributio Table Fidig critical value from a Studet t-distributio, df=-1 t(df,α), t value with α area larger tha it with df degrees of freedom Table 6 Appedix B Page 719. Figure from Johso & Kuby, 01. 4
9: Ifereces Ivolvig Oe Populatio 9.1 Iferece about the Mea μ (σ Ukow) Example: Fid the value of t(10,0.05), df=10, α=0.05. Table 6 Appedix B Page 719. Go to 0.05 Oe Tail colum ad dow to 10 df row. Figures from Johso & Kuby, 01. 5
9: Ifereces Ivolvig Oe Populatio 9.1 Iferece about the Mea μ (σ Ukow) Recap 9.1: Essetially have ew critical value, t(df,α) to look up i a table whe σ is ukow. Used same as before. σ assumed kow σ assumed ukow x z( / ) σ x t( df, / ) s x x 0 0 z* t* / s/ 6
9: Ifereces Ivolvig Oe Populatio 9. Iferece about the Biomial Probability of Success We talked about a Biomial experimet with two outcomes.! 1,,3,... x x P( x) p (1 p) x 0,1..., 0 p 1 x!( x)! = # of trials, x = # of successes, p = prob. of success Sample Biomial Probability x p' where x is the umber of successes i trials. i.e. umber of H out of flips (9.3) 7
9: Ifereces Ivolvig Oe Populatio 9. Iferece about the Biomial Probability of Success I Statistics, mea( cx) c ad variace( cx) c. x 1 With p', the costat is c, ad x 1 1 mea mea( x) p p p x ad the variace of p' is x p p variace x p(1 p) stadard error of p' is p'. ' (1 ) 8
9: Ifereces Ivolvig Oe Populatio 9. Iferece about the Biomial Probability of Success That is where 1. ad. i the gree box below come from If a radom sample of size is selected from a large populatio with p= P(success), the the samplig distributio of p' has: 1. A mea equal to p p ' p '. A stadard error equal to p(1 p) 3. A approximately ormal distributio if is sufficietly large. 9
9: Ifereces Ivolvig Oe Populatio 9. Iferece about the Biomial Probability of Success For a cofidece iterval, we would use Cofidece Iterval for a Proportio p' pq ' ' z( / ) to p' z( / ) x where p' ad q' (1 p'). pq ' ' Sice we did t kow the true value for p, we estimate it by p'. This is of the form poit estimate some amout. (9.6) 30
9: Ifereces Ivolvig Oe Populatio 9. Iferece about the Biomial Probability of Success Determiig the Sample Size Usig the error part of the CI, we determie the sample size. Maximum Error of Estimate for a Proportio E z( / ) p'(1 p') Sample Size for 1- α Cofidece Iterval of p (9.7) [ z( / )] p *(1 p*) From prior data, experiece, gut feeligs, séace. Or use 1/. (9.8) E where p* ad q* are provisioal values used for plaig. 31
9: Ifereces Ivolvig Oe Populatio 9. Iferece about the Biomial Probability of Success Hypothesis Testig Procedure We ca perform hypothesis tests o the proportio H 0 : p p 0 vs. H a : p < p 0 H 0 : p p 0 vs. H a : p > p 0 H 0 : p = p 0 vs. H a : p p 0 Test Statistic for a Proportio p z* p' p0 p0(1 p0) with p' x (9.9) 3
9: Ifereces Ivolvig Oe Populatio 9.3 Iferece about the Variace ad Stadard Deviatio We ca perform hypothesis tests o the variace. H 0 : σ σ 0 vs. H a : σ < σ 0 H 0 : σ σ 0 vs. H a : σ > σ 0 H 0 : σ = σ 0 vs. H a : σ σ 0 1. χ is oegative. χ is ot symmetric, skewed to right 3. χ is distributed to form a family each determied by df=-1. For this hypothesis test, use the χ distributio igore df df Figure from Johso & Kuby, 01. 33
9: Ifereces Ivolvig Oe Populatio 9.3 Iferece about the Variace ad Stadard Deviatio Test Statistic for Variace (ad Stadard Deviatio) * ( 1) s 0 Will also eed critical values. P ( df, ) sample variace, with df=-1. (9.10) hypothesized populatio variace Table 8 Appedix B Page 71 df=-1 Figure from Johso & Kuby, 01. 34
9: Ifereces Ivolvig Oe Pop. Example: Fid χ (0,0.05). Table 8, Appedix B, Page 71. Figures from Johso & Kuby, 01. 35
Chapter 9: Ifereces Ivolvig Oe Populatio Questios? Homework: Chapter 9 # 7, 1, 3, 35, 37, 39, 47, 55 67, 73, 75, 93, 95, 97, 103, 117, 119, 11, 19, 131, 135 36
Recap Chapter 10 37
10: Ifereces Ivolvig Two Populatios 10. Iferece for Mea Differece Two Depedet Samples Cofidece Iterval Procedure With Paired Differece d d d x x 1 (10.1) d d 1 s d ( di d ) d d d i 1 1 i1 ukow, a 1-α cofidece iterval for μ d =(μ 1 -μ ) is: 1 i Cofidece Iterval for Mea Differece (Depedet Samples) sd sd d t( df, / ) to d t( df, / ) where df=-1 (10.) 38
10: Ifereces Ivolvig Two Populatios 10. Iferece for Mea Differece Two Depedet Samples Example: Costruct a 95% CI for mea differece i Brad B A tire wear. d 8, 1, 9, 1, 1, 9 1 i s: d di 6 df 5 i 1 t( df, / ).57 d 6.3 0.05 1 sd ( di d ) 1 i1 sd 5.1 sd d t( df, / ) (0.090,11.7) Figure from Johso & Kuby, 01. 39
10: Ifereces Ivolvig Two Populatios 10. Iferece for Mea Differece Two Depedet Samples 6 8, 1, 9, 1, 1, 9 Example: Test mea differece of Brad B mius Brad A is zero. Step 1 H 0 : μ d =0 vs. H a : μ d 0 Step 5 Step df 5 d d 0 t*.05 sd / Step 3 d 6.3 6.3 0 sd 5.1 t* 3.03 5.1/ 6 Step 4 t( df, / ).57 Sice t*>t(df,α/), reject H 0 Coclusio: Sigificat differece i tread wear at.05 level. Figures from Johso & Kuby, 01. 40
10: Ifereces Ivolvig Two Populatios 10.3 Iferece for Mea Differece Two Idepedet Samples Cofidece Iterval Procedure With ad ukow, a 1-α cofidece iterval for is: df Cofidece Iterval for Mea Differece (Idepedet Samples) s 1 s s 1 s ( x1 x) t( df, / ) to ( x1 x) t( df, / ) 1 1 where df is either calculated or smaller of df 1, or df (10.8) 1 1 Actually, this is for σ 1 σ. Next larger umber tha s1 / 1 s / s1 s 1 1 1 1 If usig a computer program. If ot usig a computer program. 41
10: Ifereces Ivolvig Two Populatios 10.3 Iferece Mea Differece Cofidece Iterval f Example: Iterested i differece i mea heights betwee me ad wome. The heights of 0 females ad 30 males is measured. Costruct a 95% cofidece iterval for, & ukow s s m f ( xm x f) t( df, / ) m f (1.9) (.18) (69.8 63.8).09 30 0 m m f x f x m m f s f s 0.05 t(19,.05).09 therefore 4.75 to 7.5 Figure from Johso & Kuby, 01. m 4
10: Ifereces Ivolvig Two Populatios 10.3 Iferece for Mea Differece Two Idepedet Samples Hypothesis Testig Procedure 93 values Step 1 H 0 : μ f =μ m vs. H a : μ f μ m Step ( xm xf ) ( m f ) t* s s m f df 36.05 m f Step 3 Step 4 (71.5 65.3) (0) t* 9.7 10.0 7.4 37 56 t( df, / ).03 Step 5 Reject H 0 x x s s m f m f m f 37 56 71.5 65.3 10.0 7.4 9.7.03 TuTh 104 x m, height males height females x f 43
10: Ifereces Ivolvig Two Populatios 10.4 Iferece for Differece betwee Two Proportios That is where 1. ad. i the gree box below come from If idepedet samples of size 1 ad are draw with p 1 =P 1 (success) ad p =P (success), the the samplig distributio of p 1 p has these properties: 1. mea p1 p p1 p p1q 1 pq. stadard error p (10.10) 1 p 1 3. approximately ormal dist if 1 ad are sufficietly large. ie I 1, >0 II 1 p 1, 1 q 1, p, q >5 III sample<10% of pop 44
10: Ifereces Ivolvig Two Populatios 10.4 Iferece for Differece betwee Two Proportios Cofidece Iterval Procedure Assumptios for differece betwee two proportios p 1 -p : The 1 ad radom observatios are selected idepedetly from two populatios that are ot chagig Cofidece Iterval for the Differece betwee Two Proportios p1 p p 1q 1 p q p 1q 1 p q ( p 1 p ) z( / ) to ( p 1 p ) z( / ) 1 1 x1 x where p 1 ad p. (10.11) 1 45
10: Ifereces Ivolvig Two Populatios 10.4 Iferece for Differece betwee Two Proportios Cofidece Iterval Procedure 0.01 TuTh 104 Example: Costruct a 99% CI for proportio of female A s mius male A s differece pf pm. pq f f pq 1 values m m z( / ).58 ( pf p m) z( / ) f m m 5 x f 35 (.50)(.50) (.48)(.5) f 70 pf.50 (.50.48).58 f 70 x 5 70 5 m xm 5 p x 35.16 to.56 f m.48 5 m 46
10: Ifereces Ivolvig Two Populatios 10.4 Iferece for Differece betwee Two Proportios Hypothesis Testig Procedure We ca perform hypothesis tests o the proportio H 0 : p 1 p vs. H a : p 1 < p p1q 1 pq 1 1 pq H 0 : p 1 p vs. H a : p 1 > p H 0 : p 1 = p vs. H a : p 1 p whe p p p. 1 1 1 Test Statistic for the Differece betwee two Proportios- 0 ( p Populatio Proportios Kow 1 p ) ( p10 p0) z* 1 1 pq x1 x (10.1) 1 p 1 p 1 p kow 47
10: Ifereces Ivolvig Two Populatios 10.4 Iferece for Differece betwee Two Proportios Hypothesis Testig Procedure Test Statistic for the Differece betwee two Proportios- Populatio Proportios UKow z* (10.15) where we assume p 1 =p ad use pooled estimate of proportio x1 x p p1q 1 pq 1 1 x1 x 1 p pq pp 1 1 1 1 ( p p) ( p p ) 1 10 0 pq p p 1 1 1 p p estimated 0 48
10: Ifereces Ivolvig Two Populatios 10.4 Iferece for Differece betwee Two Proportios Hypothesis Testig Procedure Step 1 H 0 : p s -p c 0 vs. H a : p s -p c >0 ( ps p c) ( p0s p0c) z* 1 1 pq p p.05 s c Step 3 (.10.04) (0) z*.04 1 1 (.07)(.93) 150 150 Step 5 Reject H z( ) 1.65 0.0 p value.03 or Step Step 4.05 p s.04 1.65 xs x x s s c p p 15 150 x s s x c c p c s c x c c 15 6 150 150 6 150 Figure from Johso & Kuby, 01. 49
10: Ifereces Ivolvig Two Populatios 10.5 Iferece for Ratio of Two Variaces Two Id. Samples Hypothesis Testig Procedure We ca perform hypothesis tests o two variaces H 0 : 1 vs. H a : 1 Assumptios: Idepedet H 0 : vs. H a : samples from ormal distributio 1 H 0 : vs. H a : 1 1 1 Test Statistic for Equality of Variaces F s with df 1 ad dfd d 1. s * d Use ew table to fid areas for ew statistic. (10.16) 50
df d Marquette Uiversity MATH 1700 10: Ifereces Ivolvig Two 10.5 Iferece Ratio of Two Variaces Example: Fid F(5,8,0.05). df 1 df 1 Table 9, Appedix B, Page 7. 0.05 d d Pops. df Figures from Johso & Kuby, 01. 51
10: Ifereces Ivolvig Two Populatios 10.5 Iferece for Ratio of Two Variaces Two Id. Samples Hypothesis Testig Procedure Oe tailed tests: Arrage H 0 & H a so H a is always greater tha H 0 : vs. H a : H 0 : vs. H a : 1 1 / 1 1 / 1 1 F* s H 0 : vs. H a : H 0 : vs. H a : 1 1 1 / 1 1 / 1 F* s s 1 s Reject H 0 if F* s / s > F(df,df d,α). Two tailed tests: put larger sample variace s i umerator H 0 : 1 vs. H a : 1 H 0 : / d 1vs. H a : / d 1 1 if s1 s, if s s1 Reject H 0 if F* s / s > F(df,df d,α/). d d 1 5
10: Ifereces Ivolvig Two Populatios 10.5 Iferece for Ratio of Two Variaces Two Id. Samples Is variace of male heights greater tha that of females?.01 Step 1 37 H 0 : m f vs. H a : H 0 : vs. H a : Step Step 4 m f m f m f H 0 : 1vs. H a : 1 m F f s * m f Step 3.01 Step 5 Fail to Reject H 0 s F* 10.0 / 7.4 1.4 m f dfm 36 df 55 F(36,55,.01).00 f x x s s m f m f m f 1.40.00 56 71.5 65.3 10.0 7.4 TuTh 104 93 values x m x f 53
Chapter 10: Ifereces Ivolvig Two Populatios Questios? Homework: Chapter 10 # 13, 15, 3, 5, 9, 31, 35 41, 45, 53, 57, 58, 59, 63, 83, 85, 91, 98, 99, 101 111, 113, 115, 117, 119, 15 133 54