{"id":145,"date":"2018-03-09T04:55:00","date_gmt":"2018-03-09T03:55:00","guid":{"rendered":"https:\/\/kindsonthegenius.com\/blog\/2018\/03\/09\/chi-square-goodness-of-fit-example-step-by-step-procedure\/"},"modified":"2020-08-22T20:23:54","modified_gmt":"2020-08-22T18:23:54","slug":"chi-square-goodness-of-fit-example-step-by-step-procedure","status":"publish","type":"post","link":"https:\/\/kindsonthegenius.com\/blog\/chi-square-goodness-of-fit-example-step-by-step-procedure\/","title":{"rendered":"Chi-Square Goodness of Fit Example &#8211; Step by Step Procedure"},"content":{"rendered":"<div style=\"color: #555555; font-size: 18px; line-height: 30px; text-align: justify;\">\n<div style=\"font-family: 'segoe ui';\"><b>Question<\/b><br \/>256 musicians were polled to determine their zodaic sign. The results are given below<br \/>Aries 29<br \/>Torus 24<br \/>Gemini 22<br \/>Cancer 19<br \/>Leo 21<br \/>Virgo 18<br \/>Libra 19<br \/>Scorpio 20<br \/>Sagittarius 23<br \/>Capricorn 18<br \/>Aquarius 20<br \/>Pisces 23<\/p>\n<p>Test the hypothesis that the zodaic signs are evenly distributed accross the musicians.<\/p>\n<p><b>Solution Steps<\/b><br \/><a href=\"http:\/\/kindsonthegenius.blogspot.com\/2018\/03\/excel-sheets-for-statistics-with.html\" target=\"_blank\">Get the excel sheet for this question <\/a><br \/>The formular for chi-square is<\/p>\n<div style=\"clear: both; text-align: center;\"><\/div>\n<div style=\"clear: both; text-align: center;\"><a href=\"https:\/\/4.bp.blogspot.com\/-n6edajkgWR4\/WqIAPGicT_I\/AAAAAAAABLs\/S7XxmvOyE6kqR7uu1nSqvcxvUnRZvsUbACEwYBhgL\/s1600\/ChiSquare-Formula.jpg\" style=\"margin-left: 1em; margin-right: 1em;\"><img decoding=\"async\" border=\"0\" data-original-height=\"183\" data-original-width=\"221\" src=\"https:\/\/4.bp.blogspot.com\/-n6edajkgWR4\/WqIAPGicT_I\/AAAAAAAABLs\/S7XxmvOyE6kqR7uu1nSqvcxvUnRZvsUbACEwYBhgL\/s1600\/ChiSquare-Formula.jpg\" \/><\/a><\/div>\n<p>where<br \/>O = Observed values<br \/>E = Expected value <\/p>\n<p><b>Step 1: State the null and alternate hypothesis<\/b><br \/><b>H<sub>0<\/sub>:<\/b> The values are evenly distributed <br \/><b>H<sub>a<\/sub><\/b>: The values are not evenly distributed<\/p>\n<p>Acceptance criteria for the null value is for large p-Value. (we would calculate this)<br \/>Rejection criteria is when p-value is low.<\/p>\n<p><b>Step 2:Create the Table<\/b><br \/>I have created the table in Excel as shown below<\/p>\n<div style=\"clear: both; text-align: center;\"><a href=\"https:\/\/4.bp.blogspot.com\/-AIDUQtKv3fE\/WqIIQrUrSpI\/AAAAAAAABL4\/xjNDs42MzgsWLRZ2pMGmRQuKqmVLdXM9QCLcBGAs\/s1600\/ChiSquare-Table1.jpg\" style=\"margin-left: 1em; margin-right: 1em;\"><img decoding=\"async\" loading=\"lazy\" border=\"0\" data-original-height=\"691\" data-original-width=\"600\" height=\"400\" src=\"https:\/\/4.bp.blogspot.com\/-AIDUQtKv3fE\/WqIIQrUrSpI\/AAAAAAAABL4\/xjNDs42MzgsWLRZ2pMGmRQuKqmVLdXM9QCLcBGAs\/s400\/ChiSquare-Table1.jpg\" width=\"346\" \/><\/a><\/div>\n<p><b>Step 3: Calculate the Expected Value <\/b><br \/>The expected value corresponds to the mean of the samples&nbsp; and has been calculated as 21.33.<\/p>\n<p><b>Step 4: Calculate the Difference<\/b><br \/>This is given by the formular Observed Value &#8211; Expected Value (O &#8211; E) for each of the observations.<\/p>\n<p><b>Step 5: Calculate the Squared Difference<\/b><br \/>This is the square of the value calculated in Step 4. The values are shown in Table 3.<\/p>\n<p><ins data-ad-client=\"ca-pub-7041870931346451\" data-ad-format=\"fluid\" data-ad-layout=\"in-article\" data-ad-slot=\"4209786523\" style=\"display: block; text-align: center;\"><\/ins><\/p>\n<p>  <b>Step 6: Calculate the Component<\/b><br \/>This is given by the chi-square formula<\/p>\n<div style=\"clear: both; text-align: center;\"><a href=\"https:\/\/4.bp.blogspot.com\/-1ojqbmJPLeI\/WqXYikGVsZI\/AAAAAAAABPI\/nMwJvbP9ERAvrxR1-wpaO5k4fPMuiRy6wCPcBGAYYCw\/s1600\/Chi-Square-Formular.jpg\" style=\"margin-left: 1em; margin-right: 1em;\"><img decoding=\"async\" loading=\"lazy\" border=\"0\" data-original-height=\"103\" data-original-width=\"287\" height=\"71\" src=\"https:\/\/4.bp.blogspot.com\/-1ojqbmJPLeI\/WqXYikGVsZI\/AAAAAAAABPI\/nMwJvbP9ERAvrxR1-wpaO5k4fPMuiRy6wCPcBGAYYCw\/s200\/Chi-Square-Formular.jpg\" width=\"200\" \/><\/a><\/div>\n<div style=\"clear: both; text-align: center;\"><\/div>\n<p>Calculate this value for each of the squared values<br \/>At this point the excel sheet would look like the one below<\/p>\n<div style=\"clear: both; text-align: center;\"><a href=\"https:\/\/2.bp.blogspot.com\/-L2P9OCfmz98\/WqINYS0bmvI\/AAAAAAAABMQ\/lRIMjyo0Snw2K9BnXrpjRH0eKBwgtsW0wCLcBGAs\/s1600\/ChiSquare-Table-Final.jpg\" style=\"margin-left: 1em; margin-right: 1em;\"><img decoding=\"async\" loading=\"lazy\" border=\"0\" data-original-height=\"727\" data-original-width=\"1246\" height=\"371\" src=\"https:\/\/2.bp.blogspot.com\/-L2P9OCfmz98\/WqINYS0bmvI\/AAAAAAAABMQ\/lRIMjyo0Snw2K9BnXrpjRH0eKBwgtsW0wCLcBGAs\/s640\/ChiSquare-Table-Final.jpg\" width=\"640\" \/>&nbsp;<\/a><\/div>\n<div style=\"clear: both; text-align: center;\"><b>Table 3<\/b>: Final Chi-Square Table <\/div>\n<p><b>Step 7: Calculate the Chi-Square Statitic<\/b><br \/>You can easily find this value by taking the sum of the last column.<br \/>Chi-Square test statistic = 5.09<\/p>\n<p><b>Step 8: Find the p-Value <\/b><br \/>You can find the p-value using the calculate chi-square statistic and the degrees of freedom<\/p>\n<p>Degrees of freedom is given by N-1<br \/>df = 12 &#8211; 1 = 11<br \/>where N is the number of observations in this case<br \/><a href=\"http:\/\/kindsonthegenius.blogspot.com\/2018\/03\/statistical-tables.html\" target=\"_blank\">See statistical tables here <\/a><\/p>\n<p>From the chi-square table we get a p-value of between <b>0.900<\/b> and <b>0.950.<\/b><\/p>\n<p><b>Step 9: State the Conclustion<\/b><br \/>In chi-square, the null-hypotheis is accepted if the p-value is very large, say 90% to 100% and we reject the null hypothesis for small values of p-value.<\/p>\n<p>In this case, the p-value is between 90% and 95%. Therefore, we accept the null hypothesis.<\/p>\n<p><a href=\"http:\/\/kindsonthegenius.blogspot.com\/2018\/03\/excel-sheets-for-statistics-with.html\" target=\"_blank\">Get this excel file<\/a><\/div>\n<\/div>\n<p><ins data-ad-client=\"ca-pub-7041870931346451\" data-ad-format=\"fluid\" data-ad-layout=\"in-article\" data-ad-slot=\"4209786523\" style=\"display: block; text-align: center;\"><\/ins> <br \/><ins data-ad-client=\"ca-pub-7041870931346451\" data-ad-format=\"fluid\" data-ad-layout=\"in-article\" data-ad-slot=\"4209786523\" style=\"display: block; text-align: center;\"><\/ins><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Question256 musicians were polled to determine their zodaic sign. The results are given belowAries 29Torus 24Gemini 22Cancer 19Leo 21Virgo 18Libra 19Scorpio 20Sagittarius 23Capricorn 18Aquarius 20Pisces &hellip; <\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0},"categories":[223],"tags":[],"_links":{"self":[{"href":"https:\/\/kindsonthegenius.com\/blog\/wp-json\/wp\/v2\/posts\/145"}],"collection":[{"href":"https:\/\/kindsonthegenius.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kindsonthegenius.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kindsonthegenius.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/kindsonthegenius.com\/blog\/wp-json\/wp\/v2\/comments?post=145"}],"version-history":[{"count":1,"href":"https:\/\/kindsonthegenius.com\/blog\/wp-json\/wp\/v2\/posts\/145\/revisions"}],"predecessor-version":[{"id":1460,"href":"https:\/\/kindsonthegenius.com\/blog\/wp-json\/wp\/v2\/posts\/145\/revisions\/1460"}],"wp:attachment":[{"href":"https:\/\/kindsonthegenius.com\/blog\/wp-json\/wp\/v2\/media?parent=145"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kindsonthegenius.com\/blog\/wp-json\/wp\/v2\/categories?post=145"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kindsonthegenius.com\/blog\/wp-json\/wp\/v2\/tags?post=145"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}