{"id":2122,"date":"2019-11-02T21:11:17","date_gmt":"2019-11-03T01:11:17","guid":{"rendered":"https:\/\/pressbooks.bccampus.ca\/simplestats\/?post_type=chapter&#038;p=2122"},"modified":"2019-11-02T23:48:05","modified_gmt":"2019-11-03T03:48:05","slug":"9-4-between-two-discrete-variables","status":"publish","type":"chapter","link":"https:\/\/pressbooks.bccampus.ca\/simplestats\/chapter\/9-4-between-two-discrete-variables\/","title":{"raw":"9.4 Between Two Discrete Variables: the \u03c72, Part 2","rendered":"9.4 Between Two Discrete Variables: the \u03c72, Part 2"},"content":{"raw":"[latexpage]\r\n\r\nCalculating a two-way <em>\u03c7<sup>2<\/sup><\/em> is only marginally more complicated than the one-way case we examined in the previous section, as Example 9.5 demonstrates.\r\n\r\n&nbsp;\r\n<div class=\"textbox textbox--examples\"><header class=\"textbox__header\">\r\n<p class=\"textbox__title\"><em>Example 9.5 Do You Like The Campus Cafeteria? (Bivariate \u03c7<sup>2<\/sup>-Test)<\/em><\/p>\r\n\r\n<\/header>\r\n<div class=\"textbox__content\">\r\n\r\n&nbsp;\r\n\r\nWhile we already know that year of study and opinion on the campus cafeteria are not statistically associated from the <em>t<\/em>-test in Example 9.3, I will further use the imaginary data in the original contingency table from Example 7.3 to demonstrate a two-way<em>\u00a0\u03c7<sup>2<\/sup><\/em>-test. This was the table we had is Section 7.7.2.\r\n\r\n&nbsp;\r\n\r\n<em>Table 9.2 (A) Do You Like The Campus Cafeteria? (Revisited)<\/em>\r\n<table class=\"lines\" style=\"border-collapse: collapse;width: 0%;height: 60px\" border=\"0\">\r\n<tbody>\r\n<tr style=\"height: 15px\">\r\n<td style=\"width: 17.5807%;height: 15px;text-align: center\"><\/td>\r\n<td style=\"width: 30.8403%;height: 15px;text-align: center\"><strong>First Year Students<\/strong><\/td>\r\n<td style=\"width: 29.8917%;height: 15px;text-align: center\"><strong>Second Year Students<\/strong><\/td>\r\n<td style=\"width: 36.8762%;height: 15px;text-align: center\"><strong>Total<\/strong><\/td>\r\n<\/tr>\r\n<tr style=\"height: 15px\">\r\n<td style=\"width: 17.5807%;height: 15px;text-align: center\"><strong>\u00a0YES<\/strong><\/td>\r\n<td style=\"width: 30.8403%;height: 15px;text-align: center\">7<\/td>\r\n<td style=\"width: 29.8917%;height: 15px;text-align: center\">5<\/td>\r\n<td style=\"width: 36.8762%;height: 15px;text-align: center\">12<\/td>\r\n<\/tr>\r\n<tr style=\"height: 15px\">\r\n<td style=\"width: 17.5807%;height: 15px;text-align: center\"><strong>\u00a0NO<\/strong><\/td>\r\n<td style=\"width: 30.8403%;height: 15px;text-align: center\">8<\/td>\r\n<td style=\"width: 29.8917%;height: 15px;text-align: center\">15<\/td>\r\n<td style=\"width: 36.8762%;height: 15px;text-align: center\">23<\/td>\r\n<\/tr>\r\n<tr style=\"height: 15px\">\r\n<td style=\"width: 17.5807%;height: 15px;text-align: center\"><strong>Total<\/strong><\/td>\r\n<td style=\"width: 30.8403%;height: 15px;text-align: center\">15<\/td>\r\n<td style=\"width: 29.8917%;height: 15px;text-align: center\">20<\/td>\r\n<td style=\"width: 36.8762%;height: 15px;text-align: center\">35<\/td>\r\n<\/tr>\r\n<\/tbody>\r\n<\/table>\r\n&nbsp;\r\n\r\nOur hypotheses are:\r\n<ul>\r\n \t<li>H<sub>0<\/sub>: Liking the cafeteria or not is not associated with one's year of study; first- and second-year students are equally likely to lie the cafeteria, or<em>\u00a0\u03c0<sub>1<\/sub>=\u03c0<sub>2<\/sub><\/em>.<\/li>\r\n \t<li>H<sub>a<\/sub>: Liking the cafeteria is associated with one's year of study; first-year students and second-year students differ in their liking of the cafeteria, or\u00a0<em>\u03c0<sub>1<\/sub>\u2260\u03c0<sub>2.<\/sub><\/em><\/li>\r\n<\/ul>\r\nTo compute the\u00a0<em>\u03c7<sup>2<\/sup><\/em>, we need the expected count for each cell. Unlike the one-way\u00a0<em>\u03c7<sup>2<\/sup><\/em> case, however, determining the expected count in a contingency table is a bit more complicated than dividing the <em>N<\/em> on the number of groups and expecting the same (expected) number in each cell. Instead, we multiply the respective group\/category sizes (i.e., the row total and the column total at the margins) and divide the product by <em>N<\/em> (the full total)[footnote]<span style=\"font-size: 1rem\">We do that to account for the different group\/category sizes.<\/span><span style=\"text-indent: 1em;font-size: 1rem\">[\/footnote]:<\/span>\r\n\r\n&nbsp;\r\n\r\n$f_e=\\frac{N_j\\times N_k}{N}$\r\n\r\n&nbsp;\r\n\r\nwhere <em>j<\/em> is the size of the respective group and <em>k<\/em> is the size of the respective category[footnote]Recall that to differentiate between the groups\/categories of the two variables, we refer to one variable having groups and the other having categories: so that we can say we compare the groups of one variable on the categories of the other.[\/footnote].\r\n\r\n&nbsp;\r\n\r\nThus we have the following:\r\n<ul>\r\n \t<li>First-years who said <em>Yes<\/em>:\u00a0$f_e=\\frac{N_j\\times N_k}{N}=\\frac{15\\times 12}{35}=5.14$<\/li>\r\n \t<li>Second-years who said <em>Yes<\/em>:\u00a0$f_e=\\frac{N_j\\times N_k}{N}=\\frac{20\\times 12}{35}=6.86$<\/li>\r\n \t<li>First-years who said <em>No<\/em>:\u00a0$f_e=\\frac{N_j\\times N_k}{N}=\\frac{15\\times 23}{35}=9.86$<\/li>\r\n \t<li>Second-years who said <em>No<\/em>:\u00a0$f_e=\\frac{N_j\\times N_k}{N}=\\frac{20\\times 23}{35}=13.14$<\/li>\r\n<\/ul>\r\nTable 9.2 (B) adds the expected count in brackets next to the observed count.\r\n\r\n&nbsp;\r\n\r\n&nbsp;\r\n\r\n<em>Table 9.2 (B)<\/em>\u00a0<em>Do You Like The Campus Cafeteria? (Observed and Expected Frequencies)<\/em>\r\n<table class=\"lines\" style=\"border-collapse: collapse;width: 0%;height: 60px\" border=\"0\">\r\n<tbody>\r\n<tr style=\"height: 15px\">\r\n<td style=\"width: 17.5807%;height: 15px;text-align: center\"><\/td>\r\n<td style=\"width: 30.8403%;height: 15px;text-align: center\"><strong>First Year Students<\/strong><\/td>\r\n<td style=\"width: 29.8917%;height: 15px;text-align: center\"><strong>Second Year Students<\/strong><\/td>\r\n<td style=\"width: 36.8762%;height: 15px;text-align: center\"><strong>Total<\/strong><\/td>\r\n<\/tr>\r\n<tr style=\"height: 15px\">\r\n<td style=\"width: 17.5807%;height: 15px;text-align: center\"><strong>\u00a0YES<\/strong><\/td>\r\n<td style=\"width: 30.8403%;height: 15px;text-align: center\">7\u00a0 \u00a0(5.14)<\/td>\r\n<td style=\"width: 29.8917%;height: 15px;text-align: center\">5\u00a0 \u00a0(6.86)<\/td>\r\n<td style=\"width: 36.8762%;height: 15px;text-align: center\">12<\/td>\r\n<\/tr>\r\n<tr style=\"height: 15px\">\r\n<td style=\"width: 17.5807%;height: 15px;text-align: center\"><strong>\u00a0NO<\/strong><\/td>\r\n<td style=\"width: 30.8403%;height: 15px;text-align: center\">8\u00a0 \u00a0(9.86)<\/td>\r\n<td style=\"width: 29.8917%;height: 15px;text-align: center\">15\u00a0 \u00a0(13.14)<\/td>\r\n<td style=\"width: 36.8762%;height: 15px;text-align: center\">23<\/td>\r\n<\/tr>\r\n<tr style=\"height: 15px\">\r\n<td style=\"width: 17.5807%;height: 15px;text-align: center\"><strong>Total<\/strong><\/td>\r\n<td style=\"width: 30.8403%;height: 15px;text-align: center\">15<\/td>\r\n<td style=\"width: 29.8917%;height: 15px;text-align: center\">20<\/td>\r\n<td style=\"width: 36.8762%;height: 15px;text-align: center\">35<\/td>\r\n<\/tr>\r\n<\/tbody>\r\n<\/table>\r\n&nbsp;\r\n\r\nNow we only need calculate the four elements of the\u00a0\u03c72 and add them altogether at the end.\r\n<ul>\r\n \t<li>First-years who said <em>Yes<\/em>:\u00a0$\\frac{(f_o-f_e)^2}{f_e}=\\frac{(7-5.14)^2}{5.14}=0.67$<\/li>\r\n \t<li>Second-years who said <em>Yes<\/em>:\u00a0$\\frac{(f_o-f_e)^2}{f_e}=\\frac{(5-6.86)^2}{6.86}=0.5$<\/li>\r\n \t<li>First-years who said <em>No<\/em>:\u00a0$\\frac{(f_o-f_e)^2}{f_e}=\\frac{(8-9.86)^2}{9.86}=0.35$<\/li>\r\n \t<li>Second-years who said <em>No<\/em>:\u00a0$\\frac{(f_o-f_e)^2}{f_e}=\\frac{(15-13.14)^2}{13.14}=0.26$<\/li>\r\n<\/ul>\r\n&nbsp;\r\n\r\nFinally,\r\n\r\n&nbsp;\r\n\r\n$\\chi^2=\\Sigma\\frac{(f_o -f_e)^2}{f_e}=0.67+0.5+0.35+0.26=1.78$\r\n\r\n&nbsp;\r\n\r\nThe degrees of freedom are, again,\u00a0<em>df<\/em>=(<em>rows<\/em>-1)(<em>columns<\/em>-1), so here\u00a0<em>df<\/em>=(2-1)(2-1)=1(1)=1.\r\n\r\n&nbsp;\r\n\r\nThat is, <strong>with<em>\u00a0\u03c7<sup>2<\/sup><\/em>=1.78, <em>df<\/em>=1, and <em>p<\/em>=1.18 (i.e., p&gt;0.05), we do <em>not<\/em> have enough evidence to reject the null hypothesis. At this time, we <em>cannot<\/em> claim there is an association between year of study and opinion on the cafeteria, i.e., the 0.217 difference in proportions we observe in the sample (7\/15 versus 5\/20, or 0.467 versus 0.25) is <em>not<\/em> statistically significant.<\/strong>\r\n\r\n&nbsp;\r\n\r\nOf course, we already knew this from the <em>t<\/em>-test in Example 9.3[footnote]You may find it curious to know that the correspondence of results between the <em>t<\/em> and the <em>\u03c7<sup>2<\/sup><\/em> goes even further: in the binary variables' case, squaring the <em>t<\/em>-value will give you exactly\u00a0<em>\u03c7<sup>2<\/sup><\/em>:\u00a0<em>t<sup>2<\/sup>=\u03c7<sup>2<\/sup><\/em>. In our examples, <em>t<\/em>=1.34, and 1.34<sup>2<\/sup>=1.79 which, if it was not for rounding, would be the same as <em>\u03c7<sup>2<\/sup><\/em>. Even their respective degrees of freedom are the same, 1.8. This of course is not the case when at least one of the discrete variables has more than two categories.[\/footnote], so no surprises here.\r\n\r\n&nbsp;\r\n\r\n<\/div>\r\n<\/div>\r\n&nbsp;\r\n\r\nThe imaginary example above serves well as a work-through for calculating\u00a0<em>\u03c7<sup>2<\/sup><\/em>, but we can do better -- an example using real, random-sample data and a large <em>N<\/em> is in order.\r\n\r\n&nbsp;\r\n\r\nIf you recall, in Section 7.7.2 we also explored gender differences in the ability to speak an Aboriginal language using <em>APS 2012<\/em>\u00a0(Statistics Canada, 2019) data. Armed with knowledge about the\u00a0<em>\u03c7<sup>2<\/sup><\/em>, now we can finish that investigation.\r\n\r\n&nbsp;\r\n<div class=\"textbox textbox--examples\"><header class=\"textbox__header\">\r\n<p class=\"textbox__title\"><em>Example 9.6\u00a0<\/em>\u00a0<em>Testing<\/em>\u00a0<em>Gender Differences in the Speaking Aboriginal Language Ability among Indigenous Canadians , APS 2012\u00a0<\/em><\/p>\r\n\r\n<\/header>\r\n<div class=\"textbox__content\">\r\n\r\nOur exploration in Section 7.2.2 left us with the following table.\r\n\r\n&nbsp;\r\n\r\n<em>Table 9.3<\/em>\u00a0<em>Speaking Aboriginal Language Ability by Gender, APS 2012 (Revisited)<\/em>\r\n\r\n<img src=\"https:\/\/pressbooks.bccampus.ca\/simplestats\/wp-content\/uploads\/sites\/564\/2019\/03\/crosstab-aboriginal-gender-language-percent.jpg\" alt=\"\" width=\"582\" height=\"260\" class=\"wp-image-999 size-full aligncenter\" \/>\r\n\r\n&nbsp;\r\n\r\n&nbsp;\r\n\r\nOur hypotheses are:\r\n<ul>\r\n \t<li>H<sub>0<\/sub>: Gender and the ability to speak an Aboriginal language are not associated; women and men are equally likely to speak an Aboriginal language, or\u00a0<em>\u03c0<sub>f<\/sub>=\u03c0<sub>m<\/sub><\/em>.<\/li>\r\n \t<li>H<sub>a<\/sub>:\u00a0Gender and the ability to speak an Aboriginal language are associated; women and men are not equally likely to speak an Aboriginal language, or\u00a0<em>\u03c0<sub>f<\/sub>\u2260\u03c0<sub>m<\/sub><\/em>.<\/li>\r\n<\/ul>\r\nSPSS calculates\u00a0<em>\u03c7<sup>2\u00a0<\/sup><\/em>as\u00a031.78. <strong>With\u00a0<em>\u03c7<sup>2\u00a0<\/sup>=<\/em>31.78, <em>df<\/em>=1, and <em>p<\/em>&lt;0.001, we have enough evidence to reject the null hypothesis and conclude that Indigenous women and men tend to differ in their ability to speak an Aboriginal language. The 3.6 percentage points difference (i.e., 45 percent minus 41.4 percent) in favour of women being more likely to speak an Aboriginal language is statistically significant and therefore generalizable to the larger Indigenous population.\u00a0<\/strong>\r\n\r\n&nbsp;\r\n\r\n<\/div>\r\n<\/div>\r\n&nbsp;\r\n\r\nI \"cheated\" out of presenting the actual calculations in the example above to give you the opportunity to do it on your own. Use it as an exercise in practicing your understating of the <em>\u03c7<sup>2<\/sup><\/em> and<em> t<\/em> statistical significance tests.\r\n\r\n&nbsp;\r\n<div class=\"textbox textbox--exercises\"><header class=\"textbox__header\">\r\n<p class=\"textbox__title\"><em>Do It!<\/em>\u00a0<em>9.3<\/em>\u00a0<em>Testing<\/em>\u00a0<em>Gender Differences in the Speaking Aboriginal Language Ability among Indigenous Canadians, APS 2012\u00a0<\/em><\/p>\r\n\r\n<\/header>\r\n<div class=\"textbox__content\">\r\n\r\nUsing the information presented in Table 9.3 above, 1) calculate the expected frequencies for each cell and compute the\u00a0<em>\u03c7<sup>2<\/sup><\/em>; and 2)\u00a0do a <em>t<\/em>-test on the difference of proportions and create a 95% confidence interval for the difference, to observe the correspondence between the different tests.\r\n\r\n&nbsp;\r\n\r\n<\/div>\r\n<\/div>\r\n&nbsp;\r\n\r\nFinally, lest I leave you with the impression that there is no difference between using a <em>t<\/em>-test and a <em>\u03c7<sup>2<\/sup><\/em>-test, let's consider a case where both variables have more than two categories, next.","rendered":"<p>Calculating a two-way <em>\u03c7<sup>2<\/sup><\/em> is only marginally more complicated than the one-way case we examined in the previous section, as Example 9.5 demonstrates.<\/p>\n<p>&nbsp;<\/p>\n<div class=\"textbox textbox--examples\">\n<header class=\"textbox__header\">\n<p class=\"textbox__title\"><em>Example 9.5 Do You Like The Campus Cafeteria? (Bivariate \u03c7<sup>2<\/sup>-Test)<\/em><\/p>\n<\/header>\n<div class=\"textbox__content\">\n<p>&nbsp;<\/p>\n<p>While we already know that year of study and opinion on the campus cafeteria are not statistically associated from the <em>t<\/em>-test in Example 9.3, I will further use the imaginary data in the original contingency table from Example 7.3 to demonstrate a two-way<em>\u00a0\u03c7<sup>2<\/sup><\/em>-test. This was the table we had is Section 7.7.2.<\/p>\n<p>&nbsp;<\/p>\n<p><em>Table 9.2 (A) Do You Like The Campus Cafeteria? (Revisited)<\/em><\/p>\n<table class=\"lines\" style=\"border-collapse: collapse;width: 0%;height: 60px\">\n<tbody>\n<tr style=\"height: 15px\">\n<td style=\"width: 17.5807%;height: 15px;text-align: center\"><\/td>\n<td style=\"width: 30.8403%;height: 15px;text-align: center\"><strong>First Year Students<\/strong><\/td>\n<td style=\"width: 29.8917%;height: 15px;text-align: center\"><strong>Second Year Students<\/strong><\/td>\n<td style=\"width: 36.8762%;height: 15px;text-align: center\"><strong>Total<\/strong><\/td>\n<\/tr>\n<tr style=\"height: 15px\">\n<td style=\"width: 17.5807%;height: 15px;text-align: center\"><strong>\u00a0YES<\/strong><\/td>\n<td style=\"width: 30.8403%;height: 15px;text-align: center\">7<\/td>\n<td style=\"width: 29.8917%;height: 15px;text-align: center\">5<\/td>\n<td style=\"width: 36.8762%;height: 15px;text-align: center\">12<\/td>\n<\/tr>\n<tr style=\"height: 15px\">\n<td style=\"width: 17.5807%;height: 15px;text-align: center\"><strong>\u00a0NO<\/strong><\/td>\n<td style=\"width: 30.8403%;height: 15px;text-align: center\">8<\/td>\n<td style=\"width: 29.8917%;height: 15px;text-align: center\">15<\/td>\n<td style=\"width: 36.8762%;height: 15px;text-align: center\">23<\/td>\n<\/tr>\n<tr style=\"height: 15px\">\n<td style=\"width: 17.5807%;height: 15px;text-align: center\"><strong>Total<\/strong><\/td>\n<td style=\"width: 30.8403%;height: 15px;text-align: center\">15<\/td>\n<td style=\"width: 29.8917%;height: 15px;text-align: center\">20<\/td>\n<td style=\"width: 36.8762%;height: 15px;text-align: center\">35<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p>Our hypotheses are:<\/p>\n<ul>\n<li>H<sub>0<\/sub>: Liking the cafeteria or not is not associated with one&#8217;s year of study; first- and second-year students are equally likely to lie the cafeteria, or<em>\u00a0\u03c0<sub>1<\/sub>=\u03c0<sub>2<\/sub><\/em>.<\/li>\n<li>H<sub>a<\/sub>: Liking the cafeteria is associated with one&#8217;s year of study; first-year students and second-year students differ in their liking of the cafeteria, or\u00a0<em>\u03c0<sub>1<\/sub>\u2260\u03c0<sub>2.<\/sub><\/em><\/li>\n<\/ul>\n<p>To compute the\u00a0<em>\u03c7<sup>2<\/sup><\/em>, we need the expected count for each cell. Unlike the one-way\u00a0<em>\u03c7<sup>2<\/sup><\/em> case, however, determining the expected count in a contingency table is a bit more complicated than dividing the <em>N<\/em> on the number of groups and expecting the same (expected) number in each cell. Instead, we multiply the respective group\/category sizes (i.e., the row total and the column total at the margins) and divide the product by <em>N<\/em> (the full total)<a class=\"footnote\" title=\"We do that to account for the different group\/category sizes.\" id=\"return-footnote-2122-1\" href=\"#footnote-2122-1\" aria-label=\"Footnote 1\"><sup class=\"footnote\">[1]<\/sup><\/a>:<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/pressbooks.bccampus.ca\/simplestats\/wp-content\/ql-cache\/quicklatex.com-6ea9e40b0da7f87d4be18d1b04d56c2d_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#102;&#95;&#101;&#61;&#92;&#102;&#114;&#97;&#99;&#123;&#78;&#95;&#106;&#92;&#116;&#105;&#109;&#101;&#115;&#32;&#78;&#95;&#107;&#125;&#123;&#78;&#125;\" title=\"Rendered by QuickLaTeX.com\" height=\"24\" width=\"88\" style=\"vertical-align: -6px;\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>where <em>j<\/em> is the size of the respective group and <em>k<\/em> is the size of the respective category<a class=\"footnote\" title=\"Recall that to differentiate between the groups\/categories of the two variables, we refer to one variable having groups and the other having categories: so that we can say we compare the groups of one variable on the categories of the other.\" id=\"return-footnote-2122-2\" href=\"#footnote-2122-2\" aria-label=\"Footnote 2\"><sup class=\"footnote\">[2]<\/sup><\/a>.<\/p>\n<p>&nbsp;<\/p>\n<p>Thus we have the following:<\/p>\n<ul>\n<li>First-years who said <em>Yes<\/em>:\u00a0<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/pressbooks.bccampus.ca\/simplestats\/wp-content\/ql-cache\/quicklatex.com-06da013d74776af368649cd229499865_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#102;&#95;&#101;&#61;&#92;&#102;&#114;&#97;&#99;&#123;&#78;&#95;&#106;&#92;&#116;&#105;&#109;&#101;&#115;&#32;&#78;&#95;&#107;&#125;&#123;&#78;&#125;&#61;&#92;&#102;&#114;&#97;&#99;&#123;&#49;&#53;&#92;&#116;&#105;&#109;&#101;&#115;&#32;&#49;&#50;&#125;&#123;&#51;&#53;&#125;&#61;&#53;&#46;&#49;&#52;\" title=\"Rendered by QuickLaTeX.com\" height=\"24\" width=\"211\" style=\"vertical-align: -6px;\" \/><\/li>\n<li>Second-years who said <em>Yes<\/em>:\u00a0<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/pressbooks.bccampus.ca\/simplestats\/wp-content\/ql-cache\/quicklatex.com-494863c01106f3f0f06c832c9c6c1a01_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#102;&#95;&#101;&#61;&#92;&#102;&#114;&#97;&#99;&#123;&#78;&#95;&#106;&#92;&#116;&#105;&#109;&#101;&#115;&#32;&#78;&#95;&#107;&#125;&#123;&#78;&#125;&#61;&#92;&#102;&#114;&#97;&#99;&#123;&#50;&#48;&#92;&#116;&#105;&#109;&#101;&#115;&#32;&#49;&#50;&#125;&#123;&#51;&#53;&#125;&#61;&#54;&#46;&#56;&#54;\" title=\"Rendered by QuickLaTeX.com\" height=\"24\" width=\"211\" style=\"vertical-align: -6px;\" \/><\/li>\n<li>First-years who said <em>No<\/em>:\u00a0<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/pressbooks.bccampus.ca\/simplestats\/wp-content\/ql-cache\/quicklatex.com-cee2b33924d0e93dda32f28eb7023631_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#102;&#95;&#101;&#61;&#92;&#102;&#114;&#97;&#99;&#123;&#78;&#95;&#106;&#92;&#116;&#105;&#109;&#101;&#115;&#32;&#78;&#95;&#107;&#125;&#123;&#78;&#125;&#61;&#92;&#102;&#114;&#97;&#99;&#123;&#49;&#53;&#92;&#116;&#105;&#109;&#101;&#115;&#32;&#50;&#51;&#125;&#123;&#51;&#53;&#125;&#61;&#57;&#46;&#56;&#54;\" title=\"Rendered by QuickLaTeX.com\" height=\"24\" width=\"211\" style=\"vertical-align: -6px;\" \/><\/li>\n<li>Second-years who said <em>No<\/em>:\u00a0<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/pressbooks.bccampus.ca\/simplestats\/wp-content\/ql-cache\/quicklatex.com-4f61ecc3f7f8c9ecd46716a13f6c028d_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#102;&#95;&#101;&#61;&#92;&#102;&#114;&#97;&#99;&#123;&#78;&#95;&#106;&#92;&#116;&#105;&#109;&#101;&#115;&#32;&#78;&#95;&#107;&#125;&#123;&#78;&#125;&#61;&#92;&#102;&#114;&#97;&#99;&#123;&#50;&#48;&#92;&#116;&#105;&#109;&#101;&#115;&#32;&#50;&#51;&#125;&#123;&#51;&#53;&#125;&#61;&#49;&#51;&#46;&#49;&#52;\" title=\"Rendered by QuickLaTeX.com\" height=\"24\" width=\"220\" style=\"vertical-align: -6px;\" \/><\/li>\n<\/ul>\n<p>Table 9.2 (B) adds the expected count in brackets next to the observed count.<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><em>Table 9.2 (B)<\/em>\u00a0<em>Do You Like The Campus Cafeteria? (Observed and Expected Frequencies)<\/em><\/p>\n<table class=\"lines\" style=\"border-collapse: collapse;width: 0%;height: 60px\">\n<tbody>\n<tr style=\"height: 15px\">\n<td style=\"width: 17.5807%;height: 15px;text-align: center\"><\/td>\n<td style=\"width: 30.8403%;height: 15px;text-align: center\"><strong>First Year Students<\/strong><\/td>\n<td style=\"width: 29.8917%;height: 15px;text-align: center\"><strong>Second Year Students<\/strong><\/td>\n<td style=\"width: 36.8762%;height: 15px;text-align: center\"><strong>Total<\/strong><\/td>\n<\/tr>\n<tr style=\"height: 15px\">\n<td style=\"width: 17.5807%;height: 15px;text-align: center\"><strong>\u00a0YES<\/strong><\/td>\n<td style=\"width: 30.8403%;height: 15px;text-align: center\">7\u00a0 \u00a0(5.14)<\/td>\n<td style=\"width: 29.8917%;height: 15px;text-align: center\">5\u00a0 \u00a0(6.86)<\/td>\n<td style=\"width: 36.8762%;height: 15px;text-align: center\">12<\/td>\n<\/tr>\n<tr style=\"height: 15px\">\n<td style=\"width: 17.5807%;height: 15px;text-align: center\"><strong>\u00a0NO<\/strong><\/td>\n<td style=\"width: 30.8403%;height: 15px;text-align: center\">8\u00a0 \u00a0(9.86)<\/td>\n<td style=\"width: 29.8917%;height: 15px;text-align: center\">15\u00a0 \u00a0(13.14)<\/td>\n<td style=\"width: 36.8762%;height: 15px;text-align: center\">23<\/td>\n<\/tr>\n<tr style=\"height: 15px\">\n<td style=\"width: 17.5807%;height: 15px;text-align: center\"><strong>Total<\/strong><\/td>\n<td style=\"width: 30.8403%;height: 15px;text-align: center\">15<\/td>\n<td style=\"width: 29.8917%;height: 15px;text-align: center\">20<\/td>\n<td style=\"width: 36.8762%;height: 15px;text-align: center\">35<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p>Now we only need calculate the four elements of the\u00a0\u03c72 and add them altogether at the end.<\/p>\n<ul>\n<li>First-years who said <em>Yes<\/em>:\u00a0<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/pressbooks.bccampus.ca\/simplestats\/wp-content\/ql-cache\/quicklatex.com-b0916c962b29302f5a1614b8edcbfbb4_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#102;&#114;&#97;&#99;&#123;&#40;&#102;&#95;&#111;&#45;&#102;&#95;&#101;&#41;&#94;&#50;&#125;&#123;&#102;&#95;&#101;&#125;&#61;&#92;&#102;&#114;&#97;&#99;&#123;&#40;&#55;&#45;&#53;&#46;&#49;&#52;&#41;&#94;&#50;&#125;&#123;&#53;&#46;&#49;&#52;&#125;&#61;&#48;&#46;&#54;&#55;\" title=\"Rendered by QuickLaTeX.com\" height=\"29\" width=\"199\" style=\"vertical-align: -9px;\" \/><\/li>\n<li>Second-years who said <em>Yes<\/em>:\u00a0<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/pressbooks.bccampus.ca\/simplestats\/wp-content\/ql-cache\/quicklatex.com-2b93635db77476cd860b21b2f4f623c3_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#102;&#114;&#97;&#99;&#123;&#40;&#102;&#95;&#111;&#45;&#102;&#95;&#101;&#41;&#94;&#50;&#125;&#123;&#102;&#95;&#101;&#125;&#61;&#92;&#102;&#114;&#97;&#99;&#123;&#40;&#53;&#45;&#54;&#46;&#56;&#54;&#41;&#94;&#50;&#125;&#123;&#54;&#46;&#56;&#54;&#125;&#61;&#48;&#46;&#53;\" title=\"Rendered by QuickLaTeX.com\" height=\"29\" width=\"189\" style=\"vertical-align: -9px;\" \/><\/li>\n<li>First-years who said <em>No<\/em>:\u00a0<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/pressbooks.bccampus.ca\/simplestats\/wp-content\/ql-cache\/quicklatex.com-844d0bd240c9dade37aa143a36a66509_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#102;&#114;&#97;&#99;&#123;&#40;&#102;&#95;&#111;&#45;&#102;&#95;&#101;&#41;&#94;&#50;&#125;&#123;&#102;&#95;&#101;&#125;&#61;&#92;&#102;&#114;&#97;&#99;&#123;&#40;&#56;&#45;&#57;&#46;&#56;&#54;&#41;&#94;&#50;&#125;&#123;&#57;&#46;&#56;&#54;&#125;&#61;&#48;&#46;&#51;&#53;\" title=\"Rendered by QuickLaTeX.com\" height=\"29\" width=\"198\" style=\"vertical-align: -9px;\" \/><\/li>\n<li>Second-years who said <em>No<\/em>:\u00a0<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/pressbooks.bccampus.ca\/simplestats\/wp-content\/ql-cache\/quicklatex.com-cb695fda0d9ed4eba8306cb227f3ef63_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#102;&#114;&#97;&#99;&#123;&#40;&#102;&#95;&#111;&#45;&#102;&#95;&#101;&#41;&#94;&#50;&#125;&#123;&#102;&#95;&#101;&#125;&#61;&#92;&#102;&#114;&#97;&#99;&#123;&#40;&#49;&#53;&#45;&#49;&#51;&#46;&#49;&#52;&#41;&#94;&#50;&#125;&#123;&#49;&#51;&#46;&#49;&#52;&#125;&#61;&#48;&#46;&#50;&#54;\" title=\"Rendered by QuickLaTeX.com\" height=\"29\" width=\"213\" style=\"vertical-align: -9px;\" \/><\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p>Finally,<\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/pressbooks.bccampus.ca\/simplestats\/wp-content\/ql-cache\/quicklatex.com-7dc651551c64353685954f567b42bedc_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#99;&#104;&#105;&#94;&#50;&#61;&#92;&#83;&#105;&#103;&#109;&#97;&#92;&#102;&#114;&#97;&#99;&#123;&#40;&#102;&#95;&#111;&#32;&#45;&#102;&#95;&#101;&#41;&#94;&#50;&#125;&#123;&#102;&#95;&#101;&#125;&#61;&#48;&#46;&#54;&#55;&#43;&#48;&#46;&#53;&#43;&#48;&#46;&#51;&#53;&#43;&#48;&#46;&#50;&#54;&#61;&#49;&#46;&#55;&#56;\" title=\"Rendered by QuickLaTeX.com\" height=\"29\" width=\"375\" style=\"vertical-align: -9px;\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>The degrees of freedom are, again,\u00a0<em>df<\/em>=(<em>rows<\/em>-1)(<em>columns<\/em>-1), so here\u00a0<em>df<\/em>=(2-1)(2-1)=1(1)=1.<\/p>\n<p>&nbsp;<\/p>\n<p>That is, <strong>with<em>\u00a0\u03c7<sup>2<\/sup><\/em>=1.78, <em>df<\/em>=1, and <em>p<\/em>=1.18 (i.e., p&gt;0.05), we do <em>not<\/em> have enough evidence to reject the null hypothesis. At this time, we <em>cannot<\/em> claim there is an association between year of study and opinion on the cafeteria, i.e., the 0.217 difference in proportions we observe in the sample (7\/15 versus 5\/20, or 0.467 versus 0.25) is <em>not<\/em> statistically significant.<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p>Of course, we already knew this from the <em>t<\/em>-test in Example 9.3<a class=\"footnote\" title=\"You may find it curious to know that the correspondence of results between the t and the \u03c72 goes even further: in the binary variables' case, squaring the t-value will give you exactly\u00a0\u03c72:\u00a0t2=\u03c72. In our examples, t=1.34, and 1.342=1.79 which, if it was not for rounding, would be the same as \u03c72. Even their respective degrees of freedom are the same, 1.8. This of course is not the case when at least one of the discrete variables has more than two categories.\" id=\"return-footnote-2122-3\" href=\"#footnote-2122-3\" aria-label=\"Footnote 3\"><sup class=\"footnote\">[3]<\/sup><\/a>, so no surprises here.<\/p>\n<p>&nbsp;<\/p>\n<\/div>\n<\/div>\n<p>&nbsp;<\/p>\n<p>The imaginary example above serves well as a work-through for calculating\u00a0<em>\u03c7<sup>2<\/sup><\/em>, but we can do better &#8212; an example using real, random-sample data and a large <em>N<\/em> is in order.<\/p>\n<p>&nbsp;<\/p>\n<p>If you recall, in Section 7.7.2 we also explored gender differences in the ability to speak an Aboriginal language using <em>APS 2012<\/em>\u00a0(Statistics Canada, 2019) data. Armed with knowledge about the\u00a0<em>\u03c7<sup>2<\/sup><\/em>, now we can finish that investigation.<\/p>\n<p>&nbsp;<\/p>\n<div class=\"textbox textbox--examples\">\n<header class=\"textbox__header\">\n<p class=\"textbox__title\"><em>Example 9.6\u00a0<\/em>\u00a0<em>Testing<\/em>\u00a0<em>Gender Differences in the Speaking Aboriginal Language Ability among Indigenous Canadians , APS 2012\u00a0<\/em><\/p>\n<\/header>\n<div class=\"textbox__content\">\n<p>Our exploration in Section 7.2.2 left us with the following table.<\/p>\n<p>&nbsp;<\/p>\n<p><em>Table 9.3<\/em>\u00a0<em>Speaking Aboriginal Language Ability by Gender, APS 2012 (Revisited)<\/em><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/pressbooks.bccampus.ca\/simplestats\/wp-content\/uploads\/sites\/564\/2019\/03\/crosstab-aboriginal-gender-language-percent.jpg\" alt=\"\" width=\"582\" height=\"260\" class=\"wp-image-999 size-full aligncenter\" srcset=\"https:\/\/pressbooks.bccampus.ca\/simplestats\/wp-content\/uploads\/sites\/564\/2019\/03\/crosstab-aboriginal-gender-language-percent.jpg 582w, https:\/\/pressbooks.bccampus.ca\/simplestats\/wp-content\/uploads\/sites\/564\/2019\/03\/crosstab-aboriginal-gender-language-percent-300x134.jpg 300w, https:\/\/pressbooks.bccampus.ca\/simplestats\/wp-content\/uploads\/sites\/564\/2019\/03\/crosstab-aboriginal-gender-language-percent-65x29.jpg 65w, https:\/\/pressbooks.bccampus.ca\/simplestats\/wp-content\/uploads\/sites\/564\/2019\/03\/crosstab-aboriginal-gender-language-percent-225x101.jpg 225w, https:\/\/pressbooks.bccampus.ca\/simplestats\/wp-content\/uploads\/sites\/564\/2019\/03\/crosstab-aboriginal-gender-language-percent-350x156.jpg 350w\" sizes=\"auto, (max-width: 582px) 100vw, 582px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>Our hypotheses are:<\/p>\n<ul>\n<li>H<sub>0<\/sub>: Gender and the ability to speak an Aboriginal language are not associated; women and men are equally likely to speak an Aboriginal language, or\u00a0<em>\u03c0<sub>f<\/sub>=\u03c0<sub>m<\/sub><\/em>.<\/li>\n<li>H<sub>a<\/sub>:\u00a0Gender and the ability to speak an Aboriginal language are associated; women and men are not equally likely to speak an Aboriginal language, or\u00a0<em>\u03c0<sub>f<\/sub>\u2260\u03c0<sub>m<\/sub><\/em>.<\/li>\n<\/ul>\n<p>SPSS calculates\u00a0<em>\u03c7<sup>2\u00a0<\/sup><\/em>as\u00a031.78. <strong>With\u00a0<em>\u03c7<sup>2\u00a0<\/sup>=<\/em>31.78, <em>df<\/em>=1, and <em>p<\/em>&lt;0.001, we have enough evidence to reject the null hypothesis and conclude that Indigenous women and men tend to differ in their ability to speak an Aboriginal language. The 3.6 percentage points difference (i.e., 45 percent minus 41.4 percent) in favour of women being more likely to speak an Aboriginal language is statistically significant and therefore generalizable to the larger Indigenous population.\u00a0<\/strong><\/p>\n<p>&nbsp;<\/p>\n<\/div>\n<\/div>\n<p>&nbsp;<\/p>\n<p>I &#8220;cheated&#8221; out of presenting the actual calculations in the example above to give you the opportunity to do it on your own. Use it as an exercise in practicing your understating of the <em>\u03c7<sup>2<\/sup><\/em> and<em> t<\/em> statistical significance tests.<\/p>\n<p>&nbsp;<\/p>\n<div class=\"textbox textbox--exercises\">\n<header class=\"textbox__header\">\n<p class=\"textbox__title\"><em>Do It!<\/em>\u00a0<em>9.3<\/em>\u00a0<em>Testing<\/em>\u00a0<em>Gender Differences in the Speaking Aboriginal Language Ability among Indigenous Canadians, APS 2012\u00a0<\/em><\/p>\n<\/header>\n<div class=\"textbox__content\">\n<p>Using the information presented in Table 9.3 above, 1) calculate the expected frequencies for each cell and compute the\u00a0<em>\u03c7<sup>2<\/sup><\/em>; and 2)\u00a0do a <em>t<\/em>-test on the difference of proportions and create a 95% confidence interval for the difference, to observe the correspondence between the different tests.<\/p>\n<p>&nbsp;<\/p>\n<\/div>\n<\/div>\n<p>&nbsp;<\/p>\n<p>Finally, lest I leave you with the impression that there is no difference between using a <em>t<\/em>-test and a <em>\u03c7<sup>2<\/sup><\/em>-test, let&#8217;s consider a case where both variables have more than two categories, next.<\/p>\n<hr class=\"before-footnotes clear\" \/><div class=\"footnotes\"><ol><li id=\"footnote-2122-1\"><span style=\"font-size: 1rem\">We do that to account for the different group\/category sizes.<\/span><span style=\"text-indent: 1em;font-size: 1rem\"> <a href=\"#return-footnote-2122-1\" class=\"return-footnote\" aria-label=\"Return to footnote 1\">&crarr;<\/a><\/li><li id=\"footnote-2122-2\">Recall that to differentiate between the groups\/categories of the two variables, we refer to one variable having groups and the other having categories: so that we can say we compare the groups of one variable on the categories of the other. <a href=\"#return-footnote-2122-2\" class=\"return-footnote\" aria-label=\"Return to footnote 2\">&crarr;<\/a><\/li><li id=\"footnote-2122-3\">You may find it curious to know that the correspondence of results between the <em>t<\/em> and the <em>\u03c7<sup>2<\/sup><\/em> goes even further: in the binary variables' case, squaring the <em>t<\/em>-value will give you exactly\u00a0<em>\u03c7<sup>2<\/sup><\/em>:\u00a0<em>t<sup>2<\/sup>=\u03c7<sup>2<\/sup><\/em>. In our examples, <em>t<\/em>=1.34, and 1.34<sup>2<\/sup>=1.79 which, if it was not for rounding, would be the same as <em>\u03c7<sup>2<\/sup><\/em>. Even their respective degrees of freedom are the same, 1.8. This of course is not the case when at least one of the discrete variables has more than two categories. <a href=\"#return-footnote-2122-3\" class=\"return-footnote\" aria-label=\"Return to footnote 3\">&crarr;<\/a><\/li><\/ol><\/div>","protected":false},"author":533,"menu_order":4,"template":"","meta":{"pb_show_title":"on","pb_short_title":"","pb_subtitle":"","pb_authors":[],"pb_section_license":""},"chapter-type":[],"contributor":[],"license":[],"class_list":["post-2122","chapter","type-chapter","status-publish","hentry"],"part":120,"_links":{"self":[{"href":"https:\/\/pressbooks.bccampus.ca\/simplestats\/wp-json\/pressbooks\/v2\/chapters\/2122","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pressbooks.bccampus.ca\/simplestats\/wp-json\/pressbooks\/v2\/chapters"}],"about":[{"href":"https:\/\/pressbooks.bccampus.ca\/simplestats\/wp-json\/wp\/v2\/types\/chapter"}],"author":[{"embeddable":true,"href":"https:\/\/pressbooks.bccampus.ca\/simplestats\/wp-json\/wp\/v2\/users\/533"}],"version-history":[{"count":6,"href":"https:\/\/pressbooks.bccampus.ca\/simplestats\/wp-json\/pressbooks\/v2\/chapters\/2122\/revisions"}],"predecessor-version":[{"id":2139,"href":"https:\/\/pressbooks.bccampus.ca\/simplestats\/wp-json\/pressbooks\/v2\/chapters\/2122\/revisions\/2139"}],"part":[{"href":"https:\/\/pressbooks.bccampus.ca\/simplestats\/wp-json\/pressbooks\/v2\/parts\/120"}],"metadata":[{"href":"https:\/\/pressbooks.bccampus.ca\/simplestats\/wp-json\/pressbooks\/v2\/chapters\/2122\/metadata\/"}],"wp:attachment":[{"href":"https:\/\/pressbooks.bccampus.ca\/simplestats\/wp-json\/wp\/v2\/media?parent=2122"}],"wp:term":[{"taxonomy":"chapter-type","embeddable":true,"href":"https:\/\/pressbooks.bccampus.ca\/simplestats\/wp-json\/pressbooks\/v2\/chapter-type?post=2122"},{"taxonomy":"contributor","embeddable":true,"href":"https:\/\/pressbooks.bccampus.ca\/simplestats\/wp-json\/wp\/v2\/contributor?post=2122"},{"taxonomy":"license","embeddable":true,"href":"https:\/\/pressbooks.bccampus.ca\/simplestats\/wp-json\/wp\/v2\/license?post=2122"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}