13.2 Test of Independence
Lab 13.2.1
The contingency table below shows the prison population of Illinois in June 2021. Test the hypothesis that race (Black, White and Hispanic) and crime-class are independent at 5% level of significance.
| Class | Black | Hispanic | White |
|---|---|---|---|
| 1 | 1734 | 475 | 1281 |
| 2 | 2071 | 373 | 1938 |
| 3 | 678 | 103 | 935 |
| 4 | 534 | 92 | 560 |
| X | 5644 | 1661 | 2613 |
| Murder | 4094 | 927 | 1277 |
Use the chi2_test_of_indp function above.
Adapted from Python for Introductory Statistics: Student's Lab Workbook, by Simon Aman (Truman College, City Colleges of Chicago), licensed under CC BY 4.0. Changes were made: reformatted as an accessible XYZ web edition with live in-browser code cells. License: CC-BY-4.0.