{"id":2280,"date":"2024-06-28T11:40:33","date_gmt":"2024-06-28T15:40:33","guid":{"rendered":"https:\/\/pressbooks.bccampus.ca\/1130sandbox\/?post_type=chapter&#038;p=2280"},"modified":"2024-06-30T01:13:25","modified_gmt":"2024-06-30T05:13:25","slug":"confidence-intervals-for-%cf%83-known","status":"publish","type":"chapter","link":"https:\/\/pressbooks.bccampus.ca\/1130sandbox\/chapter\/confidence-intervals-for-%cf%83-known\/","title":{"raw":"Confidence Intervals for \u03c3 Known","rendered":"Confidence Intervals for \u03c3 Known"},"content":{"raw":"<div class=\"textbox textbox--learning-objectives\"><header class=\"textbox__header\">\r\n<p class=\"textbox__title\">Learning Objectives<\/p>\r\n\r\n<\/header>\r\n<div class=\"textbox__content\">\r\n\r\nIn this section, we will examine the formulas to calculate\r\n<ul>\r\n \t<li>The lower and upper limits confidence interval limits<\/li>\r\n \t<li>Margin of error<\/li>\r\n \t<li>Required sample size<\/li>\r\n \t<li>Examine when averages fail to forecast future data<\/li>\r\n<\/ul>\r\n<\/div>\r\n<\/div>\r\nWhen the population standard deviation (\u03c3) is known and we want to construct the interval estimate, or confidence interval for the true mean, \u03bc, we use:\r\n<ul>\r\n \t<li>[latex]CL_{Lower} = \\bar{x} - z\\cdot \\frac{\\sigma}{\\sqrt{n}} [\/latex]<\/li>\r\n \t<li>[latex]CL_{Upper} = \\bar{x}+ z\\cdot \\frac{\\sigma}{\\sqrt{n}} [\/latex]<\/li>\r\n<\/ul>\r\nThese calculations will provide the lower and upper confidence limits respectively. Remember: [latex]\\bar{x}[\/latex] is the sample mean, [latex]\\sigma[\/latex] is the population standard deviation, [latex]z[\/latex] is the [latex]z[\/latex]-score related to a given confidence level and [latex]n[\/latex] is the sample size.\r\n\r\n[caption id=\"attachment_2397\" align=\"aligncenter\" width=\"562\"]<a href=\"https:\/\/pressbooks.bccampus.ca\/1130sandbox\/wp-content\/uploads\/sites\/2128\/2024\/06\/Confidence_w_0_z.jpg\"><img class=\"wp-image-2397 size-full\" src=\"https:\/\/pressbooks.bccampus.ca\/1130sandbox\/wp-content\/uploads\/sites\/2128\/2024\/06\/Confidence_w_0_z.jpg\" alt=\"Bell curve middl e area highlighted and confidence level written in this area. The limits of this middle area are minus z and z, respectively.\" width=\"562\" height=\"282\" \/><\/a> Figure 48.1 Confidence interval with areas to the left of z-scores.[\/caption]\r\n\r\n<span style=\"text-align: initial\">The<\/span><span style=\"text-align: initial\"> negative and positive [latex]z[\/latex]-score can be calculated using Excel's <\/span><a style=\"text-align: initial\" href=\"https:\/\/support.microsoft.com\/en-us\/office\/norm-s-inv-function-d6d556b4-ab7f-49cd-b526-5a20918452b1\">NORM.S.INV()<\/a><span style=\"text-align: initial\"> function:<\/span>\r\n<ul>\r\n \t<li>[latex]-z = \\text{NORM.S.INV}(\\frac{1-\\text{Conf level}}{2})[\/latex]<\/li>\r\n \t<li>[latex]z = \\text{NORM.S.INV}(\\frac{1-\\text{Conf level}}{2}+\\text{Conf level})[\/latex]<\/li>\r\n<\/ul>\r\n<h1>Margin of Error Formula<\/h1>\r\nThe margin of error (E) can be defined as the amount of random sampling error in the results of a survey. This is what we add and subtract from the sample mean (x\u0304) in the formulas above:\r\n\r\n\\[E = z\\cdot \\frac{\\sigma}{\\sqrt{n}}\\]\r\n\r\nIt can also be considered as \"how far off\" the sample mean, x\u0304, could be from the true mean, \u03bc, with a level of certainty equivalent to the confidence level.\r\n\r\n[caption id=\"attachment_2400\" align=\"aligncenter\" width=\"562\"]<a href=\"https:\/\/pressbooks.bccampus.ca\/1130sandbox\/wp-content\/uploads\/sites\/2128\/2024\/06\/Confidence_w_CL_E_x-bar.jpg\"><img class=\"size-full wp-image-2400\" src=\"https:\/\/pressbooks.bccampus.ca\/1130sandbox\/wp-content\/uploads\/sites\/2128\/2024\/06\/Confidence_w_CL_E_x-bar.jpg\" alt=\"Bell curve with middle area highlighted and marked as confidence level. Margin of errors also marked between middle x-bar value and outer limits.\" width=\"562\" height=\"282\" \/><\/a> Figure 48.2 Confidence interval with margin of error with sample mean and limits.[\/caption]\r\n\r\nWe can also use an Excel's CONFIDENCE.NORM() function to calculate the Margin of Error directly: [latex] E = \\text{CONFIDENCE.NORM}(\\alpha, s, n)[\/latex]. Where:\r\n<ul>\r\n \t<li>[latex]\\alpha = 1-\\text{Confidence Level} = 100\\%-\\text{Confidence Level}[\/latex]<\/li>\r\n \t<li>[latex]s = [\/latex] sample standard deviation<\/li>\r\n \t<li>[latex]n = [\/latex] sample size<\/li>\r\n<\/ul>\r\n[caption id=\"attachment_2343\" align=\"aligncenter\" width=\"551\"]<a href=\"https:\/\/pressbooks.bccampus.ca\/1130sandbox\/wp-content\/uploads\/sites\/2128\/2024\/06\/Confidence_w_xbar_E_alpha.jpg\"><img class=\"size-full wp-image-2343\" src=\"https:\/\/pressbooks.bccampus.ca\/1130sandbox\/wp-content\/uploads\/sites\/2128\/2024\/06\/Confidence_w_xbar_E_alpha.jpg\" alt=\"Bell shaped curve with area between the lower and upper confidence interval limits highlighted. Between the limits and the middle is marked E on either side.\" width=\"551\" height=\"279\" \/><\/a> Figure 48.3 Confidence interval with margin of error and alpha marked[\/caption]\r\n<h1>Sample Size Formula<\/h1>\r\nWhen we would like to determine how large of a sample to select to establish a maximum margin of error we use:\r\n\r\n\\[n = \\left( \\frac{z\\cdot \\sigma}{E}\\right)^2\\]\r\n\r\nNote that you should always round your final answer up for [latex]n[\/latex] to ensure that the margin of error does not exceed the desired error size (E).\r\n<h1>Confidence Interval Calculation (Video)<\/h1>\r\nIn the example below, we will build up a confidence interval in the case where the population standard deviation (\u03c3) is known.\r\n<h2>Example 48.1.1<\/h2>\r\n<span style=\"color: #003366\"><strong>Problem Setup<\/strong><\/span>: Your boss wants you to forecast how many units of a certain type of EpiPen to order this month. You have recorded the monthly demand for the last 101 months. This demand has been recorded <a href=\"https:\/\/pressbooks.bccampus.ca\/1130sandbox\/wp-content\/uploads\/sites\/2128\/2024\/06\/Example48-1-1_Data.xlsx\">in the following spreadsheet<\/a>. The following metrics were recorded for this data:\r\n<ul>\r\n \t<li>Population standard deviation (\u03c3) = 396.54<\/li>\r\n \t<li>Sample mean (x\u0304) = 927.762<\/li>\r\n \t<li>Sample size (n) = 101<\/li>\r\n<\/ul>\r\n<span style=\"color: #003366\"><strong>Question<\/strong><\/span>: You want to find the range of units such that there is a 95% chance that the true average demand lies in this range. What are the limits for this interval?\r\n\r\n<span style=\"color: #003366\"><strong>Solutions<\/strong><\/span>: <a href=\"https:\/\/pressbooks.bccampus.ca\/1130sandbox\/wp-content\/uploads\/sites\/2128\/2024\/06\/Example48-1-1_Solutions.xlsx\">Click here<\/a> to download the Excel solutions shown in the video below.\r\n\r\nhttps:\/\/youtu.be\/m6ML9sYaRm4\r\n<span style=\"color: #003366\"><strong>Conclusion<\/strong><\/span>: You can be 95% certain that the true average number of EpiPens demanded is between 850 and 1,005 pens per month. We will look at narrowing this range in the next section.\r\n<div>\r\n<h1>Click here to reveal the written solutions shown in the above video<\/h1>\r\nIn order to construct a 95% confidence interval when sigma in known, we first need to calculate the z-score(s). To do this, calculate the areas to the left of the z-score(s).\r\n<h2>Calculating the area to the left of the limits<\/h2>\r\n[caption id=\"attachment_2297\" align=\"aligncenter\" width=\"564\"]<a href=\"https:\/\/pressbooks.bccampus.ca\/1130sandbox\/wp-content\/uploads\/sites\/2128\/2024\/06\/ConfIdenceInts_w_95Percent.jpg\"><img class=\"size-full wp-image-2297\" src=\"https:\/\/pressbooks.bccampus.ca\/1130sandbox\/wp-content\/uploads\/sites\/2128\/2024\/06\/ConfIdenceInts_w_95Percent.jpg\" alt=\"\" width=\"564\" height=\"293\" \/><\/a> Figure 48.4\u00a0 95% Confidence Interval Areas[\/caption]\r\n<ul>\r\n \t<li>[latex]\\text{Area below LL} = \\frac{1-0.95}{2}=0.025 = 2.5\\% [\/latex]<\/li>\r\n \t<li>[latex]\\text{Area below UL} = \\frac{1-0.95}{2}+0.95=0.975 = 97.5\\% [\/latex]<\/li>\r\n<\/ul>\r\n<h2>Calculating the Z-Scores<\/h2>\r\nWe can then use Excel's <a href=\"https:\/\/support.microsoft.com\/en-us\/office\/norm-s-inv-function-d6d556b4-ab7f-49cd-b526-5a20918452b1\">NORM.S.INV<\/a> to calculate the z-score:\r\n<ul>\r\n \t<li>NORM.S.INV(0.025) = \u22121.95996<\/li>\r\n \t<li>NORM.S.INV(0.975) = 1.95996<\/li>\r\n<\/ul>\r\n<h3>Using the Lower Limit Area<\/h3>\r\nWhen using area to the left of the lower limit (2.5% in this case):\r\n<ul>\r\n \t<li>We obtain a negative z-score.<\/li>\r\n \t<li>This is because we have obtained the z-score for the limit below the mean.<\/li>\r\n \t<li>Just drop the minus sign when using it in the confidence interval formulas<\/li>\r\n<\/ul>\r\n<h3>Using the Upper Limit Area<\/h3>\r\nWhen using the area to the left of the upper limit (97.5%):\r\n<ul>\r\n \t<li>We obtain a positive z-score<\/li>\r\n \t<li>It is the same in magnitude but opposite in sign of the lower limit's z-score<\/li>\r\n<\/ul>\r\n<h2>Calculating the Lower Limit<\/h2>\r\nWe use the following formula to calculate the lower limit:\r\n\r\n[latex]\r\n\r\n\\begin{align}\r\n\r\nCL_{Lower} &amp;= \\bar{x} - z\\cdot \\frac{\\sigma}{\\sqrt{n}} \\\\\r\n\r\n&amp;= 927.762 - 1.95996 \\cdot \\frac{396.54}{\\sqrt{101}} \\\\\r\n\r\n&amp;= 850.428\r\n\r\n\\end{align}\r\n\r\n[\/latex]\r\n<h2>Calculating the Upper Limit<\/h2>\r\nWe use the following formula to calculate the upper limit:\r\n\r\n[latex]\r\n\r\n\\begin{align}\r\n\r\nCL_{Lower} &amp;= \\bar{x} + z\\cdot \\frac{\\sigma}{\\sqrt{n}} \\\\\r\n\r\n&amp;= 927.762 + 1.95996 \\cdot \\frac{396.54}{\\sqrt{101}} \\\\\r\n\r\n&amp;= 1005.097\r\n\r\n\\end{align}\r\n\r\n[\/latex]\r\n<h2>Margin of Error<\/h2>\r\nWe can just calculate the margin of error:\r\n\r\n\\[E = z\\cdot \\frac{\\sigma}{\\sqrt{n}} = 1.95996\\cdot \\frac{396.54}{\\sqrt{101}}=77.3347\\]\r\n<h2>Conclusions<\/h2>\r\nWe can be 95% certain that the true (population) mean, \u03bc, is between 850.428 and 1,005.097.\r\n\r\n<\/div>\r\n<h1>Calculating Sample Sizes (Video)<\/h1>\r\nAs discussed above, sometimes, when we calculate a confidence interval, the range is very wide. We can calculate the sample size required to reduce the width of this interval by calculating. We will examine this concept in the example below.\r\n<h2>Example 48.1.2<\/h2>\r\n<span style=\"color: #003366\"><strong>Problem Setup<\/strong><\/span>: Your boss asks you to improve your forecast for the average demand by narrowing the 95% confidence interval for the true mean monthly demand. Your boss wants your maximum sampling error (margin of error) to be 5 units.\r\n\r\n<span style=\"color: #003366\"><strong>Question<\/strong><\/span>: What sample size would be required to be sure your margin of error is at most 5 units?\r\n\r\n<span style=\"color: #003366\"><strong>Solution<\/strong><\/span>: <a href=\"https:\/\/pressbooks.bccampus.ca\/1130sandbox\/wp-content\/uploads\/sites\/2128\/2024\/06\/Example48-1-2_Solutions.xlsx\">Click here<\/a> to download the Excel solutions shown in the video below.\r\n\r\nhttps:\/\/youtu.be\/_KIXNbvmP6s\r\n\r\n<strong><span style=\"color: #003366\">Conclusion<\/span><\/strong>: You will need to collect demands from 24,162 months (or if you were collecting the data all from one location, this would be 2,000 years of data)! See the next section for comments on how using confidence intervals might not be the best approach to get approximate demand ranges for your boss.\r\n<div>\r\n<h1>Click here to reveal WRitten Solutions shown in the video above<\/h1>\r\nIn order to calculate the sample size, we use the following formula:\r\n\r\n\\[n = \\left( \\frac{z\\cdot \\sigma}{E}\\right)^2 = \\left( \\frac{1.95996\\cdot 396.54}{5}\\right)^2 = 24,161.9 \\approx 24,162 \\]\r\n\r\nThis is an incredibly large required sample size! We will explore why this is so large and what can possibly be done in the following section.\r\n\r\n<\/div>","rendered":"<div class=\"textbox textbox--learning-objectives\">\n<header class=\"textbox__header\">\n<p class=\"textbox__title\">Learning Objectives<\/p>\n<\/header>\n<div class=\"textbox__content\">\n<p>In this section, we will examine the formulas to calculate<\/p>\n<ul>\n<li>The lower and upper limits confidence interval limits<\/li>\n<li>Margin of error<\/li>\n<li>Required sample size<\/li>\n<li>Examine when averages fail to forecast future data<\/li>\n<\/ul>\n<\/div>\n<\/div>\n<p>When the population standard deviation (\u03c3) is known and we want to construct the interval estimate, or confidence interval for the true mean, \u03bc, we use:<\/p>\n<ul>\n<li>[latex]CL_{Lower} = \\bar{x} - z\\cdot \\frac{\\sigma}{\\sqrt{n}}[\/latex]<\/li>\n<li>[latex]CL_{Upper} = \\bar{x}+ z\\cdot \\frac{\\sigma}{\\sqrt{n}}[\/latex]<\/li>\n<\/ul>\n<p>These calculations will provide the lower and upper confidence limits respectively. Remember: [latex]\\bar{x}[\/latex] is the sample mean, [latex]\\sigma[\/latex] is the population standard deviation, [latex]z[\/latex] is the [latex]z[\/latex]-score related to a given confidence level and [latex]n[\/latex] is the sample size.<\/p>\n<figure id=\"attachment_2397\" aria-describedby=\"caption-attachment-2397\" style=\"width: 562px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/pressbooks.bccampus.ca\/1130sandbox\/wp-content\/uploads\/sites\/2128\/2024\/06\/Confidence_w_0_z.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-2397 size-full\" src=\"https:\/\/pressbooks.bccampus.ca\/1130sandbox\/wp-content\/uploads\/sites\/2128\/2024\/06\/Confidence_w_0_z.jpg\" alt=\"Bell curve middl e area highlighted and confidence level written in this area. The limits of this middle area are minus z and z, respectively.\" width=\"562\" height=\"282\" srcset=\"https:\/\/pressbooks.bccampus.ca\/1130sandbox\/wp-content\/uploads\/sites\/2128\/2024\/06\/Confidence_w_0_z.jpg 562w, https:\/\/pressbooks.bccampus.ca\/1130sandbox\/wp-content\/uploads\/sites\/2128\/2024\/06\/Confidence_w_0_z-300x151.jpg 300w, https:\/\/pressbooks.bccampus.ca\/1130sandbox\/wp-content\/uploads\/sites\/2128\/2024\/06\/Confidence_w_0_z-65x33.jpg 65w, https:\/\/pressbooks.bccampus.ca\/1130sandbox\/wp-content\/uploads\/sites\/2128\/2024\/06\/Confidence_w_0_z-225x113.jpg 225w, https:\/\/pressbooks.bccampus.ca\/1130sandbox\/wp-content\/uploads\/sites\/2128\/2024\/06\/Confidence_w_0_z-350x176.jpg 350w\" sizes=\"auto, (max-width: 562px) 100vw, 562px\" \/><\/a><figcaption id=\"caption-attachment-2397\" class=\"wp-caption-text\">Figure 48.1 Confidence interval with areas to the left of z-scores.<\/figcaption><\/figure>\n<p><span style=\"text-align: initial\">The<\/span><span style=\"text-align: initial\"> negative and positive [latex]z[\/latex]-score can be calculated using Excel&#8217;s <\/span><a style=\"text-align: initial\" href=\"https:\/\/support.microsoft.com\/en-us\/office\/norm-s-inv-function-d6d556b4-ab7f-49cd-b526-5a20918452b1\">NORM.S.INV()<\/a><span style=\"text-align: initial\"> function:<\/span><\/p>\n<ul>\n<li>[latex]-z = \\text{NORM.S.INV}(\\frac{1-\\text{Conf level}}{2})[\/latex]<\/li>\n<li>[latex]z = \\text{NORM.S.INV}(\\frac{1-\\text{Conf level}}{2}+\\text{Conf level})[\/latex]<\/li>\n<\/ul>\n<h1>Margin of Error Formula<\/h1>\n<p>The margin of error (E) can be defined as the amount of random sampling error in the results of a survey. This is what we add and subtract from the sample mean (x\u0304) in the formulas above:<\/p>\n<p>\\[E = z\\cdot \\frac{\\sigma}{\\sqrt{n}}\\]<\/p>\n<p>It can also be considered as &#8220;how far off&#8221; the sample mean, x\u0304, could be from the true mean, \u03bc, with a level of certainty equivalent to the confidence level.<\/p>\n<figure id=\"attachment_2400\" aria-describedby=\"caption-attachment-2400\" style=\"width: 562px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/pressbooks.bccampus.ca\/1130sandbox\/wp-content\/uploads\/sites\/2128\/2024\/06\/Confidence_w_CL_E_x-bar.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-2400\" src=\"https:\/\/pressbooks.bccampus.ca\/1130sandbox\/wp-content\/uploads\/sites\/2128\/2024\/06\/Confidence_w_CL_E_x-bar.jpg\" alt=\"Bell curve with middle area highlighted and marked as confidence level. Margin of errors also marked between middle x-bar value and outer limits.\" width=\"562\" height=\"282\" srcset=\"https:\/\/pressbooks.bccampus.ca\/1130sandbox\/wp-content\/uploads\/sites\/2128\/2024\/06\/Confidence_w_CL_E_x-bar.jpg 562w, https:\/\/pressbooks.bccampus.ca\/1130sandbox\/wp-content\/uploads\/sites\/2128\/2024\/06\/Confidence_w_CL_E_x-bar-300x151.jpg 300w, https:\/\/pressbooks.bccampus.ca\/1130sandbox\/wp-content\/uploads\/sites\/2128\/2024\/06\/Confidence_w_CL_E_x-bar-65x33.jpg 65w, https:\/\/pressbooks.bccampus.ca\/1130sandbox\/wp-content\/uploads\/sites\/2128\/2024\/06\/Confidence_w_CL_E_x-bar-225x113.jpg 225w, https:\/\/pressbooks.bccampus.ca\/1130sandbox\/wp-content\/uploads\/sites\/2128\/2024\/06\/Confidence_w_CL_E_x-bar-350x176.jpg 350w\" sizes=\"auto, (max-width: 562px) 100vw, 562px\" \/><\/a><figcaption id=\"caption-attachment-2400\" class=\"wp-caption-text\">Figure 48.2 Confidence interval with margin of error with sample mean and limits.<\/figcaption><\/figure>\n<p>We can also use an Excel&#8217;s CONFIDENCE.NORM() function to calculate the Margin of Error directly: [latex]E = \\text{CONFIDENCE.NORM}(\\alpha, s, n)[\/latex]. Where:<\/p>\n<ul>\n<li>[latex]\\alpha = 1-\\text{Confidence Level} = 100\\%-\\text{Confidence Level}[\/latex]<\/li>\n<li>[latex]s =[\/latex] sample standard deviation<\/li>\n<li>[latex]n =[\/latex] sample size<\/li>\n<\/ul>\n<figure id=\"attachment_2343\" aria-describedby=\"caption-attachment-2343\" style=\"width: 551px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/pressbooks.bccampus.ca\/1130sandbox\/wp-content\/uploads\/sites\/2128\/2024\/06\/Confidence_w_xbar_E_alpha.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-2343\" src=\"https:\/\/pressbooks.bccampus.ca\/1130sandbox\/wp-content\/uploads\/sites\/2128\/2024\/06\/Confidence_w_xbar_E_alpha.jpg\" alt=\"Bell shaped curve with area between the lower and upper confidence interval limits highlighted. Between the limits and the middle is marked E on either side.\" width=\"551\" height=\"279\" srcset=\"https:\/\/pressbooks.bccampus.ca\/1130sandbox\/wp-content\/uploads\/sites\/2128\/2024\/06\/Confidence_w_xbar_E_alpha.jpg 551w, https:\/\/pressbooks.bccampus.ca\/1130sandbox\/wp-content\/uploads\/sites\/2128\/2024\/06\/Confidence_w_xbar_E_alpha-300x152.jpg 300w, https:\/\/pressbooks.bccampus.ca\/1130sandbox\/wp-content\/uploads\/sites\/2128\/2024\/06\/Confidence_w_xbar_E_alpha-65x33.jpg 65w, https:\/\/pressbooks.bccampus.ca\/1130sandbox\/wp-content\/uploads\/sites\/2128\/2024\/06\/Confidence_w_xbar_E_alpha-225x114.jpg 225w, https:\/\/pressbooks.bccampus.ca\/1130sandbox\/wp-content\/uploads\/sites\/2128\/2024\/06\/Confidence_w_xbar_E_alpha-350x177.jpg 350w\" sizes=\"auto, (max-width: 551px) 100vw, 551px\" \/><\/a><figcaption id=\"caption-attachment-2343\" class=\"wp-caption-text\">Figure 48.3 Confidence interval with margin of error and alpha marked<\/figcaption><\/figure>\n<h1>Sample Size Formula<\/h1>\n<p>When we would like to determine how large of a sample to select to establish a maximum margin of error we use:<\/p>\n<p>\\[n = \\left( \\frac{z\\cdot \\sigma}{E}\\right)^2\\]<\/p>\n<p>Note that you should always round your final answer up for [latex]n[\/latex] to ensure that the margin of error does not exceed the desired error size (E).<\/p>\n<h1>Confidence Interval Calculation (Video)<\/h1>\n<p>In the example below, we will build up a confidence interval in the case where the population standard deviation (\u03c3) is known.<\/p>\n<h2>Example 48.1.1<\/h2>\n<p><span style=\"color: #003366\"><strong>Problem Setup<\/strong><\/span>: Your boss wants you to forecast how many units of a certain type of EpiPen to order this month. You have recorded the monthly demand for the last 101 months. This demand has been recorded <a href=\"https:\/\/pressbooks.bccampus.ca\/1130sandbox\/wp-content\/uploads\/sites\/2128\/2024\/06\/Example48-1-1_Data.xlsx\">in the following spreadsheet<\/a>. The following metrics were recorded for this data:<\/p>\n<ul>\n<li>Population standard deviation (\u03c3) = 396.54<\/li>\n<li>Sample mean (x\u0304) = 927.762<\/li>\n<li>Sample size (n) = 101<\/li>\n<\/ul>\n<p><span style=\"color: #003366\"><strong>Question<\/strong><\/span>: You want to find the range of units such that there is a 95% chance that the true average demand lies in this range. What are the limits for this interval?<\/p>\n<p><span style=\"color: #003366\"><strong>Solutions<\/strong><\/span>: <a href=\"https:\/\/pressbooks.bccampus.ca\/1130sandbox\/wp-content\/uploads\/sites\/2128\/2024\/06\/Example48-1-1_Solutions.xlsx\">Click here<\/a> to download the Excel solutions shown in the video below.<\/p>\n<p><iframe loading=\"lazy\" id=\"oembed-1\" title=\"How to construct a mean confidence interval when sigma is known\" width=\"500\" height=\"281\" src=\"https:\/\/www.youtube.com\/embed\/m6ML9sYaRm4?feature=oembed&#38;rel=0\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><br \/>\n<span style=\"color: #003366\"><strong>Conclusion<\/strong><\/span>: You can be 95% certain that the true average number of EpiPens demanded is between 850 and 1,005 pens per month. We will look at narrowing this range in the next section.<\/p>\n<div>\n<h1>Click here to reveal the written solutions shown in the above video<\/h1>\n<p>In order to construct a 95% confidence interval when sigma in known, we first need to calculate the z-score(s). To do this, calculate the areas to the left of the z-score(s).<\/p>\n<h2>Calculating the area to the left of the limits<\/h2>\n<figure id=\"attachment_2297\" aria-describedby=\"caption-attachment-2297\" style=\"width: 564px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/pressbooks.bccampus.ca\/1130sandbox\/wp-content\/uploads\/sites\/2128\/2024\/06\/ConfIdenceInts_w_95Percent.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-2297\" src=\"https:\/\/pressbooks.bccampus.ca\/1130sandbox\/wp-content\/uploads\/sites\/2128\/2024\/06\/ConfIdenceInts_w_95Percent.jpg\" alt=\"\" width=\"564\" height=\"293\" srcset=\"https:\/\/pressbooks.bccampus.ca\/1130sandbox\/wp-content\/uploads\/sites\/2128\/2024\/06\/ConfIdenceInts_w_95Percent.jpg 564w, https:\/\/pressbooks.bccampus.ca\/1130sandbox\/wp-content\/uploads\/sites\/2128\/2024\/06\/ConfIdenceInts_w_95Percent-300x156.jpg 300w, https:\/\/pressbooks.bccampus.ca\/1130sandbox\/wp-content\/uploads\/sites\/2128\/2024\/06\/ConfIdenceInts_w_95Percent-65x34.jpg 65w, https:\/\/pressbooks.bccampus.ca\/1130sandbox\/wp-content\/uploads\/sites\/2128\/2024\/06\/ConfIdenceInts_w_95Percent-225x117.jpg 225w, https:\/\/pressbooks.bccampus.ca\/1130sandbox\/wp-content\/uploads\/sites\/2128\/2024\/06\/ConfIdenceInts_w_95Percent-350x182.jpg 350w\" sizes=\"auto, (max-width: 564px) 100vw, 564px\" \/><\/a><figcaption id=\"caption-attachment-2297\" class=\"wp-caption-text\">Figure 48.4\u00a0 95% Confidence Interval Areas<\/figcaption><\/figure>\n<ul>\n<li>[latex]\\text{Area below LL} = \\frac{1-0.95}{2}=0.025 = 2.5\\%[\/latex]<\/li>\n<li>[latex]\\text{Area below UL} = \\frac{1-0.95}{2}+0.95=0.975 = 97.5\\%[\/latex]<\/li>\n<\/ul>\n<h2>Calculating the Z-Scores<\/h2>\n<p>We can then use Excel&#8217;s <a href=\"https:\/\/support.microsoft.com\/en-us\/office\/norm-s-inv-function-d6d556b4-ab7f-49cd-b526-5a20918452b1\">NORM.S.INV<\/a> to calculate the z-score:<\/p>\n<ul>\n<li>NORM.S.INV(0.025) = \u22121.95996<\/li>\n<li>NORM.S.INV(0.975) = 1.95996<\/li>\n<\/ul>\n<h3>Using the Lower Limit Area<\/h3>\n<p>When using area to the left of the lower limit (2.5% in this case):<\/p>\n<ul>\n<li>We obtain a negative z-score.<\/li>\n<li>This is because we have obtained the z-score for the limit below the mean.<\/li>\n<li>Just drop the minus sign when using it in the confidence interval formulas<\/li>\n<\/ul>\n<h3>Using the Upper Limit Area<\/h3>\n<p>When using the area to the left of the upper limit (97.5%):<\/p>\n<ul>\n<li>We obtain a positive z-score<\/li>\n<li>It is the same in magnitude but opposite in sign of the lower limit&#8217;s z-score<\/li>\n<\/ul>\n<h2>Calculating the Lower Limit<\/h2>\n<p>We use the following formula to calculate the lower limit:<\/p>\n<p>[latex]\\begin{align}    CL_{Lower} &= \\bar{x} - z\\cdot \\frac{\\sigma}{\\sqrt{n}} \\\\    &= 927.762 - 1.95996 \\cdot \\frac{396.54}{\\sqrt{101}} \\\\    &= 850.428    \\end{align}[\/latex]<\/p>\n<h2>Calculating the Upper Limit<\/h2>\n<p>We use the following formula to calculate the upper limit:<\/p>\n<p>[latex]\\begin{align}    CL_{Lower} &= \\bar{x} + z\\cdot \\frac{\\sigma}{\\sqrt{n}} \\\\    &= 927.762 + 1.95996 \\cdot \\frac{396.54}{\\sqrt{101}} \\\\    &= 1005.097    \\end{align}[\/latex]<\/p>\n<h2>Margin of Error<\/h2>\n<p>We can just calculate the margin of error:<\/p>\n<p>\\[E = z\\cdot \\frac{\\sigma}{\\sqrt{n}} = 1.95996\\cdot \\frac{396.54}{\\sqrt{101}}=77.3347\\]<\/p>\n<h2>Conclusions<\/h2>\n<p>We can be 95% certain that the true (population) mean, \u03bc, is between 850.428 and 1,005.097.<\/p>\n<\/div>\n<h1>Calculating Sample Sizes (Video)<\/h1>\n<p>As discussed above, sometimes, when we calculate a confidence interval, the range is very wide. We can calculate the sample size required to reduce the width of this interval by calculating. We will examine this concept in the example below.<\/p>\n<h2>Example 48.1.2<\/h2>\n<p><span style=\"color: #003366\"><strong>Problem Setup<\/strong><\/span>: Your boss asks you to improve your forecast for the average demand by narrowing the 95% confidence interval for the true mean monthly demand. Your boss wants your maximum sampling error (margin of error) to be 5 units.<\/p>\n<p><span style=\"color: #003366\"><strong>Question<\/strong><\/span>: What sample size would be required to be sure your margin of error is at most 5 units?<\/p>\n<p><span style=\"color: #003366\"><strong>Solution<\/strong><\/span>: <a href=\"https:\/\/pressbooks.bccampus.ca\/1130sandbox\/wp-content\/uploads\/sites\/2128\/2024\/06\/Example48-1-2_Solutions.xlsx\">Click here<\/a> to download the Excel solutions shown in the video below.<\/p>\n<p><iframe loading=\"lazy\" id=\"oembed-2\" title=\"How to calculate the sample size required for true mean estimations\" width=\"500\" height=\"281\" src=\"https:\/\/www.youtube.com\/embed\/_KIXNbvmP6s?feature=oembed&#38;rel=0\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n<p><strong><span style=\"color: #003366\">Conclusion<\/span><\/strong>: You will need to collect demands from 24,162 months (or if you were collecting the data all from one location, this would be 2,000 years of data)! See the next section for comments on how using confidence intervals might not be the best approach to get approximate demand ranges for your boss.<\/p>\n<div>\n<h1>Click here to reveal WRitten Solutions shown in the video above<\/h1>\n<p>In order to calculate the sample size, we use the following formula:<\/p>\n<p>\\[n = \\left( \\frac{z\\cdot \\sigma}{E}\\right)^2 = \\left( \\frac{1.95996\\cdot 396.54}{5}\\right)^2 = 24,161.9 \\approx 24,162 \\]<\/p>\n<p>This is an incredibly large required sample size! We will explore why this is so large and what can possibly be done in the following section.<\/p>\n<\/div>\n","protected":false},"author":865,"menu_order":2,"template":"","meta":{"pb_show_title":"on","pb_short_title":"","pb_subtitle":"","pb_authors":[],"pb_section_license":""},"chapter-type":[],"contributor":[],"license":[],"class_list":["post-2280","chapter","type-chapter","status-publish","hentry"],"part":487,"_links":{"self":[{"href":"https:\/\/pressbooks.bccampus.ca\/1130sandbox\/wp-json\/pressbooks\/v2\/chapters\/2280","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pressbooks.bccampus.ca\/1130sandbox\/wp-json\/pressbooks\/v2\/chapters"}],"about":[{"href":"https:\/\/pressbooks.bccampus.ca\/1130sandbox\/wp-json\/wp\/v2\/types\/chapter"}],"author":[{"embeddable":true,"href":"https:\/\/pressbooks.bccampus.ca\/1130sandbox\/wp-json\/wp\/v2\/users\/865"}],"version-history":[{"count":25,"href":"https:\/\/pressbooks.bccampus.ca\/1130sandbox\/wp-json\/pressbooks\/v2\/chapters\/2280\/revisions"}],"predecessor-version":[{"id":2413,"href":"https:\/\/pressbooks.bccampus.ca\/1130sandbox\/wp-json\/pressbooks\/v2\/chapters\/2280\/revisions\/2413"}],"part":[{"href":"https:\/\/pressbooks.bccampus.ca\/1130sandbox\/wp-json\/pressbooks\/v2\/parts\/487"}],"metadata":[{"href":"https:\/\/pressbooks.bccampus.ca\/1130sandbox\/wp-json\/pressbooks\/v2\/chapters\/2280\/metadata\/"}],"wp:attachment":[{"href":"https:\/\/pressbooks.bccampus.ca\/1130sandbox\/wp-json\/wp\/v2\/media?parent=2280"}],"wp:term":[{"taxonomy":"chapter-type","embeddable":true,"href":"https:\/\/pressbooks.bccampus.ca\/1130sandbox\/wp-json\/pressbooks\/v2\/chapter-type?post=2280"},{"taxonomy":"contributor","embeddable":true,"href":"https:\/\/pressbooks.bccampus.ca\/1130sandbox\/wp-json\/wp\/v2\/contributor?post=2280"},{"taxonomy":"license","embeddable":true,"href":"https:\/\/pressbooks.bccampus.ca\/1130sandbox\/wp-json\/wp\/v2\/license?post=2280"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}