Power 14 Goodness of Fit & Contingency TablesOutlineThe Vision ThingSlide 4Expected Costs of MisclassificationThe Regression Line-Discriminant FunctionSlide 7II. Goodness of Fit & Chi SquareSlide 9Slide 10Hypothesis TestSlide 12Slide 13Slide 14Contingency Table AnalysisSlide 16Slide 17Slide 18Slide 19Slide 20Slide 21Slide 22Slide 23Using Goodness of Fit to Choose Between Competing Proabaility ModelsMen on base when a home run is hitConjectureAverage # of men on baseUsing the binomial k=men on base, n=# of trialsGoodness of FitSlide 30Conjecture: Poisson where m=np = 0.63Slide 3211Power 14Goodness of Fit& Contingency Tables22OutlineI. Parting Shots On the Linear Probability I. Parting Shots On the Linear Probability ModelModelII. Goodness of Fit & Chi SquareII. Goodness of Fit & Chi SquareIII.Contingency TablesIII.Contingency Tables33The Vision Thing Discriminating BetweenTwo PopulationsDiscriminating BetweenTwo PopulationsDecision Theory and the Regression LineDecision Theory and the Regression Line44incomeeducationx = a, x2 > y2 y = bx, y > 0mean income nonMeaneduc.nonMeanEducPlayersMean income PlayersPlayersNon-playersDiscriminatingline55Expected Costs of MisclassificationE CE CMCMC = C(n/p)*P(n/p)*P(p) + = C(n/p)*P(n/p)*P(p) + C(p/n)*P(n/p)*P(p)C(p/n)*P(n/p)*P(p)where P(n) = 23/100where P(n) = 23/100 Suppose C(n/p) = C(p/n)Suppose C(n/p) = C(p/n)then E Cthen E CMC MC = C*P(n/p)*3/4 + C*P(p/n)*1/4 = C*P(n/p)*3/4 + C*P(p/n)*1/4 And the two costs of misclassification will And the two costs of misclassification will be balanced if P(p/n) =3/4 = Bernbe balanced if P(p/n) =3/4 = Bern66The Regression Line-Discriminant FunctionBern = 3/4Bern = 3/4Bern = c + bBern = c + b1 1 *educ + b*educ + b2 2 *income*incomeBern = 3/4 = 1.39 - 0.0216*educ -0.0105* Bern = 3/4 = 1.39 - 0.0216*educ -0.0105* income, or income, or 0.0216*educ =0.64 - 0.0105*income0.0216*educ =0.64 - 0.0105*incomeEduc = 29.63 - 0.486*income, Educ = 29.63 - 0.486*income, the regression linethe regression line77Lottery: Players and Non-Players Vs. Education & Income05101520250 10 20 30 40 50 60 70 80 90 100Income ($000)Education (Years)Discriminant Function or Decision Rule:Bern = ¾ = 1.39 – 0.0216*education – 0.0105*income Legend: Non-Players PlayersMean- NonplayersMean- NonplayersMean-PlayersMean-Players88II. Goodness of Fit & Chi SquareRolling a Fair DieRolling a Fair DieThe Multinomial DistributionThe Multinomial DistributionExperiment: 600 TossesExperiment: 600 Tosses99Outcome Probability Expected Frequency /6 002 /6 003 /6 00 /6 005 /6 006 /6 00The Expected Frequencies The Expected Frequencies1010Outcome Expected Frequencies Expected Frequency 00 2 00 93 00 8 00 05 00 076 00 07The Expected Frequencies & Empirical FrequenciesThe Expected Frequencies & Empirical FrequenciesEmpirical FrequencyEmpirical Frequency1111Hypothesis TestNull HNull H00: Distribution is Multinomial: Distribution is MultinomialStatistic: (OStatistic: (Oii - E - Eii))22/E/Ei, i, : observed minus : observed minus expected squared divided by expectedexpected squared divided by expectedSet Type I Error @ 5% for exampleSet Type I Error @ 5% for exampleDistribution of Statistic is Chi SquareDistribution of Statistic is Chi SquareP(nP(n1 1 =1, n=1, n2 2 =0, nn3 3 =0, n =0, n4 4 =0, n=0, n5 5 =0, n=0, n6 6 =0) = n!/=0) = n!/njjnnjjpjn1)(1)]([])(P(nP(n1 1 =1, n=1, n2 2 =0, nn3 3 =0, n =0, n4 4 =0, n=0, n5 5 =0, n=0, n6 6 =0)= 1!/1!0!0!0!0!0!(1/6)=0)= 1!/1!0!0!0!0!0!(1/6)11(1/6)(1/6)00(1/6)(1/6)0 0 (1/6)(1/6)0 0 (1/6)(1/6)0 0 (1/6)(1/6)00One Throw, side one comes up: multinomial distributionOne Throw, side one comes up: multinomial distribution1212Outcome Expected Observed Oi - Ei (Oi - Ei)2 00 - 96/002 00 92 8 6/003 00 8 6 256/00 00 0 - /005 00 07 -7 9/006 00 07 -7 9/00Sum = 6.51313Outcome Expected Observed Oi - Ei (Oi - Ei)2 00 - 96/002 00 92 8 6/003 00 8 6 256/00 00 0 - /005 00 07 -7 9/006 00 07 -7 9/00Sum = 6.5Chi Square: xChi Square: x22 = = (O (Oii - E - Eii))2 2 = 6.15 = 6.150.000.050.100.150.200 5 10 15CHIDENSITYChi Square Density for 5 degrees of freedomChi Square Density for 5 degrees of freedom11.0711.075 %5 %1515Contingency Table AnalysisTests for Association Vs. Independence For Tests for Association Vs. Independence For Qualitative VariablesQualitative Variables1616Purchase Consumer Inform Cons. Not Inform. TotalsFrost FreeNot Frost FreeTotalsDoes Consumer Knowledge Affect Purchases?Does Consumer Knowledge Affect Purchases?Frost Free Refrigerators Use More ElectricityFrost Free Refrigerators Use More Electricity1717Purchase Consumer Inform Cons. Not Inform. TotalsFrost Free 32Not Frost Free 288Totals 50 80 720Marginal CountsMarginal Counts1818Purchase Consumer Inform Cons. Not Inform. TotalsFrost Free 0.6Not Frost Free 0.Totals 0.75 0.25 Marginal Distributions, f(x) & f(y)Marginal Distributions, f(x) & f(y)1919Purchase Consumer Inform Cons. Not Inform. TotalsFrost Free 0.5 0.5 0.6Not Frost Free 0.3 0. 0.Totals 0.75 0.25 Joint Disribution Under IndependenceJoint Disribution Under Independencef(x,y) = f(x)*f(y)f(x,y) = f(x)*f(y)2020Purchase Consumer Inform Cons. Not Inform. TotalsFrost Free 32 08 32Not Frost Free 26 72 288Totals 50 80 720Expected Cell Frequencies Under IndependenceExpected Cell Frequencies Under Independence2121Purchase Consumer Inform Cons. Not Inform. TotalsFrost Free 3 8Not Frost Free 226 62TotalsObserved Cell CountsObserved Cell Counts2222Purchase Consumer Inform Cons. Not Inform. TotalsFrost Free 0.3 0.93Not Frost Free 0.6 .39TotalsContribution to Chi Square: (observed-Expected)Contribution to Chi Square: (observed-Expected)22/Expected/ExpectedChi Sqare = 0.31 + 0.93 + 0.46 +1.39 = 3.09Chi Sqare = 0.31 + 0.93 + 0.46 +1.39 = 3.09(m-1)*(n-1) = 1*1=1 degrees of freedom (m-1)*(n-1) = 1*1=1 degrees of freedom Upper Left Cell: (314-324)Upper Left Cell: (314-324)22/324 = 100/324 =0.31/324 = 100/324 =0.310.00.20.40.60.81.00 2 4 6 8 10 12 14Chi-Square VariableFigure 4: Chi-Square Dens ity, One Degree of FreedomDens
View Full Document