Power 14 Goodness of Fit Contingency Tables Outline I Parting Shots On the Linear Probability Model II Goodness of Fit Chi Square III Contingency Tables The Vision Thing Discriminating BetweenTwo Populations Decision Theory and the Regression Line education Mean Educ Players Mean educ non Players Discriminating line Non players income mean income non Mean income Players x a x2 y2 y b x y 0 Expected Costs of Misclassification E CMC C n p P n p P p C p n P n p P p where P n 23 100 Suppose C n p C p n then E CMC C P n p 3 4 C P p n 1 4 And the two costs of misclassification will be balanced if P p n 3 4 Bern The Regression LineDiscriminant Function Bern 3 4 Bern c b1 educ b2 income Bern 3 4 1 39 0 0216 educ 0 0105 income or 0 0216 educ 0 64 0 0105 income Educ 29 63 0 486 income the regression line Lottery Players and Non Players Vs Education Income 25 Discriminant Function or Decision Rule Bern 1 39 0 0216 education 0 0105 income Education Years 20 15 10 Legend Non Players Players Mean Nonplayers 5 Mean Players 0 0 10 20 30 40 50 Income 000 60 70 80 90 100 II Goodness of Fit Chi Square Rolling a Fair Die The Multinomial Distribution Experiment 600 Tosses The Expected Frequencies Outcome Probability 2 3 5 6 6 6 6 6 6 6 Expected Frequency 00 00 00 00 00 00 The Expected Frequencies Empirical Frequencies Outcome 2 3 5 6 Expected Frequencies 00 00 00 00 00 00 Empirical Frequency Expected Frequency 9 8 0 07 07 1 Hypothesis Test Null H0 Distribution is Multinomial Statistic Oi Ei 2 Ei observed minus expected squared divided by expected Set Type I Error 5 for example Distribution of Statistic is Chi Square One Throw side one comes up multinomial distribution n n P n1 1 n2 0 n3 0 n4 0 n5 0 n6 0 n n j p j n j j 1 j 1 P n1 1 n2 0 n3 0 n4 0 n5 0 n6 0 1 1 0 0 0 0 0 1 6 1 1 6 0 1 6 0 1 6 0 1 6 0 1 6 0 1 Outcome Expected Observed 2 3 5 6 00 00 00 00 00 00 92 8 0 07 07 Oi E i 8 6 7 7 Oi E i 2 96 00 6 00 256 00 00 9 00 9 00 Sum 6 5 1 Chi Square x2 Oi Ei 2 6 15 Outcome Expected Observed 2 3 5 6 00 00 00 00 00 00 92 8 0 07 07 Oi E i 8 6 7 7 Oi E i 2 96 00 6 00 256 00 00 9 00 9 00 Sum 6 5 1 0 20 DENSITY 0 15 0 10 0 05 5 0 00 0 5 10 CHI 15 11 07 Chi Square Density for 5 degrees of freedom Contingency Table Analysis Tests for Association Vs Independence For Qualitative Variables 1 Does Consumer Knowledge Affect Purchases Frost Free Refrigerators Use More Electricity Purchase Frost Free Not Frost Free Totals Consumer Inform Cons Not Inform Totals 1 Marginal Counts Purchase Frost Free Not Frost Free Totals Consumer Inform 5 0 Cons Not Inform 80 Totals 32 288 720 1 Marginal Distributions f x f y Purchase Frost Free Not Frost Free Totals Consumer Inform 0 75 Cons Not Inform 0 25 Totals 0 6 0 1 Joint Disribution Under Independence f x y f x f y Purchase Frost Free Not Frost Free Totals Consumer Inform 0 5 0 3 0 75 Cons Not Inform 0 5 0 0 25 Totals 0 6 0 1 Expected Cell Frequencies Under Independence Purchase Frost Free Not Frost Free Totals Consumer Inform 32 2 6 5 0 Cons Not Inform 08 72 80 Totals 32 288 720 2 Observed Cell Counts Purchase Frost Free Not Frost Free Totals Consumer Inform 3 226 Cons Not Inform 8 62 Totals 2 Contribution to Chi Square observed Expected 2 Expected Purchase Frost Free Not Frost Free Totals Consumer Inform 0 3 0 6 Cons Not Inform 0 93 39 Totals Upper Left Cell 314 324 2 324 100 324 0 31 Chi Sqare 0 31 0 93 0 46 1 39 3 09 m 1 n 1 1 1 1 degrees of freedom 2 Figure 4 Chi Square Dens ity One Degree of Freedom 1 0 0 8 Dens ity 0 6 0 4 0 2 5 0 0 0 2 4 6 5 02 8 10 Chi Square Variable 12 14 Using Goodness of Fit to Choose Between Competing Proabaility Models Men on base when a home run is hit 2 Men on base when a home run is hit 0 Observed 421 Fraction 1 2 3 Sum 227 96 21 765 0 550 0 298 0 125 0 027 1 2 Conjecture Distribution is binomial 2 Average of men on base 0 1 2 3 fraction 0550 0 298 0 125 0 027 product 0 0 298 0 250 0 081 Sum of products n p 0 298 0 250 0 081 0 63 p np n 0 63 3 0 21 2 Using the binomial k men on base n of trials P k 0 3 0 3 0 21 0 0 79 3 0 493 P k 1 3 1 2 0 21 1 0 79 2 0 393 P k 2 3 2 1 0 21 2 0 79 1 0 105 P k 3 3 3 0 0 21 3 0 79 0 0 009 2 Goodness of Fit 0 1 2 3 Sum Observed 421 227 96 21 765 binomial 377 1 300 6 80 3 6 9 764 4 Oj Ej 43 9 73 6 15 7 14 1 18 0 2 6 28 8 54 5 2 Oj Ej Ej 5 1 2 Chi Square 3 degrees of freedom 0 25 DENSITY 0 20 0 15 0 10 5 0 05 0 00 0 5 10 CHI 7 81 15 20 Conjecture Poisson where np 0 63 P k 3 1 P k 2 P k 1 P k 0 P k 0 e k k e 0 63 0 63 0 0 0 5326 P k 1 e k k e 0 63 0 63 1 1 0 3355 P k 2 e k k e 0 63 0 63 2 2 0 1057 3 Goodness of Fit 0 1 2 3 Sum Observed 421 227 96 21 765 Poisson 407 4 256 7 80 9 20 0 765 Oj Ej Ej 0 454 3 44 2 82 0 05 6 76 2 3
View Full Document
Unlocking...