Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Power 14 Goodness of Fit & Contingency Tables. 2 II. Goodness of Fit & Chi Square u Rolling a Fair Die u The Multinomial Distribution u Experiment:

Similar presentations


Presentation on theme: "1 Power 14 Goodness of Fit & Contingency Tables. 2 II. Goodness of Fit & Chi Square u Rolling a Fair Die u The Multinomial Distribution u Experiment:"— Presentation transcript:

1 1 Power 14 Goodness of Fit & Contingency Tables

2 2 II. Goodness of Fit & Chi Square u Rolling a Fair Die u The Multinomial Distribution u Experiment: 600 Tosses

3 3 The Expected Frequencies

4 4 The Expected Frequencies & Empirical Frequencies Empirical Frequency

5 5 Hypothesis Test u Null H 0 : Distribution is Multinomial u Statistic: (O i - E i ) 2 /E i, : observed minus expected squared divided by expected u Set Type I Error @ 5% for example u Distribution of Statistic is Chi Square P(n 1 =1, n 2 n 3 =0, n 4 =0, n 5 =0, n 6 =0) = n!/ P(n 1 =1, n 2 =0, n 3 =0, n 4 =0, n 5 =0, n 6 =0) = n!/ P(n 1 =1, n 2 n 3 =0, n 4 =0, n 5 =0, n 6 =0)= 1!/1!0!0!0!0!0!(1/6) 1 (1/6) 0 P(n 1 =1, n 2 =0, n 3 =0, n 4 =0, n 5 =0, n 6 =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 One Throw, side one comes up: multinomial distribution

6 6 Chi Square: x 2 =  (O i - E i ) 2 = 6.15

7 Chi Square Density for 5 degrees of freedom 11.07 5 %

8 8 Contingency Table Analysis u Tests for Association Vs. Independence For Qualitative Variables

9 9 Does Consumer Knowledge Affect Purchases? Frost Free Refrigerators Use More Electricity

10 10 Marginal Counts

11 11 Marginal Distributions, f(x) & f(y)

12 12 Joint Disribution Under Independence f(x,y) = f(x)*f(y)

13 13 Expected Cell Frequencies Under Independence

14 14 Observed Cell Counts

15 15 Contribution to Chi Square: (observed-Expected) 2 /Expected Chi Sqare = 0.31 + 0.93 + 0.46 +1.39 = 3.09 (m-1)*(n-1) = 1*1=1 degrees of freedom Upper Left Cell: (314-324) 2 /324 = 100/324 =0.31

16 5% 5.02

17 17 Conclusion u No association between consumer knowledge about electricity use and consumer choice of a frost-free refrigerator

18 18 Using Goodness of Fit to Choose Between Competing Probability Models u Men on base when a home run is hit

19 19 Men on base when a home run is hit

20 20 Conjecture u Distribution is binomial

21 21 Average # of men on base Sum of products = n*p = 0.298+0.250+0.081 = 0.63

22 22 Using the binomial k=men on base, n=# of trials u P(k=0) = [3!/0!3!] (0.21) 0 (0.79) 3 = 0.493 u P(k=1) = [3!/1!2!] (0.21) 1 (0.79) 2 = 0.393 u P(k=2) = [3!/2!1!] (0.21) 2 (0.79) 1 = 0.105 u P(k=3) = [3!/3!0!] (0.21) 3 (0.79) 0 = 0.009

23 23 Assuming the binomial u The probability of zero men on base is 0.493 u the total number of observations is 765 u so the expected number of observations for zero men on base is 0.493*765=377.1

24 24 Goodness of Fit

25 Chi Square, 3 degrees of freedom 5% 7.81

26 26 Conjecture: Poisson where  np = 0.63 u 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

27 27 Average # of men on base Sum of products = n*p = 0.298+0.250+0.081 = 0.63

28 28 Conjecture: Poisson where  np = 0.63 u 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

29 29 Goodness of Fit

30 Chi Square, 3 degrees of freedom 5% 7.81

31 31 Likelihood Functions u Review OLS Likelihood u Proceed in a similar fashion for the probit

32 32 Likelihood function u The joint density of the estimated residuals can be written as: u If the sample of observations on the dependent variable, y, and the independent variable, x, is random, then the observations are independent of one another. If the errors are also identically distributed, f, i.e. i.i.d, then

33 33 Likelihood function u Continued: If i.i.d., then u If the residuals are normally distributed: u This is one of the assumptions of linear regression: errors are i.i.d normal u then the joint distribution or likelihood function, L, can be written as:

34 34 Likelihood function u and taking natural logarithms of both sides, where the logarithm is a monotonically increasing function so that if lnL is maximized, so is L:

35 35 Log-Likelihood u Taking the derivative of lnL with respect to either a-hat or b-hat yields the same estimators for the parameters a and b as with ordinary least squares, except now we know the errors are normally distributed.

36 36 Probit u Example: expenditures on lottery as a % of household income u lottery i = a + b*income i + e i u if lottery i >0, i.e. a + b*income i + e i >0, then Bern i, the yes-no indicator variable is equal to one and e i >- a - b*income i u this determines a threshold for observation i in the distribution of the error e i u assume

37 i

38 i Area above the threshold is the probability of playing the lottery for observation i, P yes

39 i Area above the threshold is the probability of playing the lottery for observation i, P yes P no for observation i

40 40 Probit u Likelihood function for the observed sample u Log likelihood:

41 41

42 i Area above the threshold is the probability of playing the lottery for observation i, P yes P no for observation i

43 43 Probit u Substituting these expressions for P no and P yes in the ln Likelihood function gives the complete expression.

44 44 Probit u Likelihood function for the observed sample u Log likelihood:

45 45

46 46 Outline u I. Projects u II. Goodness of Fit & Chi Square u III.Contingency Tables

47 47 Part I: Projects u Teams u Assignments u Presentations u Data Sources u Grades

48 48 Team One u : Project choice u : Data Retrieval u : Statistical Analysis u : PowerPoint Presentation u : Executive Summary u : Technical Appendix u : Graphics (Excel, Eviews, other)

49 49 Assignments u 1. Project choice: Markus Ansmann u 2. Data Retrieval: Theodore Ehlert u 3. Statistical Analysis: David Sheehan u 4. PowerPoint Presentation: Qun Luo u 5. Executive Summary: Steven Comstock u 6. Technical Appendix: Alan Weinberg u 7. Graphics: Gregory Adams

50 50 PowerPoint Presentations: Member 4 u 1. Introduction: Members 1,2, 3 –What –Why –How u 2. Executive Summary: Member 5 u 3. Exploratory Data Analysis: Members 3, 7 u 4. Descriptive Statistics: Member 3, 7 u 5. Statistical Analysis: Member 3 u 6. Conclusions: Members 3 & 5 u 7. Technical Appendix: Table of Contents, Member 6

51 51 Executive Summary and Technical Appendix

52 52

53 53 Grades

54 54 Data Sources u FRED: Federal Reserve Bank of St. Louis, http://research.stlouisfed.org/fred/ http://research.stlouisfed.org/fred/ –Business/Fiscal F Index of Consumer Sentiment, Monthly (1952:11) F Light Weight Vehicle Sales, Auto and Light Truck, Monthly (1976.01) u Economagic, http://www.economagic.com/ http://www.economagic.com/ u U S Dept. of Commerce, http://www.commerce.gov/ http://www.commerce.gov/ –Population –Economic Analysis, http://www.bea.gov/ http://www.bea.gov/

55 55 Data Sources (Cont. ) u Bureau of Labor Statistics, http://stats.bls.gov/ http://stats.bls.gov/ u California Dept of Finance, http://www.dof.ca.gov/ http://www.dof.ca.gov/


Download ppt "1 Power 14 Goodness of Fit & Contingency Tables. 2 II. Goodness of Fit & Chi Square u Rolling a Fair Die u The Multinomial Distribution u Experiment:"

Similar presentations


Ads by Google