{"id":599,"date":"2017-04-15T03:28:31","date_gmt":"2017-04-15T03:28:31","guid":{"rendered":"https:\/\/courses.lumenlearning.com\/conceptstest1\/chapter\/test-of-independence-2-of-3\/"},"modified":"2022-08-01T16:05:35","modified_gmt":"2022-08-01T16:05:35","slug":"test-of-independence-2-of-3","status":"publish","type":"chapter","link":"https:\/\/courses.lumenlearning.com\/wm-concepts-statistics\/chapter\/test-of-independence-2-of-3\/","title":{"raw":"Test of Independence (2 of 3)","rendered":"Test of Independence (2 of 3)"},"content":{"raw":"<div class=\"textbox learning-objectives\">\r\n<h3>Learning outcomes<\/h3>\r\n<ul>\r\n \t<li>Conduct a chi-square test of independence. Interpret the conclusion in context.<\/li>\r\n<\/ul>\r\n<\/div>\r\nHere we continue our chi-square test of independence for the variables <em>gender<\/em> and <em>body image<\/em> in the population of U.S. college students.\r\n<div class=\"textbox exercises\">\r\n<h3>Example<\/h3>\r\n<h2>Gender and Body Image Continued<\/h2>\r\n<strong>Step 1: State the hypotheses.<\/strong>\r\n\r\nHere are our hypotheses from the previous page:\r\n<ul style=\"list-style-type: none;\">\r\n \t<li>H<sub>0<\/sub>: There is no relationship between gender and body image for U.S. college students. (The variables are independent.)<\/li>\r\n \t<li>H<sub>a<\/sub>: There is a relationship between gender and body image for U.S. college students. (The variables are dependent.)<\/li>\r\n<\/ul>\r\n<strong>Step 2: Collect and analyze the data.<\/strong>\r\n\r\nIf the variables are independent, the percentage of males and females with a given response will be the same or at least close. Previously, we determined that in our sample, there are differences in the percentage of males and females who answer \u201cabout right,\u201d \u201coverweight,\u201d or \u201cunderweight.\u201d\r\n<table>\r\n<tbody>\r\n<tr>\r\n<th style=\"text-align: center;\" colspan=\"5\">Conditional Percents<\/th>\r\n<\/tr>\r\n<tr>\r\n<th><\/th>\r\n<th>About right<\/th>\r\n<th>Overweight<\/th>\r\n<th>Underweight<\/th>\r\n<td>Row Totals<\/td>\r\n<\/tr>\r\n<tr>\r\n<th>Female<\/th>\r\n<td>560<span style=\"color: #ff0000;\">\/760 = 73.68%<\/span><\/td>\r\n<td>163<span style=\"color: #ff0000;\">\/760 = 21.45%<\/span><\/td>\r\n<td>37<span style=\"color: #ff0000;\">\/760 = 4.87%<\/span><\/td>\r\n<td>760<span style=\"color: #ff0000;\">\/760 = 100%<\/span><\/td>\r\n<\/tr>\r\n<tr>\r\n<th>Male<\/th>\r\n<td>295<span style=\"color: #0000ff;\">\/440 = 67.00%<\/span><\/td>\r\n<td>72<span style=\"color: #0000ff;\">\/440 = 16.36%<\/span><\/td>\r\n<td>73<span style=\"color: #0000ff;\">\/440 = 16.59%<\/span><\/td>\r\n<td>440<span style=\"color: #0000ff;\">\/440 = 100%<\/span><\/td>\r\n<\/tr>\r\n<tr>\r\n<td>Column Totals<\/td>\r\n<td>855\/1200 = 71.25%<\/td>\r\n<td>235\/1200 = 19.58%<\/td>\r\n<td>110\/1200 = 9.17%<\/td>\r\n<td>1200\/1200 = 100%<\/td>\r\n<\/tr>\r\n<\/tbody>\r\n<\/table>\r\nWe need to determine if these differences are typical in random samples from a population where gender and body image are independent. Perhaps the differences we see in this sample are just fluctuations expected in random sampling. Or perhaps these differences are too large to be explained by chance. We will not know until we complete the hypothesis test.\r\n\r\n<strong>Step 3: Assess the evidence.<\/strong>\r\n\r\nWe need to determine the expected values and the chi-square test statistic so that we can find the P-value.\r\n\r\n<em>Calculating Expected Values for a Test of Independence<\/em>\r\n\r\nExpected counts always describe what we expect to see in a sample if the null hypothesis is true. In this situation, if gender and body image are independent, then we expect the probability that a student answers \u201cabout right\u201d in the sample to be the same probability that a male (or a female) student answers \u201cabout right\u201d (similarly for \u201coverweight\u201d or \u201cunderweight\u201d responses).\r\n\r\nHere are the calculations of expected counts for the response \u201cabout right\u201d:\r\n<ul style=\"list-style-type: none;\">\r\n \t<li>Probability that a student will answer \u201cabout right\u201d: <em>P<\/em>(about right) = (855\/1,200) = 0.7125<\/li>\r\n \t<li>Expected count of females in the sample who will answer \u201cabout right\u201d: 0.7125(760) = <span style=\"color: #ff0000;\">541.5<\/span><\/li>\r\n \t<li>Expected count of males in the sample who will answer \u201cabout right\u201d: 0.7125(440) = <span style=\"color: #0000ff;\">313.5<\/span><\/li>\r\n<\/ul>\r\n<table>\r\n<tbody>\r\n<tr>\r\n<th style=\"text-align: center;\" colspan=\"5\">Expected Counts<\/th>\r\n<\/tr>\r\n<tr>\r\n<th><\/th>\r\n<th>About right<\/th>\r\n<th>Overweight<\/th>\r\n<th>Underweight<\/th>\r\n<td>Row Totals<\/td>\r\n<\/tr>\r\n<tr>\r\n<th>Female<\/th>\r\n<td><span style=\"color: #ff0000;\">541.5<\/span><\/td>\r\n<td><span style=\"color: #ff0000;\">148.8<\/span><\/td>\r\n<td><\/td>\r\n<td>760<\/td>\r\n<\/tr>\r\n<tr>\r\n<th>Male<\/th>\r\n<td><span style=\"color: #0000ff;\">313.5<\/span><\/td>\r\n<td><span style=\"color: #0000ff;\">86.2<\/span><\/td>\r\n<td><\/td>\r\n<td>440<\/td>\r\n<\/tr>\r\n<tr>\r\n<td>Column Totals<\/td>\r\n<td>855<\/td>\r\n<td>235<\/td>\r\n<td>110<\/td>\r\n<td>1200<\/td>\r\n<\/tr>\r\n<\/tbody>\r\n<\/table>\r\nHere are the calculations of expected counts for the response \u201coverweight\u201d:\r\n<ul>\r\n \t<li>Probability that a student will answer \u201coverweight\u201d: <em>P<\/em>(overweight) = (235\/1,200) = 0.1958<\/li>\r\n \t<li>Expected count of females in the sample who will answer \u201coverweight\u201d: 0.1958(760) = <span style=\"color: #ff0000;\">148.8<\/span><\/li>\r\n \t<li>Expected count of males in the sample who will answer \u201coverweight\u201d: 0.1958(440) = <span style=\"color: #0000ff;\">86.2<\/span><\/li>\r\n<\/ul>\r\n<\/div>\r\n<div class=\"textbox key-takeaways\">\r\n<h3>Try It<\/h3>\r\nRecall the study of New York firefighters. Our null hypothesis says that participation in 9\/11 rescue operations is not associated with alcohol-related problems for New York firefighters. (Alcohol-related problems and participation in 9\/11 rescue are independent.)\r\n<table>\r\n<tbody>\r\n<tr>\r\n<th><\/th>\r\n<th>No risk for alcohol problems<\/th>\r\n<th>Moderate to severe risk for alcohol problems<\/th>\r\n<th><\/th>\r\n<\/tr>\r\n<tr>\r\n<th>Participated in 9\/11 rescue<\/th>\r\n<td>793<\/td>\r\n<td>309<\/td>\r\n<td>1102<\/td>\r\n<\/tr>\r\n<tr>\r\n<th>Did not participate in 9\/11 rescue<\/th>\r\n<td>441<\/td>\r\n<td>110<\/td>\r\n<td>551<\/td>\r\n<\/tr>\r\n<tr>\r\n<th><\/th>\r\n<td>1234<\/td>\r\n<td>419<\/td>\r\n<td>1653<\/td>\r\n<\/tr>\r\n<\/tbody>\r\n<\/table>\r\nhttps:\/\/assess.lumenlearning.com\/practice\/da382dc4-987d-4305-98af-cf5ba364bc43\r\n\r\n<\/div>\r\n<div class=\"textbox key-takeaways\">\r\n<h3>Try It<\/h3>\r\n<table>\r\n<tbody>\r\n<tr>\r\n<th style=\"text-align: center;\" colspan=\"5\">Observed Counts<\/th>\r\n<\/tr>\r\n<tr>\r\n<th><\/th>\r\n<th>About right<\/th>\r\n<th>Overweight<\/th>\r\n<th>Underweight<\/th>\r\n<td>Row Totals<\/td>\r\n<\/tr>\r\n<tr>\r\n<th>Female<\/th>\r\n<td>560<\/td>\r\n<td>163<\/td>\r\n<td>37<\/td>\r\n<td>760<\/td>\r\n<\/tr>\r\n<tr>\r\n<th>Male<\/th>\r\n<td>295<\/td>\r\n<td>72<\/td>\r\n<td>73<\/td>\r\n<td>440<\/td>\r\n<\/tr>\r\n<tr>\r\n<td>Column Totals<\/td>\r\n<td>855<\/td>\r\n<td>235<\/td>\r\n<td>110<\/td>\r\n<td>1200<\/td>\r\n<\/tr>\r\n<\/tbody>\r\n<\/table>\r\nhttps:\/\/assess.lumenlearning.com\/practice\/f900c2d9-0122-4b95-8c0b-c78f5d59b73e\r\n\r\n<\/div>\r\n<div class=\"textbox exercises\">\r\n<h3>Example<\/h3>\r\n<h2>More on Gender and Body Image<\/h2>\r\n<em>Checking Conditions<\/em>\r\n\r\nThe conditions for use of the chi-square distribution are the same as we learned previously:\r\n<ul>\r\n \t<li>The sample is random.<\/li>\r\n \t<li>All of the expected counts are 5 or greater.<\/li>\r\n<\/ul>\r\nSince the data meets the conditions, we can proceed with calculating \u03c7<sup>2<\/sup> test statistic.\r\n\r\n<em>Calculating the Chi-Square Test Statistic<\/em>\r\n\r\nWe calculate the chi-square test statistic as we did in \"Chi-Square Test for One-Way Tables.\"\r\n<p style=\"text-align: center;\">[latex]{\\chi }^{2}\\text{}=\\text{}\u2211\\frac{{(\\mathrm{observed}-\\mathrm{expected})}^{2}}{\\mathrm{expected}}[\/latex]<\/p>\r\nWe will use technology to calculate the chi-square value. But for this sample, we will show the calculation.\r\n\r\n<img class=\"alignnone\" src=\"https:\/\/s3-us-west-2.amazonaws.com\/courses-images\/wp-content\/uploads\/sites\/1729\/2017\/04\/15032827\/m11_chi_square_tests_topic_11_2_m11_test_independence_2_image12.png\" alt=\"Chi-squared = (560-541.5)^2\/541.5 + (295-313.5)^2\/313.5 + (163-148.8)^2\/148.8 + (72-86.17)^2\/86.17 + (37-69.67)^2\/69.67 + (73-40.33)^2\/40.33 = 47.18.\" width=\"688\" height=\"106\" \/>\r\n\r\n<em>Finding Degrees of Freedom and the P-Value<\/em>\r\n\r\nFor a chi-square tests based on two-way tables, the degrees of freedom are\r\n<ul style=\"list-style-type: none;\">\r\n \t<li>(number of explanatory categories - 1) \u00d7 (number of response categories - 1)<\/li>\r\n<\/ul>\r\nYou will also see this written: (<em>r<\/em> \u2212 1)(<em>c<\/em> \u2212 1), where <em>r<\/em> is the number of rows and <em>c<\/em> is the number of columns in the two-way table (when we write the table without row and column totals). In this case the degrees of freedom are (2 \u2212 1)(3 \u22121 ) = 2.\r\n\r\nWe use the chi-square distribution with <em>df<\/em> = 2 to find the P-value. Note that the chi-square test statistic for this sample is so large that it is off the scale used in the simulation. So we conclude that the P-value is essentially zero.\r\n\r\n<img class=\"alignnone\" src=\"https:\/\/s3-us-west-2.amazonaws.com\/courses-images\/wp-content\/uploads\/sites\/1729\/2017\/04\/15032830\/m11_chi_square_tests_topic_11_2_m11_test_independence_2_image13.png\" alt=\"Graph showing a chi-squared distribution with 2 degrees of freedom.  A value of 20 is marked on the right of the graph, with a p-value less than 0.0001.\" width=\"382\" height=\"304\" \/>\r\n\r\n<strong>Step 4: Conclusion<\/strong>\r\n\r\nThe relationship between gender and body image is statistically significant in this sample. We reject the null hypothesis and accept the alternative hypothesis. Gender and body image are dependent variables in the population of U.S. college students. (P-value is essentially 0.)\r\n\r\n<\/div>\r\n<div class=\"textbox key-takeaways\">\r\n<h3>Try It<\/h3>\r\n<h2>More on Gender and Body Piercing<\/h2>\r\nA study was done on the relationship between gender and ear piercing among high-school students. A sample of 1,000 students was chosen, then classified according to both gender and whether or not they had either of their ears pierced. The following information is available:\r\n\r\n<table>\r\n<tr><th colspan=\"4\">Chi-Square Test: Pierced, No Pierced<\/th><\/tr>\r\n<tr><\/tr>\r\n<tr><th colspan=\"4\">Observed Counts:<\/th><\/tr>\r\n<tr><td><\/td><td>Pierced<\/td><td>No Pierced<\/td><td>Total<\/td><\/tr>\r\n<tr><td>Female<\/td><td>576<\/td><td>64<\/td><td>640<\/td><\/tr>\r\n<tr><td>Male<\/td><td>72<\/td><td>288<\/td><td>360<\/td><\/tr>\r\n<tr><td>Total<\/td><td>648<\/td><td>352<\/td><td>1000<\/td><\/tr>\r\n<tr><\/tr>\r\n<tr><th colspan=\"4\">Expected Counts:<\/th><\/tr>\r\n<tr><td><\/td><td>Pierced<\/td><td>No Pierced<\/td><td>Total<\/td><\/tr>\r\n<tr><td>Female<\/td><td>414.72<\/td><td>225.28<\/td><td>640<\/td><\/tr>\r\n<tr><td>Male<\/td><td>233.28<\/td><td>126.72<\/td><td>360<\/td><\/tr>\r\n<tr><td>Total<\/td><td>648<\/td><td>352<\/td><td>1000<\/td><\/tr>\r\n<tr><\/tr>\r\n<tr><th colspan=\"4\">Chi-Square Contribution:<\/th><\/tr>\r\n<tr><td><\/td><td>Pierced<\/td><td>No Pierced<\/td><td><\/td><\/tr>\r\n<tr><td>Female<\/td><td><\/td><td>115.462<\/td><td><\/td><\/tr>\r\n<tr><td>Male<\/td><td>111.502<\/td><td>205.265<\/td><td><\/td><\/tr>\r\n<\/table>\r\n\r\nhttps:\/\/assess.lumenlearning.com\/practice\/25d13fd7-57e4-4f28-8857-09b29ed03fcd\r\n\r\nhttps:\/\/assess.lumenlearning.com\/practice\/57e189f0-d10c-472f-9c79-55d15001f865\r\n\r\nhttps:\/\/assess.lumenlearning.com\/practice\/760406f1-9631-4acf-b176-9213f8c531d6\r\n\r\n<\/div>\r\n<h2>Contribute!<\/h2>\r\n<div style=\"margin-bottom: 8px;\">Did you have an idea for improving this content? We\u2019d love your input.<\/div>\r\n<a style=\"font-size: 10pt; font-weight: 600; color: #077fab; text-decoration: none; border: 2px solid #077fab; border-radius: 7px; padding: 5px 25px; text-align: center; cursor: pointer; line-height: 1.5em;\" href=\"https:\/\/docs.google.com\/document\/d\/1a-isLcWJUgsy2zNyKQ2nIsbqy4_-hN1sKt2NgeMl4I4\" target=\"_blank\" rel=\"noopener\">Improve this page<\/a><a style=\"margin-left: 16px;\" href=\"https:\/\/docs.google.com\/document\/d\/1vy-T6DtTF-BbMfpVEI7VP_R7w2A4anzYZLXR8Pk4Fu4\" target=\"_blank\" rel=\"noopener\">Learn More<\/a>","rendered":"<div class=\"textbox learning-objectives\">\n<h3>Learning outcomes<\/h3>\n<ul>\n<li>Conduct a chi-square test of independence. Interpret the conclusion in context.<\/li>\n<\/ul>\n<\/div>\n<p>Here we continue our chi-square test of independence for the variables <em>gender<\/em> and <em>body image<\/em> in the population of U.S. college students.<\/p>\n<div class=\"textbox exercises\">\n<h3>Example<\/h3>\n<h2>Gender and Body Image Continued<\/h2>\n<p><strong>Step 1: State the hypotheses.<\/strong><\/p>\n<p>Here are our hypotheses from the previous page:<\/p>\n<ul style=\"list-style-type: none;\">\n<li>H<sub>0<\/sub>: There is no relationship between gender and body image for U.S. college students. (The variables are independent.)<\/li>\n<li>H<sub>a<\/sub>: There is a relationship between gender and body image for U.S. college students. (The variables are dependent.)<\/li>\n<\/ul>\n<p><strong>Step 2: Collect and analyze the data.<\/strong><\/p>\n<p>If the variables are independent, the percentage of males and females with a given response will be the same or at least close. Previously, we determined that in our sample, there are differences in the percentage of males and females who answer \u201cabout right,\u201d \u201coverweight,\u201d or \u201cunderweight.\u201d<\/p>\n<table>\n<tbody>\n<tr>\n<th style=\"text-align: center;\" colspan=\"5\">Conditional Percents<\/th>\n<\/tr>\n<tr>\n<th><\/th>\n<th>About right<\/th>\n<th>Overweight<\/th>\n<th>Underweight<\/th>\n<td>Row Totals<\/td>\n<\/tr>\n<tr>\n<th>Female<\/th>\n<td>560<span style=\"color: #ff0000;\">\/760 = 73.68%<\/span><\/td>\n<td>163<span style=\"color: #ff0000;\">\/760 = 21.45%<\/span><\/td>\n<td>37<span style=\"color: #ff0000;\">\/760 = 4.87%<\/span><\/td>\n<td>760<span style=\"color: #ff0000;\">\/760 = 100%<\/span><\/td>\n<\/tr>\n<tr>\n<th>Male<\/th>\n<td>295<span style=\"color: #0000ff;\">\/440 = 67.00%<\/span><\/td>\n<td>72<span style=\"color: #0000ff;\">\/440 = 16.36%<\/span><\/td>\n<td>73<span style=\"color: #0000ff;\">\/440 = 16.59%<\/span><\/td>\n<td>440<span style=\"color: #0000ff;\">\/440 = 100%<\/span><\/td>\n<\/tr>\n<tr>\n<td>Column Totals<\/td>\n<td>855\/1200 = 71.25%<\/td>\n<td>235\/1200 = 19.58%<\/td>\n<td>110\/1200 = 9.17%<\/td>\n<td>1200\/1200 = 100%<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>We need to determine if these differences are typical in random samples from a population where gender and body image are independent. Perhaps the differences we see in this sample are just fluctuations expected in random sampling. Or perhaps these differences are too large to be explained by chance. We will not know until we complete the hypothesis test.<\/p>\n<p><strong>Step 3: Assess the evidence.<\/strong><\/p>\n<p>We need to determine the expected values and the chi-square test statistic so that we can find the P-value.<\/p>\n<p><em>Calculating Expected Values for a Test of Independence<\/em><\/p>\n<p>Expected counts always describe what we expect to see in a sample if the null hypothesis is true. In this situation, if gender and body image are independent, then we expect the probability that a student answers \u201cabout right\u201d in the sample to be the same probability that a male (or a female) student answers \u201cabout right\u201d (similarly for \u201coverweight\u201d or \u201cunderweight\u201d responses).<\/p>\n<p>Here are the calculations of expected counts for the response \u201cabout right\u201d:<\/p>\n<ul style=\"list-style-type: none;\">\n<li>Probability that a student will answer \u201cabout right\u201d: <em>P<\/em>(about right) = (855\/1,200) = 0.7125<\/li>\n<li>Expected count of females in the sample who will answer \u201cabout right\u201d: 0.7125(760) = <span style=\"color: #ff0000;\">541.5<\/span><\/li>\n<li>Expected count of males in the sample who will answer \u201cabout right\u201d: 0.7125(440) = <span style=\"color: #0000ff;\">313.5<\/span><\/li>\n<\/ul>\n<table>\n<tbody>\n<tr>\n<th style=\"text-align: center;\" colspan=\"5\">Expected Counts<\/th>\n<\/tr>\n<tr>\n<th><\/th>\n<th>About right<\/th>\n<th>Overweight<\/th>\n<th>Underweight<\/th>\n<td>Row Totals<\/td>\n<\/tr>\n<tr>\n<th>Female<\/th>\n<td><span style=\"color: #ff0000;\">541.5<\/span><\/td>\n<td><span style=\"color: #ff0000;\">148.8<\/span><\/td>\n<td><\/td>\n<td>760<\/td>\n<\/tr>\n<tr>\n<th>Male<\/th>\n<td><span style=\"color: #0000ff;\">313.5<\/span><\/td>\n<td><span style=\"color: #0000ff;\">86.2<\/span><\/td>\n<td><\/td>\n<td>440<\/td>\n<\/tr>\n<tr>\n<td>Column Totals<\/td>\n<td>855<\/td>\n<td>235<\/td>\n<td>110<\/td>\n<td>1200<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Here are the calculations of expected counts for the response \u201coverweight\u201d:<\/p>\n<ul>\n<li>Probability that a student will answer \u201coverweight\u201d: <em>P<\/em>(overweight) = (235\/1,200) = 0.1958<\/li>\n<li>Expected count of females in the sample who will answer \u201coverweight\u201d: 0.1958(760) = <span style=\"color: #ff0000;\">148.8<\/span><\/li>\n<li>Expected count of males in the sample who will answer \u201coverweight\u201d: 0.1958(440) = <span style=\"color: #0000ff;\">86.2<\/span><\/li>\n<\/ul>\n<\/div>\n<div class=\"textbox key-takeaways\">\n<h3>Try It<\/h3>\n<p>Recall the study of New York firefighters. Our null hypothesis says that participation in 9\/11 rescue operations is not associated with alcohol-related problems for New York firefighters. (Alcohol-related problems and participation in 9\/11 rescue are independent.)<\/p>\n<table>\n<tbody>\n<tr>\n<th><\/th>\n<th>No risk for alcohol problems<\/th>\n<th>Moderate to severe risk for alcohol problems<\/th>\n<th><\/th>\n<\/tr>\n<tr>\n<th>Participated in 9\/11 rescue<\/th>\n<td>793<\/td>\n<td>309<\/td>\n<td>1102<\/td>\n<\/tr>\n<tr>\n<th>Did not participate in 9\/11 rescue<\/th>\n<td>441<\/td>\n<td>110<\/td>\n<td>551<\/td>\n<\/tr>\n<tr>\n<th><\/th>\n<td>1234<\/td>\n<td>419<\/td>\n<td>1653<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\t<iframe id=\"assessment_practice_da382dc4-987d-4305-98af-cf5ba364bc43\" class=\"resizable\" src=\"https:\/\/assess.lumenlearning.com\/practice\/da382dc4-987d-4305-98af-cf5ba364bc43?iframe_resize_id=assessment_practice_id_da382dc4-987d-4305-98af-cf5ba364bc43\" frameborder=\"0\" style=\"border:none;width:100%;height:100%;min-height:300px;\"><br \/>\n\t<\/iframe><\/p>\n<\/div>\n<div class=\"textbox key-takeaways\">\n<h3>Try It<\/h3>\n<table>\n<tbody>\n<tr>\n<th style=\"text-align: center;\" colspan=\"5\">Observed Counts<\/th>\n<\/tr>\n<tr>\n<th><\/th>\n<th>About right<\/th>\n<th>Overweight<\/th>\n<th>Underweight<\/th>\n<td>Row Totals<\/td>\n<\/tr>\n<tr>\n<th>Female<\/th>\n<td>560<\/td>\n<td>163<\/td>\n<td>37<\/td>\n<td>760<\/td>\n<\/tr>\n<tr>\n<th>Male<\/th>\n<td>295<\/td>\n<td>72<\/td>\n<td>73<\/td>\n<td>440<\/td>\n<\/tr>\n<tr>\n<td>Column Totals<\/td>\n<td>855<\/td>\n<td>235<\/td>\n<td>110<\/td>\n<td>1200<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\t<iframe id=\"assessment_practice_f900c2d9-0122-4b95-8c0b-c78f5d59b73e\" class=\"resizable\" src=\"https:\/\/assess.lumenlearning.com\/practice\/f900c2d9-0122-4b95-8c0b-c78f5d59b73e?iframe_resize_id=assessment_practice_id_f900c2d9-0122-4b95-8c0b-c78f5d59b73e\" frameborder=\"0\" style=\"border:none;width:100%;height:100%;min-height:300px;\"><br \/>\n\t<\/iframe><\/p>\n<\/div>\n<div class=\"textbox exercises\">\n<h3>Example<\/h3>\n<h2>More on Gender and Body Image<\/h2>\n<p><em>Checking Conditions<\/em><\/p>\n<p>The conditions for use of the chi-square distribution are the same as we learned previously:<\/p>\n<ul>\n<li>The sample is random.<\/li>\n<li>All of the expected counts are 5 or greater.<\/li>\n<\/ul>\n<p>Since the data meets the conditions, we can proceed with calculating \u03c7<sup>2<\/sup> test statistic.<\/p>\n<p><em>Calculating the Chi-Square Test Statistic<\/em><\/p>\n<p>We calculate the chi-square test statistic as we did in &#8220;Chi-Square Test for One-Way Tables.&#8221;<\/p>\n<p style=\"text-align: center;\">[latex]{\\chi }^{2}\\text{}=\\text{}\u2211\\frac{{(\\mathrm{observed}-\\mathrm{expected})}^{2}}{\\mathrm{expected}}[\/latex]<\/p>\n<p>We will use technology to calculate the chi-square value. But for this sample, we will show the calculation.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone\" src=\"https:\/\/s3-us-west-2.amazonaws.com\/courses-images\/wp-content\/uploads\/sites\/1729\/2017\/04\/15032827\/m11_chi_square_tests_topic_11_2_m11_test_independence_2_image12.png\" alt=\"Chi-squared = (560-541.5)^2\/541.5 + (295-313.5)^2\/313.5 + (163-148.8)^2\/148.8 + (72-86.17)^2\/86.17 + (37-69.67)^2\/69.67 + (73-40.33)^2\/40.33 = 47.18.\" width=\"688\" height=\"106\" \/><\/p>\n<p><em>Finding Degrees of Freedom and the P-Value<\/em><\/p>\n<p>For a chi-square tests based on two-way tables, the degrees of freedom are<\/p>\n<ul style=\"list-style-type: none;\">\n<li>(number of explanatory categories &#8211; 1) \u00d7 (number of response categories &#8211; 1)<\/li>\n<\/ul>\n<p>You will also see this written: (<em>r<\/em> \u2212 1)(<em>c<\/em> \u2212 1), where <em>r<\/em> is the number of rows and <em>c<\/em> is the number of columns in the two-way table (when we write the table without row and column totals). In this case the degrees of freedom are (2 \u2212 1)(3 \u22121 ) = 2.<\/p>\n<p>We use the chi-square distribution with <em>df<\/em> = 2 to find the P-value. Note that the chi-square test statistic for this sample is so large that it is off the scale used in the simulation. So we conclude that the P-value is essentially zero.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone\" src=\"https:\/\/s3-us-west-2.amazonaws.com\/courses-images\/wp-content\/uploads\/sites\/1729\/2017\/04\/15032830\/m11_chi_square_tests_topic_11_2_m11_test_independence_2_image13.png\" alt=\"Graph showing a chi-squared distribution with 2 degrees of freedom.  A value of 20 is marked on the right of the graph, with a p-value less than 0.0001.\" width=\"382\" height=\"304\" \/><\/p>\n<p><strong>Step 4: Conclusion<\/strong><\/p>\n<p>The relationship between gender and body image is statistically significant in this sample. We reject the null hypothesis and accept the alternative hypothesis. Gender and body image are dependent variables in the population of U.S. college students. (P-value is essentially 0.)<\/p>\n<\/div>\n<div class=\"textbox key-takeaways\">\n<h3>Try It<\/h3>\n<h2>More on Gender and Body Piercing<\/h2>\n<p>A study was done on the relationship between gender and ear piercing among high-school students. A sample of 1,000 students was chosen, then classified according to both gender and whether or not they had either of their ears pierced. The following information is available:<\/p>\n<table>\n<tr>\n<th colspan=\"4\">Chi-Square Test: Pierced, No Pierced<\/th>\n<\/tr>\n<tr><\/tr>\n<tr>\n<th colspan=\"4\">Observed Counts:<\/th>\n<\/tr>\n<tr>\n<td><\/td>\n<td>Pierced<\/td>\n<td>No Pierced<\/td>\n<td>Total<\/td>\n<\/tr>\n<tr>\n<td>Female<\/td>\n<td>576<\/td>\n<td>64<\/td>\n<td>640<\/td>\n<\/tr>\n<tr>\n<td>Male<\/td>\n<td>72<\/td>\n<td>288<\/td>\n<td>360<\/td>\n<\/tr>\n<tr>\n<td>Total<\/td>\n<td>648<\/td>\n<td>352<\/td>\n<td>1000<\/td>\n<\/tr>\n<tr><\/tr>\n<tr>\n<th colspan=\"4\">Expected Counts:<\/th>\n<\/tr>\n<tr>\n<td><\/td>\n<td>Pierced<\/td>\n<td>No Pierced<\/td>\n<td>Total<\/td>\n<\/tr>\n<tr>\n<td>Female<\/td>\n<td>414.72<\/td>\n<td>225.28<\/td>\n<td>640<\/td>\n<\/tr>\n<tr>\n<td>Male<\/td>\n<td>233.28<\/td>\n<td>126.72<\/td>\n<td>360<\/td>\n<\/tr>\n<tr>\n<td>Total<\/td>\n<td>648<\/td>\n<td>352<\/td>\n<td>1000<\/td>\n<\/tr>\n<tr><\/tr>\n<tr>\n<th colspan=\"4\">Chi-Square Contribution:<\/th>\n<\/tr>\n<tr>\n<td><\/td>\n<td>Pierced<\/td>\n<td>No Pierced<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>Female<\/td>\n<td><\/td>\n<td>115.462<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>Male<\/td>\n<td>111.502<\/td>\n<td>205.265<\/td>\n<td><\/td>\n<\/tr>\n<\/table>\n<p>\t<iframe id=\"assessment_practice_25d13fd7-57e4-4f28-8857-09b29ed03fcd\" class=\"resizable\" src=\"https:\/\/assess.lumenlearning.com\/practice\/25d13fd7-57e4-4f28-8857-09b29ed03fcd?iframe_resize_id=assessment_practice_id_25d13fd7-57e4-4f28-8857-09b29ed03fcd\" frameborder=\"0\" style=\"border:none;width:100%;height:100%;min-height:300px;\"><br \/>\n\t<\/iframe><\/p>\n<p>\t<iframe id=\"assessment_practice_57e189f0-d10c-472f-9c79-55d15001f865\" class=\"resizable\" src=\"https:\/\/assess.lumenlearning.com\/practice\/57e189f0-d10c-472f-9c79-55d15001f865?iframe_resize_id=assessment_practice_id_57e189f0-d10c-472f-9c79-55d15001f865\" frameborder=\"0\" style=\"border:none;width:100%;height:100%;min-height:300px;\"><br \/>\n\t<\/iframe><\/p>\n<p>\t<iframe id=\"assessment_practice_760406f1-9631-4acf-b176-9213f8c531d6\" class=\"resizable\" src=\"https:\/\/assess.lumenlearning.com\/practice\/760406f1-9631-4acf-b176-9213f8c531d6?iframe_resize_id=assessment_practice_id_760406f1-9631-4acf-b176-9213f8c531d6\" frameborder=\"0\" style=\"border:none;width:100%;height:100%;min-height:300px;\"><br \/>\n\t<\/iframe><\/p>\n<\/div>\n<h2>Contribute!<\/h2>\n<div style=\"margin-bottom: 8px;\">Did you have an idea for improving this content? We\u2019d love your input.<\/div>\n<p><a style=\"font-size: 10pt; font-weight: 600; color: #077fab; text-decoration: none; border: 2px solid #077fab; border-radius: 7px; padding: 5px 25px; text-align: center; cursor: pointer; line-height: 1.5em;\" href=\"https:\/\/docs.google.com\/document\/d\/1a-isLcWJUgsy2zNyKQ2nIsbqy4_-hN1sKt2NgeMl4I4\" target=\"_blank\" rel=\"noopener\">Improve this page<\/a><a style=\"margin-left: 16px;\" href=\"https:\/\/docs.google.com\/document\/d\/1vy-T6DtTF-BbMfpVEI7VP_R7w2A4anzYZLXR8Pk4Fu4\" target=\"_blank\" rel=\"noopener\">Learn More<\/a><\/p>\n\n\t\t\t <section class=\"citations-section\" role=\"contentinfo\">\n\t\t\t <h3>Candela Citations<\/h3>\n\t\t\t\t\t <div>\n\t\t\t\t\t\t <div id=\"citation-list-599\">\n\t\t\t\t\t\t\t <div class=\"licensing\"><div class=\"license-attribution-dropdown-subheading\">CC licensed content, Shared previously<\/div><ul class=\"citation-list\"><li>Concepts in Statistics. <strong>Provided by<\/strong>: Open Learning Initiative. <strong>Located at<\/strong>: <a target=\"_blank\" href=\"http:\/\/oli.cmu.edu\">http:\/\/oli.cmu.edu<\/a>. <strong>License<\/strong>: <em><a target=\"_blank\" rel=\"license\" href=\"https:\/\/creativecommons.org\/licenses\/by\/4.0\/\">CC BY: Attribution<\/a><\/em><\/li><\/ul><\/div>\n\t\t\t\t\t\t <\/div>\n\t\t\t\t\t <\/div>\n\t\t\t <\/section>","protected":false},"author":163,"menu_order":7,"template":"","meta":{"_candela_citation":"[{\"type\":\"cc\",\"description\":\"Concepts in Statistics\",\"author\":\"\",\"organization\":\"Open Learning Initiative\",\"url\":\"http:\/\/oli.cmu.edu\",\"project\":\"\",\"license\":\"cc-by\",\"license_terms\":\"\"}]","CANDELA_OUTCOMES_GUID":"0ac61310-cf5d-4e25-a23c-ccb125efc153, 5cf86aa0-d0cb-4177-be0a-e91bc7361298","pb_show_title":"on","pb_short_title":"","pb_subtitle":"","pb_authors":[],"pb_section_license":""},"chapter-type":[],"contributor":[],"license":[],"class_list":["post-599","chapter","type-chapter","status-publish","hentry"],"part":570,"_links":{"self":[{"href":"https:\/\/courses.lumenlearning.com\/wm-concepts-statistics\/wp-json\/pressbooks\/v2\/chapters\/599","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/courses.lumenlearning.com\/wm-concepts-statistics\/wp-json\/pressbooks\/v2\/chapters"}],"about":[{"href":"https:\/\/courses.lumenlearning.com\/wm-concepts-statistics\/wp-json\/wp\/v2\/types\/chapter"}],"author":[{"embeddable":true,"href":"https:\/\/courses.lumenlearning.com\/wm-concepts-statistics\/wp-json\/wp\/v2\/users\/163"}],"version-history":[{"count":18,"href":"https:\/\/courses.lumenlearning.com\/wm-concepts-statistics\/wp-json\/pressbooks\/v2\/chapters\/599\/revisions"}],"predecessor-version":[{"id":2822,"href":"https:\/\/courses.lumenlearning.com\/wm-concepts-statistics\/wp-json\/pressbooks\/v2\/chapters\/599\/revisions\/2822"}],"part":[{"href":"https:\/\/courses.lumenlearning.com\/wm-concepts-statistics\/wp-json\/pressbooks\/v2\/parts\/570"}],"metadata":[{"href":"https:\/\/courses.lumenlearning.com\/wm-concepts-statistics\/wp-json\/pressbooks\/v2\/chapters\/599\/metadata\/"}],"wp:attachment":[{"href":"https:\/\/courses.lumenlearning.com\/wm-concepts-statistics\/wp-json\/wp\/v2\/media?parent=599"}],"wp:term":[{"taxonomy":"chapter-type","embeddable":true,"href":"https:\/\/courses.lumenlearning.com\/wm-concepts-statistics\/wp-json\/pressbooks\/v2\/chapter-type?post=599"},{"taxonomy":"contributor","embeddable":true,"href":"https:\/\/courses.lumenlearning.com\/wm-concepts-statistics\/wp-json\/wp\/v2\/contributor?post=599"},{"taxonomy":"license","embeddable":true,"href":"https:\/\/courses.lumenlearning.com\/wm-concepts-statistics\/wp-json\/wp\/v2\/license?post=599"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}