{"id":576,"date":"2015-07-19T16:44:35","date_gmt":"2015-07-19T20:44:35","guid":{"rendered":"http:\/\/sites.berry.edu\/vbissonnette\/?page_id=576"},"modified":"2021-01-15T08:49:39","modified_gmt":"2021-01-15T13:49:39","slug":"contingency-test-solution","status":"publish","type":"page","link":"https:\/\/sites.berry.edu\/vbissonnette\/index\/stats-homework\/documentation\/contingency-test\/contingency-test-solution\/","title":{"rendered":"Contingency Test Solution"},"content":{"rendered":"<h3>Example Homework Problem:<\/h3>\n<p>When polled about a proposition on an upcoming ballot, the responses of men and women were as follows:<\/p>\n<table>\n<tbody>\n<tr>\n<td><\/td>\n<td style=\"border-bottom: 1px solid black;width: 90px;text-align: center\">Agree<\/td>\n<td style=\"border-bottom: 1px solid black;width: 90px;text-align: center\">Undecided<\/td>\n<td style=\"border-bottom: 1px solid black;width: 90px;text-align: center\">Disagree<\/td>\n<\/tr>\n<tr>\n<td>Men:<\/td>\n<td style=\"border: 1px solid black;text-align: center\">70<\/td>\n<td style=\"border: 1px solid black;text-align: center\">25<\/td>\n<td style=\"border: 1px solid black;text-align: center\">40<\/td>\n<\/tr>\n<tr>\n<td>Women:<\/td>\n<td style=\"border: 1px solid black;text-align: center\">30<\/td>\n<td style=\"border: 1px solid black;text-align: center\">20<\/td>\n<td style=\"border: 1px solid black;text-align: center\">25<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Do men and women differ in their attitudes towards this issue (alpha = .05)?<\/p>\n<hr \/>\n<p>You want to know if there is a significant relationship between one&#8217;s gender and her or his attitude toward this issue. That&#8217;s why this is called a <u>Contingency Table<\/u> &#8212; you want to know if the categorical outcome (columns) is contingent on (i.e., related to) the categorical factor (rows).<\/p>\n<p>We would use the <u>Chi Square<\/u> statistic to test for a significant contingency between gender and attitude:<\/p>\n<p><a href=\"http:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2015\/07\/contin1.png\"><img loading=\"lazy\" decoding=\"async\" class=\" size-full wp-image-75 aligncenter\" src=\"http:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2015\/07\/contin1.png\" alt=\"contin1\" width=\"381\" height=\"48\" srcset=\"https:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2015\/07\/contin1.png 381w, https:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2015\/07\/contin1-300x38.png 300w\" sizes=\"auto, (max-width: 381px) 100vw, 381px\" \/><\/a>where f_o refers to the obtained frequencies in your study and f_e refers to the expected frequencies in your study. r is equal to the number of rows in our table, and c is equal to the number of columns. In our case, r = 2 and c = 3.<\/p>\n<p>The expected frequencies come from a model that assumes that one&#8217;s attitude and one&#8217;s gender are unrelated. We compute the value of the expected frequency for each cell with this formula:<\/p>\n<p><a href=\"http:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2015\/07\/contin2.png\"><img loading=\"lazy\" decoding=\"async\" class=\" size-full wp-image-76 aligncenter\" src=\"http:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2015\/07\/contin2.png\" alt=\"contin2\" width=\"176\" height=\"47\" \/><\/a><\/p>\n<p>So, we need to set up our analysis by first computing the total frequency for each row, and for each column. Then compute the overall total frequency. Finally, compute the expected frequency for each cell in our table. For example, the expected frequency in the first cell would be equal to 100 * 135 \/ 210 = 64.29.<\/p>\n<p>Your completed table should look like this:<\/p>\n<table>\n<tbody>\n<tr>\n<td><\/td>\n<td style=\"border-bottom: 1px solid black;width: 90px;text-align: center\">Agree<\/td>\n<td style=\"border-bottom: 1px solid black;width: 90px;text-align: center\">Undecided<\/td>\n<td style=\"border-bottom: 1px solid black;width: 90px;text-align: center\">Disagree<\/td>\n<td style=\"border-bottom: 1px solid black;width: 90px;text-align: center\">Sum<\/td>\n<\/tr>\n<tr>\n<td>Men:<\/td>\n<td style=\"border: 1px solid black;text-align: center\">70<br \/>\n(64.29)<\/td>\n<td style=\"border: 1px solid black;text-align: center\">25<br \/>\n(28.93)<\/td>\n<td style=\"border: 1px solid black;text-align: center\">40<br \/>\n(41.79)<\/td>\n<td style=\"text-align: center\">135<\/td>\n<\/tr>\n<tr>\n<td>Women:<\/td>\n<td style=\"border: 1px solid black;text-align: center\">30<br \/>\n(35.71)<\/td>\n<td style=\"border: 1px solid black;text-align: center\">20<br \/>\n(16.07)<\/td>\n<td style=\"border: 1px solid black;text-align: center\">25<br \/>\n(23.21)<\/td>\n<td class=\"rt\" style=\"text-align: center\">75<\/td>\n<\/tr>\n<tr>\n<td class=\"lf\">Sum:<\/td>\n<td style=\"text-align: center\">100<\/td>\n<td style=\"text-align: center\">45<\/td>\n<td style=\"text-align: center\">65<\/td>\n<td class=\"rt\" style=\"text-align: center\">210<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>where the expected frequency for each cell is in parentheses. Computing the Chi Square statistic is simple, but you need to be patient with the number of steps involved:<\/p>\n<p><a href=\"http:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2015\/07\/contin3.png\"><img loading=\"lazy\" decoding=\"async\" class=\" size-full wp-image-77 aligncenter\" src=\"http:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2015\/07\/contin3.png\" alt=\"contin3\" width=\"515\" height=\"120\" srcset=\"https:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2015\/07\/contin3.png 515w, https:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2015\/07\/contin3-300x70.png 300w\" sizes=\"auto, (max-width: 515px) 100vw, 515px\" \/><\/a><\/p>\n<p>It&#8217;s a good idea here to use the memory function in your calculator:<br \/>\na) clear your calculator&#8217;s memory, b) compute the first segment of this<br \/>\nequation and place the result in your memory, and c) compute each other<br \/>\nsegment of the equation and add each to your memory. When you are done,<br \/>\njust recall the sum that is in your calculator&#8217;s memory (3.13).<\/p>\n<p><b>Conduct hypothesis test<\/b>. The <i>df<\/i> for our <i>\u03a7\u00b2<\/i> test will be the number of rows minus 1 times the number of columns minus 1; in our case, <i>df<\/i> = (2-1)(3-1) = 2. Our alpha = .05. From your table of critical values for the <i>\u03a7\u00b2<\/i> test, you will find that if the obtained value of <i>\u03a7\u00b2<\/i> is greater than 5.99, we would conclude that attitude is contingent on gender.<\/p>\n<p>Since 3.13 is not greater than 5.99, we would <span style=\"text-decoration: underline\">not<\/span> conclude that attitude was contingent on \/ related to gender in our sample.<\/p>\n<p><b>Compute effect size<\/b>. If your study involves a 2 X 2 contingency table, we would typically use the Phi Coefficient to compute effect size:<\/p>\n<p><a href=\"http:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2015\/07\/contin4.png\"><img loading=\"lazy\" decoding=\"async\" class=\" size-full wp-image-78 aligncenter\" src=\"http:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2015\/07\/contin4.png\" alt=\"contin4\" width=\"84\" height=\"48\" \/><\/a><\/p>\n<p>In our case, we analyzed a 2 X 3 contingency table. So, we will use a relative of Phi &#8212; Cramer&#8217;s V:<\/p>\n<p><a href=\"https:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2015\/07\/contin5.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-79\" src=\"https:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2015\/07\/contin5.png\" alt=\"contin5\" width=\"372\" height=\"61\" srcset=\"https:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2015\/07\/contin5.png 372w, https:\/\/sites.berry.edu\/vbissonnette\/wp-content\/uploads\/sites\/21\/2015\/07\/contin5-300x49.png 300w\" sizes=\"auto, (max-width: 372px) 100vw, 372px\" \/><\/a><\/p>\n<p>where N equals the total number of observations. In our case, we had 210 participants. k equals either the number of rows, or the number of columns &#8212; whichever is <u>less<\/u>. In our analysis, we will use the number of rows: 2.<\/p>\n<p>Phi and Cramer&#8217;s V describe the strength of the contingency in familiar terms &#8212; they are much like the Pearson correlation; they range from 0.0 (no relationship to 1.00 (a perfect relationship).<\/p>\n<hr \/>\n<p><a href=\"http:\/\/sites.berry.edu\/vbissonnette\/index\/stats-homework\/documentation\/contingency-test\/\">Return to Contingency Table<\/a><\/p>\n<p><a href=\"http:\/\/sites.berry.edu\/vbissonnette\/index\/stats-homework\/documentation\/\">Return to Table of Contents<\/a><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Example Homework Problem: When polled about a proposition on an upcoming ballot, the responses of men and women were as follows: Agree Undecided Disagree Men: 70 25 40 Women: 30 [&hellip;]<\/p>\n","protected":false},"author":34,"featured_media":0,"parent":572,"menu_order":0,"comment_status":"open","ping_status":"open","template":"","meta":{"site-container-style":"default","site-container-layout":"default","site-sidebar-layout":"default","site-transparent-header":"default","disable-article-header":"default","disable-site-header":"default","disable-site-footer":"default","disable-content-area-spacing":"default","footnotes":""},"class_list":["post-576","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/sites.berry.edu\/vbissonnette\/wp-json\/wp\/v2\/pages\/576","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sites.berry.edu\/vbissonnette\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/sites.berry.edu\/vbissonnette\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/sites.berry.edu\/vbissonnette\/wp-json\/wp\/v2\/users\/34"}],"replies":[{"embeddable":true,"href":"https:\/\/sites.berry.edu\/vbissonnette\/wp-json\/wp\/v2\/comments?post=576"}],"version-history":[{"count":8,"href":"https:\/\/sites.berry.edu\/vbissonnette\/wp-json\/wp\/v2\/pages\/576\/revisions"}],"predecessor-version":[{"id":1952,"href":"https:\/\/sites.berry.edu\/vbissonnette\/wp-json\/wp\/v2\/pages\/576\/revisions\/1952"}],"up":[{"embeddable":true,"href":"https:\/\/sites.berry.edu\/vbissonnette\/wp-json\/wp\/v2\/pages\/572"}],"wp:attachment":[{"href":"https:\/\/sites.berry.edu\/vbissonnette\/wp-json\/wp\/v2\/media?parent=576"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}