{"id":383,"date":"2020-07-09T18:03:05","date_gmt":"2020-07-09T22:03:05","guid":{"rendered":"https:\/\/openbooks.macewan.ca\/rcommander\/?post_type=chapter&#038;p=383"},"modified":"2024-02-08T13:21:00","modified_gmt":"2024-02-08T18:21:00","slug":"3-9-contingency-table","status":"publish","type":"chapter","link":"https:\/\/openbooks.macewan.ca\/introstats\/chapter\/3-9-contingency-table\/","title":{"raw":"3.9 Contingency Table: Joint and Marginal Probability","rendered":"3.9 Contingency Table: Joint and Marginal Probability"},"content":{"raw":"<span style=\"font-weight: normal; text-align: initial; font-size: 1em;\">Recall the contingency table in the example of association between breast cancer and smoking:<\/span>\r\n<p style=\"text-align: center;\"><strong>Table 3.3<\/strong>: Contingency Table of \"Cancer Status\" and \"Smoking Status\"<\/p>\r\n\r\n<div align=\"center\">\r\n<table class=\"aligncenter first-col-border last-col-border\" style=\"width: 100%; height: 60px;\" border=\"1\" cellspacing=\"0\" cellpadding=\"2\">\r\n<thead>\r\n<tr class=\"border-bottom\" style=\"height: 15px;\">\r\n<td style=\"height: 15px; width: 28.333333333333336%;\" valign=\"top\"><\/td>\r\n<th style=\"height: 15px; width: 24.102564102564106%;\" scope=\"col\" valign=\"top\"><span style=\"color: #0000ff;\"><strong>Smoker (S)<\/strong><\/span><\/th>\r\n<th style=\"height: 15px; width: 29.871794871794865%;\" scope=\"col\" valign=\"top\"><span style=\"color: #0000ff;\"><strong>Non-smoker (not S)<\/strong><\/span><\/th>\r\n<th style=\"height: 15px; width: 17.564102564102566%;\" scope=\"col\" valign=\"top\"><strong>Total<\/strong><\/th>\r\n<\/tr>\r\n<\/thead>\r\n<tbody>\r\n<tr style=\"height: 15px;\">\r\n<th style=\"height: 15px; width: 28.333333333333336%;\" scope=\"row\" valign=\"top\"><span style=\"color: #ff0000;\"><strong>Breast Cancer (B)<\/strong><\/span><\/th>\r\n<td style=\"height: 15px; width: 24.102564102564106%;\" valign=\"top\">1<span style=\"color: #333333;\">0 (<strong>B &amp; S<\/strong>)<\/span><\/td>\r\n<td style=\"height: 15px; width: 29.871794871794865%;\" valign=\"top\">30 (<strong><em>B &amp; not S<\/em><\/strong>)<\/td>\r\n<td style=\"height: 15px; width: 17.564102564102566%;\" valign=\"top\"><span style=\"color: #ff0000;\">40\u00a0 (<strong><em>B<\/em><\/strong>)<\/span><\/td>\r\n<\/tr>\r\n<tr class=\"border-bottom\" style=\"height: 15px;\">\r\n<th style=\"height: 15px; width: 28.333333333333336%;\" scope=\"row\" valign=\"top\"><span style=\"color: #ff0000;\"><strong>Cancer Free (not B)<\/strong><\/span><\/th>\r\n<td style=\"height: 15px; width: 24.102564102564106%;\" valign=\"top\">20 (<strong><em>not B &amp; S<\/em><\/strong>)<\/td>\r\n<td style=\"height: 15px; width: 29.871794871794865%;\" valign=\"top\">140 (<strong><em>not B &amp; not S<\/em><\/strong>)<\/td>\r\n<td style=\"height: 15px; width: 17.564102564102566%;\" valign=\"top\"><span style=\"color: #ff0000;\">160\u00a0 (<strong><em>not B<\/em><\/strong>)<\/span><\/td>\r\n<\/tr>\r\n<tr style=\"height: 15px;\">\r\n<th style=\"height: 15px; width: 28.333333333333336%;\" scope=\"row\" valign=\"top\"><strong>Total<\/strong><\/th>\r\n<td style=\"height: 15px; width: 24.102564102564106%;\" valign=\"top\"><span style=\"color: #0000ff;\">30 (<strong class=\"bluetext\"><em>S<\/em><\/strong>)<\/span><\/td>\r\n<td style=\"height: 15px; width: 29.871794871794865%;\" valign=\"top\"><span style=\"color: #0000ff;\">170 (<strong><em>not S<\/em><\/strong>)<\/span><\/td>\r\n<td style=\"height: 15px; width: 17.564102564102566%;\" valign=\"top\"><strong>200<\/strong><\/td>\r\n<\/tr>\r\n<\/tbody>\r\n<\/table>\r\n<\/div>\r\nThe row variable is \u201c<span style=\"color: #ff0000;\">Cancer Status<\/span>\u201d with two possible values: breast cancer or cancer free. The column variable is \u201c<span style=\"color: #0000ff;\">Smoking Status<\/span>\u201d with two possible values: smoker and non-smoker.\r\n\r\nThe <strong>marginal probabilities<\/strong> are the row or column totals divided by the grand total. For the current example, the marginal probabilities are:\r\n<p style=\"text-align: center;\" align=\"center\">[latex] P(B) = \\frac{40}{200} = 0.2, \\quad P(\\text{not }B) = \\frac{160}{200} = 0.8; [\/latex]<\/p>\r\n<p style=\"text-align: center;\" align=\"center\">[latex] P(S) = \\frac{30}{200} = 0.15, \\quad P(\\text{not }S) = \\frac{170}{200} = 0.85.[\/latex]<\/p>\r\nNote that [latex]P(B)=0.2[\/latex] and [latex]P(\\mbox{not } B)=0.8[\/latex] give the marginal probability distribution of the row variable \"Cancer Status\" and they add up to 1. Similarly, [latex]P(S)=0.15[\/latex] and [latex]P(\\mbox{not } S)=0.85[\/latex] give the marginal probability distribution of the column variable \"Smoking Status\" and they sum to 1.\r\n\r\nThe <strong>joint probabilities<\/strong> are the frequencies in the cells divided by the grand total. For the current example, the joint probabilities are:\r\n<p style=\"text-align: center;\" align=\"center\">[latex] P(B \\: \\&amp; \\: S) = \\frac{10}{200}=0.05, \\quad P(B\\: \\&amp; \\text{ not }S) = \\frac{30}{200} = 0.15,[\/latex]<\/p>\r\n<p style=\"text-align: center;\" align=\"center\">[latex] P(\\text{not }B \\: \\&amp; \\: S) = \\frac{20}{200}=0.1, \\quad P(\\text{not }B \\: \\&amp; \\text{ not }S) = \\frac{140}{200} = 0.7.[\/latex]<\/p>","rendered":"<p><span style=\"font-weight: normal; text-align: initial; font-size: 1em;\">Recall the contingency table in the example of association between breast cancer and smoking:<\/span><\/p>\n<p style=\"text-align: center;\"><strong>Table 3.3<\/strong>: Contingency Table of &#8220;Cancer Status&#8221; and &#8220;Smoking Status&#8221;<\/p>\n<div style=\"margin: auto;\">\n<table class=\"aligncenter first-col-border last-col-border\" style=\"width: 100%; height: 60px; border-spacing: 0px;\" cellpadding=\"2\">\n<thead>\n<tr class=\"border-bottom\" style=\"height: 15px;\">\n<td style=\"height: 15px; width: 28.333333333333336%;\" valign=\"top\"><\/td>\n<th style=\"height: 15px; width: 24.102564102564106%;\" scope=\"col\" valign=\"top\"><span style=\"color: #0000ff;\"><strong>Smoker (S)<\/strong><\/span><\/th>\n<th style=\"height: 15px; width: 29.871794871794865%;\" scope=\"col\" valign=\"top\"><span style=\"color: #0000ff;\"><strong>Non-smoker (not S)<\/strong><\/span><\/th>\n<th style=\"height: 15px; width: 17.564102564102566%;\" scope=\"col\" valign=\"top\"><strong>Total<\/strong><\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr style=\"height: 15px;\">\n<th style=\"height: 15px; width: 28.333333333333336%;\" scope=\"row\" valign=\"top\"><span style=\"color: #ff0000;\"><strong>Breast Cancer (B)<\/strong><\/span><\/th>\n<td style=\"height: 15px; width: 24.102564102564106%;\" valign=\"top\">1<span style=\"color: #333333;\">0 (<strong>B &amp; S<\/strong>)<\/span><\/td>\n<td style=\"height: 15px; width: 29.871794871794865%;\" valign=\"top\">30 (<strong><em>B &amp; not S<\/em><\/strong>)<\/td>\n<td style=\"height: 15px; width: 17.564102564102566%;\" valign=\"top\"><span style=\"color: #ff0000;\">40\u00a0 (<strong><em>B<\/em><\/strong>)<\/span><\/td>\n<\/tr>\n<tr class=\"border-bottom\" style=\"height: 15px;\">\n<th style=\"height: 15px; width: 28.333333333333336%;\" scope=\"row\" valign=\"top\"><span style=\"color: #ff0000;\"><strong>Cancer Free (not B)<\/strong><\/span><\/th>\n<td style=\"height: 15px; width: 24.102564102564106%;\" valign=\"top\">20 (<strong><em>not B &amp; S<\/em><\/strong>)<\/td>\n<td style=\"height: 15px; width: 29.871794871794865%;\" valign=\"top\">140 (<strong><em>not B &amp; not S<\/em><\/strong>)<\/td>\n<td style=\"height: 15px; width: 17.564102564102566%;\" valign=\"top\"><span style=\"color: #ff0000;\">160\u00a0 (<strong><em>not B<\/em><\/strong>)<\/span><\/td>\n<\/tr>\n<tr style=\"height: 15px;\">\n<th style=\"height: 15px; width: 28.333333333333336%;\" scope=\"row\" valign=\"top\"><strong>Total<\/strong><\/th>\n<td style=\"height: 15px; width: 24.102564102564106%;\" valign=\"top\"><span style=\"color: #0000ff;\">30 (<strong class=\"bluetext\"><em>S<\/em><\/strong>)<\/span><\/td>\n<td style=\"height: 15px; width: 29.871794871794865%;\" valign=\"top\"><span style=\"color: #0000ff;\">170 (<strong><em>not S<\/em><\/strong>)<\/span><\/td>\n<td style=\"height: 15px; width: 17.564102564102566%;\" valign=\"top\"><strong>200<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>The row variable is \u201c<span style=\"color: #ff0000;\">Cancer Status<\/span>\u201d with two possible values: breast cancer or cancer free. The column variable is \u201c<span style=\"color: #0000ff;\">Smoking Status<\/span>\u201d with two possible values: smoker and non-smoker.<\/p>\n<p>The <strong>marginal probabilities<\/strong> are the row or column totals divided by the grand total. For the current example, the marginal probabilities are:<\/p>\n<p style=\"text-align: center; text-align: center;\">[latex]P(B) = \\frac{40}{200} = 0.2, \\quad P(\\text{not }B) = \\frac{160}{200} = 0.8;[\/latex]<\/p>\n<p style=\"text-align: center; text-align: center;\">[latex]P(S) = \\frac{30}{200} = 0.15, \\quad P(\\text{not }S) = \\frac{170}{200} = 0.85.[\/latex]<\/p>\n<p>Note that [latex]P(B)=0.2[\/latex] and [latex]P(\\mbox{not } B)=0.8[\/latex] give the marginal probability distribution of the row variable &#8220;Cancer Status&#8221; and they add up to 1. Similarly, [latex]P(S)=0.15[\/latex] and [latex]P(\\mbox{not } S)=0.85[\/latex] give the marginal probability distribution of the column variable &#8220;Smoking Status&#8221; and they sum to 1.<\/p>\n<p>The <strong>joint probabilities<\/strong> are the frequencies in the cells divided by the grand total. For the current example, the joint probabilities are:<\/p>\n<p style=\"text-align: center; text-align: center;\">[latex]P(B \\: \\& \\: S) = \\frac{10}{200}=0.05, \\quad P(B\\: \\& \\text{ not }S) = \\frac{30}{200} = 0.15,[\/latex]<\/p>\n<p style=\"text-align: center; text-align: center;\">[latex]P(\\text{not }B \\: \\& \\: S) = \\frac{20}{200}=0.1, \\quad P(\\text{not }B \\: \\& \\text{ not }S) = \\frac{140}{200} = 0.7.[\/latex]<\/p>\n","protected":false},"author":19,"menu_order":10,"template":"","meta":{"pb_show_title":"on","pb_short_title":"","pb_subtitle":"","pb_authors":[],"pb_section_license":""},"chapter-type":[],"contributor":[],"license":[],"class_list":["post-383","chapter","type-chapter","status-publish","hentry"],"part":327,"_links":{"self":[{"href":"https:\/\/openbooks.macewan.ca\/introstats\/wp-json\/pressbooks\/v2\/chapters\/383","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/openbooks.macewan.ca\/introstats\/wp-json\/pressbooks\/v2\/chapters"}],"about":[{"href":"https:\/\/openbooks.macewan.ca\/introstats\/wp-json\/wp\/v2\/types\/chapter"}],"author":[{"embeddable":true,"href":"https:\/\/openbooks.macewan.ca\/introstats\/wp-json\/wp\/v2\/users\/19"}],"version-history":[{"count":32,"href":"https:\/\/openbooks.macewan.ca\/introstats\/wp-json\/pressbooks\/v2\/chapters\/383\/revisions"}],"predecessor-version":[{"id":5027,"href":"https:\/\/openbooks.macewan.ca\/introstats\/wp-json\/pressbooks\/v2\/chapters\/383\/revisions\/5027"}],"part":[{"href":"https:\/\/openbooks.macewan.ca\/introstats\/wp-json\/pressbooks\/v2\/parts\/327"}],"metadata":[{"href":"https:\/\/openbooks.macewan.ca\/introstats\/wp-json\/pressbooks\/v2\/chapters\/383\/metadata\/"}],"wp:attachment":[{"href":"https:\/\/openbooks.macewan.ca\/introstats\/wp-json\/wp\/v2\/media?parent=383"}],"wp:term":[{"taxonomy":"chapter-type","embeddable":true,"href":"https:\/\/openbooks.macewan.ca\/introstats\/wp-json\/pressbooks\/v2\/chapter-type?post=383"},{"taxonomy":"contributor","embeddable":true,"href":"https:\/\/openbooks.macewan.ca\/introstats\/wp-json\/wp\/v2\/contributor?post=383"},{"taxonomy":"license","embeddable":true,"href":"https:\/\/openbooks.macewan.ca\/introstats\/wp-json\/wp\/v2\/license?post=383"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}