{"id":1531,"date":"2023-06-22T02:40:22","date_gmt":"2023-06-22T02:40:22","guid":{"rendered":"https:\/\/content.one.lumenlearning.com\/introstatstest\/chapter\/simulation-based-hypothesis-test-for-a-difference-in-proportions-learn-it-3\/"},"modified":"2025-05-17T02:58:08","modified_gmt":"2025-05-17T02:58:08","slug":"simulation-based-hypothesis-test-for-a-difference-in-proportions-learn-it-3","status":"publish","type":"chapter","link":"https:\/\/content.one.lumenlearning.com\/introstatstest\/chapter\/simulation-based-hypothesis-test-for-a-difference-in-proportions-learn-it-3\/","title":{"raw":"Simulation-Based Hypothesis Test for a Difference in Proportions - Learn It 3","rendered":"Simulation-Based Hypothesis Test for a Difference in Proportions &#8211; Learn It 3"},"content":{"raw":"<section class=\"textbox learningGoals\">\r\n<ul>\r\n\t<li><span data-sheets-value=\"{&quot;1&quot;:2,&quot;2&quot;:&quot;Complete a randomization test involving a difference in proportions&quot;}\" data-sheets-userformat=\"{&quot;2&quot;:6913,&quot;3&quot;:{&quot;1&quot;:0},&quot;11&quot;:4,&quot;12&quot;:0,&quot;14&quot;:{&quot;1&quot;:2,&quot;2&quot;:0},&quot;15&quot;:&quot;Calibri&quot;}\">Complete a randomization test involving a difference in proportions<\/span><\/li>\r\n<\/ul>\r\n<\/section>\r\n<h2>Simulation-based Hypothesis Tests<\/h2>\r\n<p>All simulation-based hypothesis tests follow the same general steps:<\/p>\r\n<ol>\r\n\t<li>Set up the null and alternative hypotheses based on the research question.<\/li>\r\n\t<li>Simulate a large number of samples (usually [latex]1,000[\/latex] or more) under the assumption of the null hypothesis, calculating a sample statistic for each simulated sample.<\/li>\r\n\t<li>Plot the simulated sample statistics with a histogram and compare the original observed statistic to the plot.<\/li>\r\n\t<li>The proportion of simulated statistics as or more extreme than observed is the estimated P-value.<\/li>\r\n<\/ol>\r\n<section class=\"textbox tryIt\">[ohm2_question hide_question_numbers=1]3457[\/ohm2_question]<\/section>\r\n<p>Let's simulate a large number of samples under the assumption of the null hypothesis using the statistical tool below.<\/p>\r\n<section class=\"textbox interact\"><strong>Step 1: <\/strong>Under \u201cData Entry &amp; Descriptive Statistics:\u201d\r\n\r\n<ul>\r\n\t<li style=\"list-style-type: none;\">\r\n<ul>\r\n\t<li>Select \u201cContingency Table\u201d under \u201cEnter Data.\u201d<\/li>\r\n\t<li>Type \u201cPeanut\u201d for the row variable, with \u201cAvoiders\u201d and \u201cEaters\u201d for the category labels.<\/li>\r\n\t<li>Type \u201cConditions\u201d for the column variable, with \u201cAllergic\u201d and \u201cNot allergic\u201d as the category labels.<\/li>\r\n\t<li>Enter the table below:<\/li>\r\n<\/ul>\r\n<\/li>\r\n<\/ul>\r\n<table>\r\n<tbody>\r\n<tr>\r\n<td style=\"width: 206.493px;\">\u00a0<\/td>\r\n<td style=\"width: 128.073px;\"><strong>Allergic<\/strong><\/td>\r\n<td style=\"width: 153.524px;\"><strong>Not allergic<\/strong><\/td>\r\n<\/tr>\r\n<tr>\r\n<td style=\"width: 206.493px;\"><strong>Peanut avoiders<\/strong><\/td>\r\n<td style=\"width: 128.073px;\">35<\/td>\r\n<td style=\"width: 153.524px;\">220<\/td>\r\n<\/tr>\r\n<tr>\r\n<td style=\"width: 206.493px;\"><strong>Peanut eaters<\/strong><\/td>\r\n<td style=\"width: 128.073px;\">5<\/td>\r\n<td style=\"width: 153.524px;\">240<\/td>\r\n<\/tr>\r\n<\/tbody>\r\n<\/table>\r\n<p><strong>Step 2: <\/strong>Now select \u201cPermutation Distribution\u201d in the top right. You should see the contingency table you entered as the \u201cObserved Contingency Table.\u201d Check \u201cConditions\u201d under \u201cPermutate Labels of\u201d and then generate a [latex]1000[\/latex] permutation of the data.<\/p>\r\n<p><strong>Step 3: <\/strong>The plot of the simulated differences in proportion can be found at the bottom of the \"Permutation Distribution\" tab. This plot is called a simulated <strong>null distribution\u00a0<\/strong>of differences in sample proportions.<\/p>\r\n<p><strong>Optional:<\/strong> You may use the \"Change binwidth of histogram\" and adjust the sliders to create a more detailed histogram by selecting a smaller binwidth.<\/p>\r\n<\/section>\r\n<p><iframe src=\"https:\/\/lumen-learning.shinyapps.io\/association_categorical\/\" width=\"100%\" height=\"1200\" frameborder=\"no\"><span data-mce-type=\"bookmark\" style=\"display: inline-block; width: 0px; overflow: hidden; line-height: 0;\" class=\"mce_SELRES_start\">\ufeff<\/span><\/iframe><br \/>\r\n[<a href=\"https:\/\/lumen-learning.shinyapps.io\/association_categorical\/\" target=\"_blank\" rel=\"noopener\">Trouble viewing? Click to open in a new tab.<\/a>]<\/p>\r\n<section class=\"textbox tryIt\">[ohm2_question hide_question_numbers=1]3130[\/ohm2_question]<\/section>","rendered":"<section class=\"textbox learningGoals\">\n<ul>\n<li><span data-sheets-value=\"{&quot;1&quot;:2,&quot;2&quot;:&quot;Complete a randomization test involving a difference in proportions&quot;}\" data-sheets-userformat=\"{&quot;2&quot;:6913,&quot;3&quot;:{&quot;1&quot;:0},&quot;11&quot;:4,&quot;12&quot;:0,&quot;14&quot;:{&quot;1&quot;:2,&quot;2&quot;:0},&quot;15&quot;:&quot;Calibri&quot;}\">Complete a randomization test involving a difference in proportions<\/span><\/li>\n<\/ul>\n<\/section>\n<h2>Simulation-based Hypothesis Tests<\/h2>\n<p>All simulation-based hypothesis tests follow the same general steps:<\/p>\n<ol>\n<li>Set up the null and alternative hypotheses based on the research question.<\/li>\n<li>Simulate a large number of samples (usually [latex]1,000[\/latex] or more) under the assumption of the null hypothesis, calculating a sample statistic for each simulated sample.<\/li>\n<li>Plot the simulated sample statistics with a histogram and compare the original observed statistic to the plot.<\/li>\n<li>The proportion of simulated statistics as or more extreme than observed is the estimated P-value.<\/li>\n<\/ol>\n<section class=\"textbox tryIt\"><iframe loading=\"lazy\" id=\"ohm3457\" class=\"resizable\" src=\"https:\/\/ohm.one.lumenlearning.com\/multiembedq.php?id=3457&theme=lumen&iframe_resize_id=ohm3457&source=tnh\" width=\"100%\" height=\"150\"><\/iframe><\/section>\n<p>Let&#8217;s simulate a large number of samples under the assumption of the null hypothesis using the statistical tool below.<\/p>\n<section class=\"textbox interact\"><strong>Step 1: <\/strong>Under \u201cData Entry &amp; Descriptive Statistics:\u201d<\/p>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li>Select \u201cContingency Table\u201d under \u201cEnter Data.\u201d<\/li>\n<li>Type \u201cPeanut\u201d for the row variable, with \u201cAvoiders\u201d and \u201cEaters\u201d for the category labels.<\/li>\n<li>Type \u201cConditions\u201d for the column variable, with \u201cAllergic\u201d and \u201cNot allergic\u201d as the category labels.<\/li>\n<li>Enter the table below:<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<table>\n<tbody>\n<tr>\n<td style=\"width: 206.493px;\">\u00a0<\/td>\n<td style=\"width: 128.073px;\"><strong>Allergic<\/strong><\/td>\n<td style=\"width: 153.524px;\"><strong>Not allergic<\/strong><\/td>\n<\/tr>\n<tr>\n<td style=\"width: 206.493px;\"><strong>Peanut avoiders<\/strong><\/td>\n<td style=\"width: 128.073px;\">35<\/td>\n<td style=\"width: 153.524px;\">220<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 206.493px;\"><strong>Peanut eaters<\/strong><\/td>\n<td style=\"width: 128.073px;\">5<\/td>\n<td style=\"width: 153.524px;\">240<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>Step 2: <\/strong>Now select \u201cPermutation Distribution\u201d in the top right. You should see the contingency table you entered as the \u201cObserved Contingency Table.\u201d Check \u201cConditions\u201d under \u201cPermutate Labels of\u201d and then generate a [latex]1000[\/latex] permutation of the data.<\/p>\n<p><strong>Step 3: <\/strong>The plot of the simulated differences in proportion can be found at the bottom of the &#8220;Permutation Distribution&#8221; tab. This plot is called a simulated <strong>null distribution\u00a0<\/strong>of differences in sample proportions.<\/p>\n<p><strong>Optional:<\/strong> You may use the &#8220;Change binwidth of histogram&#8221; and adjust the sliders to create a more detailed histogram by selecting a smaller binwidth.<\/p>\n<\/section>\n<p><iframe loading=\"lazy\" src=\"https:\/\/lumen-learning.shinyapps.io\/association_categorical\/\" width=\"100%\" height=\"1200\" frameborder=\"no\"><span data-mce-type=\"bookmark\" style=\"display: inline-block; width: 0px; overflow: hidden; line-height: 0;\" class=\"mce_SELRES_start\">\ufeff<\/span><\/iframe><br \/>\n[<a href=\"https:\/\/lumen-learning.shinyapps.io\/association_categorical\/\" target=\"_blank\" rel=\"noopener\">Trouble viewing? Click to open in a new tab.<\/a>]<\/p>\n<section class=\"textbox tryIt\"><iframe loading=\"lazy\" id=\"ohm3130\" class=\"resizable\" src=\"https:\/\/ohm.one.lumenlearning.com\/multiembedq.php?id=3130&theme=lumen&iframe_resize_id=ohm3130&source=tnh\" width=\"100%\" height=\"150\"><\/iframe><\/section>\n","protected":false},"author":8,"menu_order":27,"template":"","meta":{"_candela_citation":"[]","pb_show_title":"on","pb_short_title":"","pb_subtitle":"","pb_authors":[],"pb_section_license":""},"chapter-type":[],"contributor":[],"license":[],"part":1502,"module-header":"learn_it","content_attributions":[],"internal_book_links":[],"video_content":null,"cc_video_embed_content":{"cc_scripts":"","media_targets":[]},"try_it_collection":null,"_links":{"self":[{"href":"https:\/\/content.one.lumenlearning.com\/introstatstest\/wp-json\/pressbooks\/v2\/chapters\/1531"}],"collection":[{"href":"https:\/\/content.one.lumenlearning.com\/introstatstest\/wp-json\/pressbooks\/v2\/chapters"}],"about":[{"href":"https:\/\/content.one.lumenlearning.com\/introstatstest\/wp-json\/wp\/v2\/types\/chapter"}],"author":[{"embeddable":true,"href":"https:\/\/content.one.lumenlearning.com\/introstatstest\/wp-json\/wp\/v2\/users\/8"}],"version-history":[{"count":5,"href":"https:\/\/content.one.lumenlearning.com\/introstatstest\/wp-json\/pressbooks\/v2\/chapters\/1531\/revisions"}],"predecessor-version":[{"id":6936,"href":"https:\/\/content.one.lumenlearning.com\/introstatstest\/wp-json\/pressbooks\/v2\/chapters\/1531\/revisions\/6936"}],"part":[{"href":"https:\/\/content.one.lumenlearning.com\/introstatstest\/wp-json\/pressbooks\/v2\/parts\/1502"}],"metadata":[{"href":"https:\/\/content.one.lumenlearning.com\/introstatstest\/wp-json\/pressbooks\/v2\/chapters\/1531\/metadata\/"}],"wp:attachment":[{"href":"https:\/\/content.one.lumenlearning.com\/introstatstest\/wp-json\/wp\/v2\/media?parent=1531"}],"wp:term":[{"taxonomy":"chapter-type","embeddable":true,"href":"https:\/\/content.one.lumenlearning.com\/introstatstest\/wp-json\/pressbooks\/v2\/chapter-type?post=1531"},{"taxonomy":"contributor","embeddable":true,"href":"https:\/\/content.one.lumenlearning.com\/introstatstest\/wp-json\/wp\/v2\/contributor?post=1531"},{"taxonomy":"license","embeddable":true,"href":"https:\/\/content.one.lumenlearning.com\/introstatstest\/wp-json\/wp\/v2\/license?post=1531"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}