{"id":1414,"date":"2023-06-22T02:22:56","date_gmt":"2023-06-22T02:22:56","guid":{"rendered":"https:\/\/content.one.lumenlearning.com\/introstatstest\/chapter\/chi-square-test-of-homogeneity-learn-it-3\/"},"modified":"2026-11-23T21:59:58","modified_gmt":"2026-11-23T21:59:58","slug":"chi-square-test-of-homogeneity-learn-it-3","status":"publish","type":"chapter","link":"https:\/\/content.one.lumenlearning.com\/introstatstest\/chapter\/chi-square-test-of-homogeneity-learn-it-3\/","title":{"raw":"Chi-Square Test of Homogeneity \u2013 Learn It 3","rendered":"Chi-Square Test of Homogeneity \u2013 Learn It 3"},"content":{"raw":"<section class=\"textbox learningGoals\">\r\n<ul>\r\n\t<li><span data-sheets-value=\"{&quot;1&quot;:2,&quot;2&quot;:&quot;Complete a chi-square test of homogeneity&quot;}\" data-sheets-userformat=\"{&quot;2&quot;:12801,&quot;3&quot;:{&quot;1&quot;:0},&quot;12&quot;:0,&quot;15&quot;:&quot;arial&quot;,&quot;16&quot;:9}\">Complete a chi-square test of homogeneity<\/span><\/li>\r\n<\/ul>\r\n<\/section>\r\n<h2>Expected Counts<\/h2>\r\n<section class=\"textbox recall\" aria-label=\"Recall\">\r\n<p>We can calculate the expected count of any cell in a frequency table by calculating:<\/p>\r\n<p style=\"text-align: center;\">[latex]\\frac{\\text{row total}\\times \\text{column total}}{\\text{total}}[\/latex]<\/p>\r\n<\/section>\r\n<p>As with the goodness of fit test, we need to find the expected count for each group. In this case, our null hypothesis is that the distribution of proportions of outcomes for each year is the same. We estimate those proportions by looking at the overall proportions for each outcome among all three years.<\/p>\r\n<section class=\"textbox example\"><strong>Overall<\/strong>\r\n<table>\r\n<tbody>\r\n<tr>\r\n<td>&nbsp;<\/td>\r\n<td><strong>Adopted<\/strong><\/td>\r\n<td><strong>Returned to Owner<\/strong><\/td>\r\n<td><strong>Transferred<\/strong><\/td>\r\n<td><strong>Euthanized<\/strong><\/td>\r\n<td><strong>Total<\/strong><\/td>\r\n<\/tr>\r\n<tr>\r\n<td><strong>Total <\/strong><\/td>\r\n<td>1,629<\/td>\r\n<td>981<\/td>\r\n<td>199<\/td>\r\n<td>264<\/td>\r\n<td>3,073<\/td>\r\n<\/tr>\r\n<\/tbody>\r\n<\/table>\r\n<p>With adoptions, there were [latex]1,629[\/latex] dogs adopted in total out of the total [latex]3,073[\/latex] dogs for all three years we\u2019re considering. So, the estimated adoption proportion for all three years is:<\/p>\r\n<p style=\"text-align: center;\">[latex]\\dfrac{1,629}{3,073}=0.53010088 \\approx 53.0\\%[\/latex]<\/p>\r\n<p>If the distributions are the same, or homogeneous (i.e., if the null hypothesis is true), we would expect each year to have about [latex]53.0\\%[\/latex] of its dogs be adopted. The year 2022, for example, would have an expected count of adoptions that is about [latex]53.0\\%[\/latex] of the total [latex]837[\/latex] dogs that left the shelter in 2022.<\/p>\r\n<p>In this case, we will use more decimal places in our calculation to avoid rounding errors:<\/p>\r\n<p style=\"text-align: center;\">[latex]0.53010088*837=443.7[\/latex]<\/p>\r\n<p class=\"para\">Note that since the expected counts are theoretical values, they do not need to be whole numbers.<\/p>\r\n<\/section>\r\n<section class=\"textbox tryIt\">[ohm2_question hide_question_numbers=1 ]2407[\/ohm2_question]<\/section>\r\n<p>Notice that once we had the expected adoption counts for 2022 and 2023, we could have just subtracted those from the total number of adoptions in order to find the expected count for 2024. (Try this out to check your answer!) The same goes for each column: once we have two of the expected counts, we can find the third by subtracting. Similarly, in each row, once we have three of the expected counts, we can find the fourth by subtracting. This gives us [latex]2*3=6[\/latex] degrees of freedom for our chi-square test of homogeneity. (In other words, once we have filled in six cells in the table of expected counts, we can fill in the others by subtracting.)<\/p>\r\n<section class=\"textbox tryIt\">[ohm2_question hide_question_numbers=1 ]2440[\/ohm2_question]<\/section>\r\n<section class=\"textbox keyTakeaway\">\r\n<h3>degree of freedom ([latex]df[\/latex])<\/h3>\r\n<p>In general, if the two-way table for a homogeneity test has [latex]C[\/latex] columns and [latex]R[\/latex] rows, then there are <strong>[latex](R-1)(C-1)[\/latex] degrees of freedom<\/strong>.<\/p>\r\n<\/section>\r\n<p>Notice that in our example, there are three rows (representing years) and four columns (representing outcomes), which gives [latex](3-1)(4-1)=2*3=6[\/latex] degrees of freedom, as we saw previously.<\/p>","rendered":"<section class=\"textbox learningGoals\">\n<ul>\n<li><span data-sheets-value=\"{&quot;1&quot;:2,&quot;2&quot;:&quot;Complete a chi-square test of homogeneity&quot;}\" data-sheets-userformat=\"{&quot;2&quot;:12801,&quot;3&quot;:{&quot;1&quot;:0},&quot;12&quot;:0,&quot;15&quot;:&quot;arial&quot;,&quot;16&quot;:9}\">Complete a chi-square test of homogeneity<\/span><\/li>\n<\/ul>\n<\/section>\n<h2>Expected Counts<\/h2>\n<section class=\"textbox recall\" aria-label=\"Recall\">\n<p>We can calculate the expected count of any cell in a frequency table by calculating:<\/p>\n<p style=\"text-align: center;\">[latex]\\frac{\\text{row total}\\times \\text{column total}}{\\text{total}}[\/latex]<\/p>\n<\/section>\n<p>As with the goodness of fit test, we need to find the expected count for each group. In this case, our null hypothesis is that the distribution of proportions of outcomes for each year is the same. We estimate those proportions by looking at the overall proportions for each outcome among all three years.<\/p>\n<section class=\"textbox example\"><strong>Overall<\/strong><\/p>\n<table>\n<tbody>\n<tr>\n<td>&nbsp;<\/td>\n<td><strong>Adopted<\/strong><\/td>\n<td><strong>Returned to Owner<\/strong><\/td>\n<td><strong>Transferred<\/strong><\/td>\n<td><strong>Euthanized<\/strong><\/td>\n<td><strong>Total<\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>Total <\/strong><\/td>\n<td>1,629<\/td>\n<td>981<\/td>\n<td>199<\/td>\n<td>264<\/td>\n<td>3,073<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>With adoptions, there were [latex]1,629[\/latex] dogs adopted in total out of the total [latex]3,073[\/latex] dogs for all three years we\u2019re considering. So, the estimated adoption proportion for all three years is:<\/p>\n<p style=\"text-align: center;\">[latex]\\dfrac{1,629}{3,073}=0.53010088 \\approx 53.0\\%[\/latex]<\/p>\n<p>If the distributions are the same, or homogeneous (i.e., if the null hypothesis is true), we would expect each year to have about [latex]53.0\\%[\/latex] of its dogs be adopted. The year 2022, for example, would have an expected count of adoptions that is about [latex]53.0\\%[\/latex] of the total [latex]837[\/latex] dogs that left the shelter in 2022.<\/p>\n<p>In this case, we will use more decimal places in our calculation to avoid rounding errors:<\/p>\n<p style=\"text-align: center;\">[latex]0.53010088*837=443.7[\/latex]<\/p>\n<p class=\"para\">Note that since the expected counts are theoretical values, they do not need to be whole numbers.<\/p>\n<\/section>\n<section class=\"textbox tryIt\"><iframe loading=\"lazy\" id=\"ohm2407\" class=\"resizable\" src=\"https:\/\/ohm.one.lumenlearning.com\/multiembedq.php?id=2407&theme=lumen&iframe_resize_id=ohm2407&source=tnh\" width=\"100%\" height=\"150\"><\/iframe><\/section>\n<p>Notice that once we had the expected adoption counts for 2022 and 2023, we could have just subtracted those from the total number of adoptions in order to find the expected count for 2024. (Try this out to check your answer!) The same goes for each column: once we have two of the expected counts, we can find the third by subtracting. Similarly, in each row, once we have three of the expected counts, we can find the fourth by subtracting. This gives us [latex]2*3=6[\/latex] degrees of freedom for our chi-square test of homogeneity. (In other words, once we have filled in six cells in the table of expected counts, we can fill in the others by subtracting.)<\/p>\n<section class=\"textbox tryIt\"><iframe loading=\"lazy\" id=\"ohm2440\" class=\"resizable\" src=\"https:\/\/ohm.one.lumenlearning.com\/multiembedq.php?id=2440&theme=lumen&iframe_resize_id=ohm2440&source=tnh\" width=\"100%\" height=\"150\"><\/iframe><\/section>\n<section class=\"textbox keyTakeaway\">\n<h3>degree of freedom ([latex]df[\/latex])<\/h3>\n<p>In general, if the two-way table for a homogeneity test has [latex]C[\/latex] columns and [latex]R[\/latex] rows, then there are <strong>[latex](R-1)(C-1)[\/latex] degrees of freedom<\/strong>.<\/p>\n<\/section>\n<p>Notice that in our example, there are three rows (representing years) and four columns (representing outcomes), which gives [latex](3-1)(4-1)=2*3=6[\/latex] degrees of freedom, as we saw previously.<\/p>\n","protected":false},"author":8,"menu_order":21,"template":"","meta":{"_candela_citation":"[]","pb_show_title":"on","pb_short_title":"","pb_subtitle":"","pb_authors":[],"pb_section_license":""},"chapter-type":[],"contributor":[],"license":[],"class_list":["post-1414","chapter","type-chapter","status-publish","hentry"],"part":1388,"module-header":"learn_it","content_attributions":[],"internal_book_links":[],"video_content":null,"cc_video_embed_content":{"cc_scripts":"","media_targets":[]},"try_it_collection":null,"_links":{"self":[{"href":"https:\/\/content.one.lumenlearning.com\/introstatstest\/wp-json\/pressbooks\/v2\/chapters\/1414","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/content.one.lumenlearning.com\/introstatstest\/wp-json\/pressbooks\/v2\/chapters"}],"about":[{"href":"https:\/\/content.one.lumenlearning.com\/introstatstest\/wp-json\/wp\/v2\/types\/chapter"}],"author":[{"embeddable":true,"href":"https:\/\/content.one.lumenlearning.com\/introstatstest\/wp-json\/wp\/v2\/users\/8"}],"version-history":[{"count":16,"href":"https:\/\/content.one.lumenlearning.com\/introstatstest\/wp-json\/pressbooks\/v2\/chapters\/1414\/revisions"}],"predecessor-version":[{"id":7192,"href":"https:\/\/content.one.lumenlearning.com\/introstatstest\/wp-json\/pressbooks\/v2\/chapters\/1414\/revisions\/7192"}],"part":[{"href":"https:\/\/content.one.lumenlearning.com\/introstatstest\/wp-json\/pressbooks\/v2\/parts\/1388"}],"metadata":[{"href":"https:\/\/content.one.lumenlearning.com\/introstatstest\/wp-json\/pressbooks\/v2\/chapters\/1414\/metadata\/"}],"wp:attachment":[{"href":"https:\/\/content.one.lumenlearning.com\/introstatstest\/wp-json\/wp\/v2\/media?parent=1414"}],"wp:term":[{"taxonomy":"chapter-type","embeddable":true,"href":"https:\/\/content.one.lumenlearning.com\/introstatstest\/wp-json\/pressbooks\/v2\/chapter-type?post=1414"},{"taxonomy":"contributor","embeddable":true,"href":"https:\/\/content.one.lumenlearning.com\/introstatstest\/wp-json\/wp\/v2\/contributor?post=1414"},{"taxonomy":"license","embeddable":true,"href":"https:\/\/content.one.lumenlearning.com\/introstatstest\/wp-json\/wp\/v2\/license?post=1414"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}