Wednesday, July 15, 2015

Example of a problem using a contigency table

American Continental Delta United Total
Yes 48 69 68 25 210
No 52 41 62 35 190
Total 100 110 130 60 400
Now what we have to do is get the expected number in each spot. For instance we need the expected number from American and YES. We get the expected number by taking the row total times the column total divided by the total number in all.
For American and YES that would be 210(100)/400 (row total of 210)(column total of 100)/(total of 400), which equals 52.5
You have to do that for ALL of the 8 different spots on the table. I'll show you one more .. For Continental and YES it's (210)(110)/400 = 57.75
If you do that correctly this is what you will have and i'll show on another table
American YES NO
Observed = 48 52
Expected = 52.5 47.5
Continental YES NO
Observed = 69 41
Expected = 57.5 52.25
Delta YES NO
Observed 68 62
Expected 60.25 61.75
United YES NO
Observed 25 35
Expected 31.5 28.5

Now to get the test statistic you have to take the (observed - expected)^2 . Divided that by the expected and sum all the values.
For American and YES that is (48-52.5)^2/52.5
For Continental and YES that is (69 - 57.75)^2/57.75
and so on....
If you do that for all eight values you should get 8.251 (you could have a slightly different number depending on how you round)

Now you need the critical value for the test. To get the df you take (rows - 1)(columns - 1)
We have 2 rows in the table and 4 columns, so df = (4-1)(2-1) = 3
Look in any chart for Chi-square distribution for 3 df and alpha = .05 and you get 9.488
We compare our test statistic to 9.488
Remember we reject Ho and conclude there is a preference to which airline we choose if the test statistic is greater than the critical value, but 8.251 < 9.488 so we do what? We do not reject Ho, so we have no preference as to what airline to choose

No comments:

Post a Comment