DOC PREVIEW
UCSB ECON 240a - Expected Vs. Observed Frequencies

This preview shows page 1-2-3-4 out of 12 pages.

Save
View full document
Premium Document
Do you want full access? Go Premium and unlock all 12 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Nov 10 2009 LEC 13 ECON 240A 1 L Phillips Expected Vs Observed Frequencies Contingency Tables Chi Square I Introduction The Chi Square Distribution can be used to compare expected and observed distributions There are a number of applications One example is throwing a die In this case we have an expected theoretical distribution for each face if the die is fair We could conduct an experiment and roll a die six hundred times and record which face comes up for each trial and calculate the experimental frequencies Alternatively we could simulate such an experiment Once we have the experimental frequencies for each face we can compare them to the expected frequency of 100 Unless this experiment is extraordinary the experimental frequencies will differ somewhat from the expected frequencies The issue is do they differ significantly The Chi Square test is based on squaring the difference between the expected frequency and the observed frequency for each face and dividing this square by the expected frequency and summing over all six faces This number is distributed as Chi Square with 5 degrees of freedom The null hypothesis is that the observed frequency equals the expected frequency in which case this statistic will be zero Only if the statistic is significantly large would we accept the alternative hypothesis that the observed distribution differs from the expected We test this at the 5 level Another example is searching for a probability model that will fit the observed frequency of the number of men on base when home runs were hit for a particular year in the National League One possibility is to use the binomial but a better fit is obtained from the Poisson distribution Another application is contingency table analysis which can be used to test for association or interdependence between variables An example is a simple two by two Nov 10 2009 LEC 13 ECON 240A 2 L Phillips Expected Vs Observed Frequencies Contingency Tables Chi Square table For example is there a connection between consumer information and purchasing behavior This example looks at two kinds of refrigerators purchased frost free and not frost free and how that varies by whether the consumer knew that frost free refrigerators consume more electricity We could look at each of the marginal distributions for example what fraction purchased frost free refrigerators and the remaining fraction that did not We could examine which consumers were informed about electricity use and which were not The expected cell frequency in the two by two table would be the product of these marginal frequencies if the purchase were independent of the consumer information We could calculate the four expected cell frequencies using the product of the marginal distributions under the null hypothesis of independence and then compare these to the observed cell frequencies If refrigerator choice is independent of consumer information then we should get an insignificant Chi Square statistic II The Multinomial Distribution The Bernoulli event with only two classes such as yes or no or heads versus tails can be extended to accommodate more classes The resulting distribution is called the multinomial For example rolling a fair die is an example where there are six possible elementary outcomes for one toss 1 2 3 4 5 6 If the die is fair we know the probability of each outcome P j is one sixth Consider two tosses of the die as illustrated partially in Figure 1 We could obtain 36 elementary events 1 1 1 2 1 3 6 5 6 6 Using n1 to count the number of ones etc if the elementary outcome is 1 1 then n1 2 n2 0 etc where Nov 10 2009 LEC 13 ECON 240A 3 L Phillips Expected Vs Observed Frequencies Contingency Tables Chi Square 6 n j n If the elementary event were 1 2 we would have n1 1 and n2 1 and the j 1 rest of the nj 0 But we could obtain one one and one two two ways 1 2 and 2 1 so we have to count the combinations as well 1 2 1 3 2 4 3 5 4 6 5 6 Figure 1 Two Throws of a Die Partially Illustrated The probability of one one and one two is 6 P n1 1 n2 1 n3 0 n4 0 n5 0 n6 0 n n j j 1 6 p j n j j 1 2 1 1 0 0 0 0 1 6 1 1 6 1 1 6 0 1 6 0 1 6 0 1 6 0 2 1 36 2 36 III Expected Versus Observed Frequencies The Die Our expectations for the probabilities of each face are listed in Table 1 If we were to simulate this to obtain experimental frequencies for rolling a die 600 times we might obtain the following empirical simulated distribution from data file XR15 09 as listed Nov 10 2009 LEC 13 ECON 240A 4 L Phillips Expected Vs Observed Frequencies Contingency Tables Chi Square in Table 2 The Chi Square statistic is calculated from this comparison of observed and expected frequencies squaring the difference and dividing by the expected frequency and 6 summing these values Oj Ej 2 Ej which is distributed as Chi Square with 5 j 1 degrees of freedom one degree being lost since the probabilities sum to one and hence only five are independent Table 1 Expected Frequencies For Each Face of the Die in 600 Throws Face Probability Expected Frequency 1 1 6 100 2 1 6 100 3 1 6 100 4 1 6 100 5 1 6 100 6 1 6 100 Table 2 Observed Versus Expected Frequencies for Die Faces Face 1 2 3 4 5 6 Probability 1 6 1 6 1 6 1 6 1 6 1 6 Expected 100 100 100 100 100 100 Observed 114 92 84 101 107 107 The difference between observed and expected frequencies is reported in Table 3 along with each cell s contribution to the Chi Square statistic Table 3 Simulated frequencies Compared to Theoretical Face 1 Observed Oj 114 Expected Ej 100 Oj Ej 14 Oj Ej 2 Ej 196 100 1 96 Nov 10 2009 LEC 13 ECON 240A 5 L Phillips Expected Vs Observed Frequencies Contingency Tables Chi Square 2 3 4 5 6 92 84 101 107 107 100 100 100 100 100 8 16 1 7 7 64 100 0 64 256 100 2 56 1 100 0 01 49 100 0 49 49 100 0 49 2 1 96 0 64 2 56 0 01 0 49 0 49 6 15 The critical value for five degrees of freedom at a level of significance of 5 is 11 07 so there is no significant difference between the theoretical distribution and the simulated distribution The Chi Square distribution for five degrees of freedom is illustrated in Figure 2 Figure 2 Chi Square Density for 5 Degrees of Freedom 0 20 DENSITY 0 15 0 10 0 05 5 0 00 0 5 10 Chi Square Variable 15 Nov 10 2009 LEC 13 ECON 240A 6 L Phillips Expected Vs Observed Frequencies Contingency Tables Chi Square 11 07 …


View Full Document

UCSB ECON 240a - Expected Vs. Observed Frequencies

Documents in this Course
Final

Final

8 pages

power_16

power_16

64 pages

final

final

8 pages

power_16

power_16

64 pages

Power One

Power One

63 pages

midterm

midterm

6 pages

power_16

power_16

39 pages

Lab #9

Lab #9

7 pages

Power 5

Power 5

59 pages

Final

Final

13 pages

Final

Final

11 pages

Midterm

Midterm

8 pages

Movies

Movies

28 pages

power_12

power_12

53 pages

midterm

midterm

4 pages

-problems

-problems

36 pages

lecture_7

lecture_7

10 pages

final

final

5 pages

power_4

power_4

44 pages

power_15

power_15

52 pages

group_5

group_5

21 pages

power_13

power_13

31 pages

power_11

power_11

44 pages

lecture_6

lecture_6

12 pages

power_11

power_11

42 pages

lecture_8

lecture_8

11 pages

midterm

midterm

9 pages

power_17

power_17

13 pages

power_14

power_14

55 pages

Final

Final

13 pages

Power One

Power One

53 pages

Summary

Summary

54 pages

Midterm

Midterm

6 pages

Lab #7

Lab #7

5 pages

powe 14

powe 14

32 pages

Lab #7

Lab #7

5 pages

Midterm

Midterm

8 pages

Power 17

Power 17

13 pages

Midterm

Midterm

6 pages

Lab Five

Lab Five

30 pages

power_16

power_16

64 pages

power_15

power_15

52 pages

Power One

Power One

64 pages

Final

Final

14 pages

Load more
Loading Unlocking...
Login

Join to view Expected Vs. Observed Frequencies and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Expected Vs. Observed Frequencies and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?