1 / 43

Module 21:  2 For Contingency Tables

Module 21:  2 For Contingency Tables. This module presents the  2 test for contingency tables, which can be used for tests of association and for differences between proportions. Reviewed 06 June 05 /MODULE 21. Contingency Tables.

tuvya
Download Presentation

Module 21:  2 For Contingency Tables

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Module 21: 2 For Contingency Tables This module presents the 2 test for contingency tables, which can be used for tests of association and for differences between proportions Reviewed 06 June 05 /MODULE 21 21- 1

  2. Contingency Tables Contingency tables are very common types of tables used to summarize. The cells of these tables typically include counts of something and/or percentages. For our purposes, we can use only those tables that have integers that are counts. If you are interested in analyzing data in a contingency table that includes only percentages in the cells, then you must convert these percentages into counts in order to proceed. 21- 2

  3. Source: AJPH, November 1977;67:1033-1036 21- 3

  4. 21- 4

  5. 21- 5

  6. Association Hypothesis H0: There is no association between the classification of the numbers of patients who kept their appointments and the classification of the sex of the patients, vs. H1: There is association between the classification of the numbers of patients who kept their appointments and the classification of the sex of the patients. 21- 6

  7. Proportions Hypothesis The association hypothesis can also be tested using a test of proportions hypothesis: H0: PM = PF vs. H1: PMPF where PM = Proportion of males in population who “kept their appointments,” PF = Proportion of females in population who “kept their appointments.” 21- 7

  8. Contingency Tables Contingency tables have: r = number of rows, not counting any totals c = number of columns, not counting any totals r  c = number of cells Approach is to compare observed number in each cell with the number expected under the assumption that the null hypothesis of no association is true. 21- 8

  9. Calculating Expected Numbers Calculating the number expected in each contingency table cell under the assumption that the null hypothesis is true is, in practice, quite simple. This number is equal to the total for the row the cell is in times the total for the column the cell is in divided by the overall total for the table. You may be interested in working out why this is true; however, it really isn’t worth the effort. The algebraic expression is: 21- 9

  10. Calculating χ2 The value of the test statistic χ2 calculated by comparing the observed number (O) to the expected number (E) in each cell according to the following formula: The result of this calculation is then compared to the appropriate value in the tables for the χ2 distribution. These are in the Table Module 3: The χ2 Distribution. Note that you need to look up χ20.95(df) for a test with the -level at  = 0.05. 21- 10

  11. So, for a 22 table, df = (2-1)(2-1) = 11=1 Reject H0: if 2 20.95(1) = 3.84 21- 11

  12. 2 Test for Appointment Keeping Example 1 • H0: There is no association between the classification of the numbers of patients who kept their appointments and the classification of the sex of the patients, • vs. • H1: There is association between the classification of the numbers of patients who kept their appointments and the classification of the sex of the patients. • The hypothesis: H0: PM = PF vs. H1: PM PF • The assumption: Contingency table • 3. The  – level: = 0.05 21- 12

  13. 21- 13

  14. 21- 14

  15. 4. The test statistic: 5. The critical region: Reject H0: if 220.95(1) = 3.84 6. The result:2 = 0.86 7. The conclusion: Accept H0; Since 2 = 0.86 < 3.84 21- 15

  16. The published table as shown on slide 13 indicates a result of Our result is If with df = 1; then p cannot be > 0.05 21- 16

  17. 21- 17

  18. 2 Test for Appointment Keeping Example 2 • H0: There is no association between the classification of the numbers of patients who kept their appointments and the classification of the age of the patients, • vs. • H1: There is association between the classification of the numbers of patients who kept their appointments and the classification of the age of the patients. • The hypothesis: H0: PY = PO vs. H1: PY PO • The assumption: Contingency table • 3. The  – level:  = 0.05 21- 18

  19. 21- 19

  20. 4. The test statistic: 5. The critical region: Reject H0: if 220.95(1) = 3.84 6. The result:2 = 16.90 7. The conclusion: Reject H0; Since 2 = 16.90 > 3.84 21- 20

  21. 21- 21

  22. 2 Test for Appointment Keeping Example 3 • H0: There is no association between the classification of the numbers of patients who kept their appointments and the classification of the ethnicity of the patients, • vs. • H1: There is association between the classification of the numbers of patients who kept their appointments and the classification of the ethnicity of the patients. • The hypothesis: H0: PP = PB= Pw vs. H1: PP PB ≠ Pw • The assumption: Contingency table • 3. The  – level: = 0.05 21- 22

  23. 21- 23

  24. 4. The test statistic: 5. The critical region: Reject H0: if 220.95(2) = 5.99 6. The result:2 = 54.43 7. The conclusion: Reject H0; Since 2 = 54.43 > 5.99 21- 24

  25. Source: AJPH, July 1996; 86: 948-955 21- 25

  26. 21- 26

  27. 21- 27

  28. 2 Test for Heavy Drinkers Intervention Example 1 • The Hypothesis • H0: There is no association between the classification of the number of male patients according to their change in alcohol consumption and the treatment they received • vs. • H1: There is an association between the classification of the numbers of male patients according to their change in alcohol consumption and the treatment they received. • 2. The assumption: Contingency table • 3. The  – level: = 0.05 21- 28

  29. 21- 29

  30. 4. The test statistic: 5. The critical region: for a 3 x 3 table; df = (3-1)(3-1) = 4 Reject H0: if 220.95(4) = 9.49 6. The result:2 = 32.03 7. The conclusion: Reject H0; Since 2 = 32.03 > 9.49 21- 30

  31. 21- 31

  32. 2 Test for Heavy Drinkers Intervention Example 2 • The Hypothesis • H0: There is no association between the classification of the number of male patients according to their posttest hazardous alcohol consumption and the treatment they received. • vs. • H1: There is an association between the classification of the numbers of male patients to according to their posttest hazardous alcohol consumption and the treatment they received. • 2. The assumption: Contingency table • 3. The  – level: = 0.05 21- 32

  33. 21- 33

  34. 4. The test statistic: 5. The critical region: for a 2 x 3 table; df = (2-1)(3-1) = 2 Reject H0: if 220.95(2) = 5.99 6. The result:2 = 11.74 7. The conclusion: Reject H0 , since 2 = 11.74 > 5.99 21- 34

  35. Source: AJPH, August 2001; 91: 1258-1263 21- 35

  36. 21- 36

  37. 21- 37

  38. 21- 38

  39. 21- 39

  40. 2 Test for the MATISS Project • The Hypothesis • H0: There is no association between the classification of the number of male patients according to their heart rate category and this classification of their diabetes status. • vs. • H1: There is an association between the classification of the numbers of male patients to according to their heart rate category and this classification of their diabetes status. • 2. The assumption: Contingency table • 3. The  – level: = 0.05 21- 40

  41. 21- 41

  42. 21- 42

  43. 4. The test statistic: 5. The critical region: Reject H0: if 220.95(4) = 9.49 6. The result:2 = 15.45 7. The conclusion: Reject H0; Since 2 = 15.45 > 9.49 21- 43

More Related