{"id":68,"date":"2021-01-12T22:19:39","date_gmt":"2021-01-12T22:19:39","guid":{"rendered":"https:\/\/textbooks.jaykesler.net\/introstats\/chapter\/a-single-population-mean-using-the-student-t-distribution\/"},"modified":"2023-04-19T19:11:31","modified_gmt":"2023-04-19T19:11:31","slug":"a-single-population-mean-using-the-student-t-distribution","status":"publish","type":"chapter","link":"https:\/\/textbooks.jaykesler.net\/introstats\/chapter\/a-single-population-mean-using-the-student-t-distribution\/","title":{"rendered":"A Single Population Mean using the Student t Distribution"},"content":{"raw":"<span style=\"display: none;\">\r\n[latexpage]\r\n<\/span>\r\n<div id=\"fda17024-5770-4f8f-b3fd-26217c74bd4b\" class=\"chapter-content-module\" data-type=\"page\" data-cnxml-to-html-ver=\"2.1.0\">\r\n<p id=\"delete_me\">In practice, we rarely know the population <span id=\"term152\" data-type=\"term\">standard deviation<\/span>. In the past, when the sample size was large, this did not present a problem to statisticians. They used the sample standard deviation <em data-effect=\"italics\">s<\/em> as an estimate for <em data-effect=\"italics\">\u03c3<\/em> and proceeded as before to calculate a <span id=\"term153\" data-type=\"term\">confidence interval<\/span> with close enough results. However, statisticians ran into problems when the sample size was small. A small sample size caused inaccuracies in the confidence interval.<\/p>\r\n<p id=\"element-643\">William S. Goset (1876\u20131937) of the Guinness brewery in Dublin, Ireland ran into this problem. His experiments with hops and barley produced very few samples. Just replacing <em data-effect=\"italics\">\u03c3<\/em> with <em data-effect=\"italics\">s<\/em> did not produce accurate results when he tried to calculate a confidence interval. He realized that he could not use a normal distribution for the calculation; he found that the actual distribution depends on the sample size. This problem led him to \"discover\" what is called the <span id=\"term154\" data-type=\"term\">Student's t-distribution<\/span>. The name comes from the fact that Gosset wrote under the pen name \"Student.\"<\/p>\r\n<p id=\"eip-254\">Up until the mid-1970s, some statisticians used the <span id=\"term155\" data-type=\"term\">normal distribution<\/span> approximation for large sample sizes and used the Student's t-distribution only for sample sizes of at most 30. With graphing calculators and computers, the practice now is to use the Student's t-distribution whenever <em data-effect=\"italics\">s<\/em> is used as an estimate for <em data-effect=\"italics\">\u03c3<\/em>.<\/p>\r\nIf you draw a simple random sample of size <em data-effect=\"italics\">n<\/em> from a population that has an approximately normal distribution with mean <em data-effect=\"italics\">\u03bc<\/em> and unknown population standard deviation <em data-effect=\"italics\">\u03c3<\/em> and calculate the <em data-effect=\"italics\">t<\/em>-score $$t=\\frac{\\bar x - \\mu}{s\/\\sqrt{n}}$$ then the <em data-effect=\"italics\">t<\/em>-scores follow a <strong>Student's t-distribution with <em data-effect=\"italics\">n<\/em> \u2013 1 degrees of freedom<\/strong>. The <em data-effect=\"italics\">t<\/em>-score has the same interpretation as the <span id=\"term156\" data-type=\"term\"><em data-effect=\"italics\">z<\/em>-score<\/span>. It measures how far $ \\bar x$ is from its mean <em data-effect=\"italics\">\u03bc<\/em>. For each sample size <em data-effect=\"italics\">n<\/em>, there is a different Student's t-distribution.\r\n<p id=\"eip-490\">The <span id=\"term157\" data-type=\"term\">degrees of freedom<\/span>, <strong><em data-effect=\"italics\">n<\/em> \u2013 1<\/strong>, come from the calculation of the sample standard deviation <strong><em data-effect=\"italics\">s<\/em><\/strong>.\u00a0 <strong>We call the number <em data-effect=\"italics\">n<\/em> \u2013 1 the degrees of freedom (df).<\/strong><\/p>\r\n\r\n<div id=\"eip-418\" data-type=\"list\">\r\n<div id=\"1\" data-type=\"title\">Properties of the Student's t-Distribution<\/div>\r\n<ul>\r\n \t<li>The graph for the Student's t-distribution is similar to the standard normal curve.<\/li>\r\n \t<li>The mean for the Student's t-distribution is zero and the distribution is symmetric about zero.<\/li>\r\n \t<li>The Student's t-distribution has more probability in its tails than the standard normal distribution because the spread of the t-distribution is greater than the spread of the standard normal. So the graph of the Student's t-distribution will be thicker in the tails and shorter in the center than the graph of the standard normal distribution.<\/li>\r\n \t<li>The exact shape of the Student's t-distribution depends on the degrees of freedom. As the degrees of freedom increases, the graph of Student's t-distribution becomes more like the graph of the standard normal distribution.<\/li>\r\n \t<li>The underlying population of individual observations is assumed to be normally distributed with unknown population mean <em data-effect=\"italics\">\u03bc<\/em> and unknown population standard deviation <em data-effect=\"italics\">\u03c3<\/em>. The size of the underlying population is generally not relevant unless it is very small. If it is bell shaped (normal) then the assumption is met and doesn't need discussion. Random sampling is assumed, but that is a completely separate assumption from normality.<\/li>\r\n<\/ul>\r\n<div class=\"textbox spreadsheet\">\r\n<h3>Google Sheets<\/h3>\r\nCalculators and computers can easily calculate any Student's t-probabilities. Google Sheets has the <code><a href=\"https:\/\/support.google.com\/docs\/answer\/9369014?hl=en\" target=\"_blank\" rel=\"noopener noreferrer\">T.DIST<\/a><\/code> function (along with <code>T.DIST.2T<\/code> and <code>T.DIST.RT<\/code> explained in a later chapter ) to find the probability for given values of <em data-effect=\"italics\">t<\/em>. The grammar for the <code>T.DIST<\/code> command is <code>T.DIST(x, degrees of freedom, cumulative?)<\/code>. However for confidence intervals, we need to use <strong>inverse<\/strong> probability to find the value of <em data-effect=\"italics\">t<\/em> when we know the probability.\r\n\r\nFor Google Sheets, you can use the <code>T.INV<\/code> function. The <code>T.INV<\/code> function works similarly to the <code>NORM.INV<\/code> function. The <code>T.INV<\/code> function requires two inputs:<strong> T.INV(area to the left, degrees of freedom)<\/strong> The output is the t-score that corresponds to the area we specified.\r\n\r\n&nbsp;\r\n\r\n<\/div>\r\n<\/div>\r\n<p id=\"eip-647\">A <a href=\"https:\/\/textbooks.jaykesler.net\/introstats\/back-matter\/student-t-distribution\/\" target=\"_blank\" rel=\"noopener noreferrer\">probability table for the Student's t-distribution<\/a> can also be used. The table gives t-scores that correspond to the confidence level (column) and degrees of freedom (row). <span data-type=\"newline\">\r\n<\/span><\/p>\r\n<span data-type=\"newline\">\r\n<\/span>A Student's t table gives <em data-effect=\"italics\">t<\/em>-scores given the degrees of freedom and the right-tailed probability. The table is very limited. <strong>Spreadsheets can easily calculate any Student's t-probabilities.<\/strong><span data-type=\"newline\">\r\n<\/span>\r\n<div id=\"eip-752\" data-type=\"list\">\r\n<div id=\"2\" data-type=\"title\"><strong>The notation for the Student's t-distribution (using <em data-effect=\"italics\">T<\/em> as the random variable) is:<\/strong><\/div>\r\n<ul>\r\n \t<li><em data-effect=\"italics\">T ~ t<sub>df<\/sub><\/em> where <em data-effect=\"italics\">df<\/em> = <em data-effect=\"italics\">n<\/em> \u2013 1.<\/li>\r\n \t<li>For example, if we have a sample of size <em data-effect=\"italics\">n<\/em> = 20 items, then we calculate the degrees of freedom as <em data-effect=\"italics\">df<\/em> = <em data-effect=\"italics\">n<\/em> - 1 = 20 - 1 = 19 and we write the distribution as <em data-effect=\"italics\">T ~ t<sub>19<\/sub><\/em>.<\/li>\r\n<\/ul>\r\n<\/div>\r\n<p id=\"eip-737\"><strong>If the population standard deviation is not known<\/strong>, the <span id=\"term158\" data-type=\"term\">error bound for a population mean<\/span> is:<\/p>\r\n\r\n<ul id=\"eip-168\">\r\n \t<li>$E = t_{\\alpha\/2}\\cdot\\frac{s}{\\sqrt{n}}$<\/li>\r\n \t<li>$t_{\\alpha\/2}$ is the $t$-score with an area to the right equal to $\\frac{\\alpha}{2}$\r\nNote that the <code>T.INV<\/code> function in a spreadsheet expects to be given a probability <span style=\"text-decoration: underline;\">to the left<\/span>. Since $t_{\\alpha\/2}$ is the $t$-score with an area <span style=\"text-decoration: underline;\">to the right<\/span>, we simply give the T.INV function the value $1-\\alpha\/2$.<\/li>\r\n \t<li>use <em data-effect=\"italics\">df<\/em> = <em data-effect=\"italics\">n<\/em> \u2013 1 degrees of freedom, and<\/li>\r\n \t<li><em data-effect=\"italics\">s<\/em> = sample standard deviation.<\/li>\r\n<\/ul>\r\n<p id=\"eip-819\"><strong>The format for the confidence interval is:\r\n<\/strong>$(\\bar x - E, \\bar x + E)$<\/p>\r\n\r\n<div id=\"eip-51\" class=\"ui-has-child-title\" data-type=\"example\"><header>\r\n<h3 class=\"os-title\"><span class=\"os-title-label\">Example <\/span><span class=\"os-number\">7.8<\/span><\/h3>\r\n<\/header><section>\r\n<div class=\"body\">\r\n<div id=\"element-632\" class=\" unnumbered\" data-type=\"exercise\"><header><\/header><section>\r\n<div id=\"id1171101195216\" data-type=\"problem\">\r\n<div class=\"os-problem-container \">\r\n<p id=\"element-866\">Suppose you do a study of acupuncture to determine how effective it is in relieving pain. You measure sensory rates for 15 subjects with the results given. Use the sample data to construct a 95% confidence interval for the mean sensory rate for the population (assumed normal) from which you took the data.<\/p>\r\n&nbsp;\r\n<div id=\"id1171109556457\"><span id=\"set-328\" data-type=\"list\" data-list-type=\"labeled-item\" data-display=\"inline\">8.6; 9.4; 7.9; 6.8; 8.3; 7.3; 9.2; 9.6; 8.7; 11.4; 10.3; 5.4; 8.1; 5.5; 6.9<\/span><\/div>\r\n<\/div>\r\n<\/div>\r\n<div id=\"id1171108330127\" data-type=\"solution\" aria-label=\"show solution\" aria-expanded=\"false\">\r\n<div class=\"ui-toggle-wrapper\"><\/div>\r\n<section class=\"ui-body\" style=\"display: block; overflow: hidden;\" role=\"alert\">\r\n<h4 data-type=\"solution-title\"><span class=\"os-title-label\">Solution <\/span><span class=\"os-number\">7.8<\/span><\/h4>\r\n<div class=\"os-solution-container\">\r\n<div class=\"textbox spreadsheet\">\r\n<h3>Google Sheets<\/h3>\r\nIf you copy the data from the problem into a spreadsheet, including the semi-colons, all data will be placed into a single cell which makes calculations (like the mean, standard deviation, etc) on the data difficult. Instead, use the Split Text to Columns functionality so each data point will be in a separate cell. Then use <code>AVERAGE<\/code> and <code>STDEV.S<\/code> functions to calculate the mean and standard deviation of the data.\r\n\r\n<img class=\"aligncenter size-full wp-image-549\" src=\"https:\/\/textbooks.jaykesler.net\/introstats\/wp-content\/uploads\/sites\/2\/2021\/01\/SplitTextToColumns.png\" alt=\"Screenshot of Google Sheets showing menu with &quot;split text to columns&quot; option\" width=\"620\" height=\"668\" \/>\r\n\r\n<\/div>\r\nTo find the confidence interval, you need the sample mean, $\\bar x$, and the margin of error, <em data-effect=\"italics\"> E <\/em>. First, use a spreadsheet to calculate the mean, standard deviation, and note the $n=15$.\r\n\r\n$\\bar x = 8.2267, ~~s=1.6722, ~~n=15$\r\n<p id=\"element-152\"><em data-effect=\"italics\">df<\/em> = 15 \u2013 1 = 14 <em data-effect=\"italics\">CL<\/em> so <em data-effect=\"italics\">\u03b1<\/em> = 1 \u2013 <em data-effect=\"italics\">CL<\/em> = 1 \u2013 0.95 = 0.05<\/p>\r\n$\\alpha=0.05$, so $t_{\\alpha\/2} = t_{0.025}$\r\n\r\nThe area to the right of <em data-effect=\"italics\">t<\/em><sub>0.025<\/sub> is 0.025\r\n\r\n$t_{\\alpha\/2} = t_{0.025}=2.14$ using <code>T.INV(0.975,14)<\/code> on a spreadsheet.\r\n\r\n$E = t_{\\alpha\/2} \\cdot \\frac{s}{\\sqrt{n}}=2.14\\cdot \\frac{1.6722}{\\sqrt{15}}$\r\n\r\n$\\bar x - E = 8.267-0.924 = 7.3$\r\n\r\n$\\bar x +E 8.267+0.924=9.15$\r\n\r\nThe 95% confidence interval is (7.3, 9.15).\r\n<p id=\"element-273\">We estimate with 95% confidence that the true population mean sensory rate is between 7.30 and 9.15.<\/p>\r\n\r\n<\/div>\r\n<\/section><\/div>\r\n<div id=\"fs-idp148096976\" data-type=\"solution\" aria-label=\"show solution\" aria-expanded=\"false\"><section class=\"ui-body\" style=\"display: block; overflow: hidden;\" role=\"alert\">\r\n<div class=\"os-solution-container\">\r\n<div id=\"eip-406\" class=\"ui-has-child-title\" data-type=\"note\" data-has-label=\"true\" data-label=\"\"><header>\r\n<h3 class=\"os-title\" data-type=\"title\"><span id=\"15\" class=\"os-title-label\" data-type=\"\">Note<\/span><\/h3>\r\n<\/header><section>\r\n<div class=\"os-note-body\">\r\n<p id=\"fs-idm137079696\">When calculating the margin of error, <a href=\"https:\/\/textbooks.jaykesler.net\/introstats\/back-matter\/student-t-distribution\/\" target=\"_blank\" rel=\"noopener noreferrer\">a probability table for the Student's t-distribution<\/a> can also be used to find the value of <em data-effect=\"italics\">t<\/em>. The table gives <em data-effect=\"italics\">t<\/em>-scores that correspond to the confidence level (column) and degrees of freedom (row); the <em data-effect=\"italics\">t<\/em>-score is found where the row and column intersect in the table.<\/p>\r\n\r\n<\/div>\r\n<\/section><\/div>\r\n<\/div>\r\n<\/section><\/div>\r\n<\/section><\/div>\r\n<\/div>\r\n<\/section><\/div>\r\n<div id=\"fs-idm181001040\" class=\"statistics try ui-has-child-title\" data-type=\"note\" data-has-label=\"true\" data-label=\"\"><header>\r\n<h3 class=\"os-title\"><span class=\"os-title-label\">Try It <\/span><span class=\"os-number\">7.8<\/span><\/h3>\r\n<\/header><section>\r\n<div id=\"eip-496\" class=\" unnumbered\" data-type=\"exercise\"><header><\/header><section>\r\n<div id=\"eip-247\" data-type=\"problem\">\r\n<div class=\"os-problem-container \">\r\n<p id=\"eip-331\">You do a study of hypnotherapy to determine how effective it is in increasing the number of hours of sleep subjects get each night. You measure hours of sleep for 12 subjects with the following results. Construct a 95% confidence interval for the mean number of hours slept for the population (assumed normal) from which you took the data.<\/p>\r\n<p id=\"eip-idm108202576\">8.2; 9.1; 7.7; 8.6; 6.9; 11.2; 10.1; 9.9; 8.9; 9.2; 7.5; 10.5<\/p>\r\n\r\n<\/div>\r\n<\/div>\r\n<\/section><\/div>\r\n<\/section><\/div>\r\n<div id=\"eip-804\" class=\"ui-has-child-title\" data-type=\"example\"><header>\r\n<h3 class=\"os-title\"><span class=\"os-title-label\">Example <\/span><span class=\"os-number\">7.9<\/span><\/h3>\r\n<\/header><section>\r\n<div class=\"body\">\r\n<div id=\"eip-821\" class=\" unnumbered\" data-type=\"exercise\"><header><\/header><section>\r\n<div id=\"eip-957\" data-type=\"problem\">\r\n<div class=\"os-problem-container \">\r\n<p id=\"eip-645\">The Human Toxome Project (HTP) is working to understand the scope of industrial pollution in the human body. Industrial chemicals may enter the body through pollution or as ingredients in consumer products. In October 2008, the scientists at HTP tested cord blood samples for 20 newborn infants in the United States. The cord blood of the \"In utero\/newborn\" group was tested for 430 industrial compounds, pollutants, and other chemicals, including chemicals linked to brain and nervous system toxicity, immune system toxicity, and reproductive toxicity, and fertility problems. There are health concerns about the effects of some chemicals on the brain and nervous system. <a class=\"autogenerated-content\" href=\"#eip-222\">Table 7.3<\/a> below shows how many of the targeted chemicals were found in each infant\u2019s cord blood.<\/p>\r\n\r\n<div id=\"eip-222\" class=\"os-table \">\r\n<table summary=\"Table 7.3 \" data-id=\"eip-222\">\r\n<tbody>\r\n<tr>\r\n<td>79<\/td>\r\n<td>145<\/td>\r\n<td>147<\/td>\r\n<td>160<\/td>\r\n<td>116<\/td>\r\n<td>100<\/td>\r\n<td>159<\/td>\r\n<td>151<\/td>\r\n<td>156<\/td>\r\n<td>126<\/td>\r\n<\/tr>\r\n<tr>\r\n<td>137<\/td>\r\n<td>83<\/td>\r\n<td>156<\/td>\r\n<td>94<\/td>\r\n<td>121<\/td>\r\n<td>144<\/td>\r\n<td>123<\/td>\r\n<td>114<\/td>\r\n<td>139<\/td>\r\n<td>99<\/td>\r\n<\/tr>\r\n<\/tbody>\r\n<\/table>\r\n<div class=\"os-caption-container\"><span class=\"os-title-label\">Table <\/span><span class=\"os-number\">7.3<\/span><\/div>\r\n<\/div>\r\n<p id=\"eip-idp159676448\">Use this sample data to construct a 90% confidence interval for the mean number of targeted industrial chemicals to be found in an in infant\u2019s blood.<\/p>\r\n\r\n<\/div>\r\n<\/div>\r\n<div id=\"eip-262\" data-type=\"solution\" data-label=\"\" aria-label=\"show solution\" aria-expanded=\"false\">\r\n<div class=\"ui-toggle-wrapper\"><\/div>\r\n<section class=\"ui-body\" style=\"display: block; overflow: hidden;\" role=\"alert\">\r\n<h4 data-type=\"solution-title\"><span class=\"os-title-label\">Solution <\/span><span class=\"os-number\">7.9<\/span><\/h4>\r\n<div class=\"os-solution-container\">\r\n\r\nFrom the sample, you can calculate $\\bar x = 127.45$ and $s=25.965$. There are 20 infants in the sample, so <em data-effect=\"italics\">n<\/em> = 20, and <em data-effect=\"italics\">df<\/em> = 20 \u2013 1 = 19.\r\n<p id=\"eip-idm108372720\">You are asked to calculate a 90% confidence interval: <em data-effect=\"italics\">CL<\/em> = 0.90, so <em data-effect=\"italics\">\u03b1<\/em> = 1 \u2013 <em data-effect=\"italics\">CL<\/em> = 1 \u2013 0.90 = 0.10\r\n$\\frac{\\alpha}{2} = 0.05$ so $t_{\\alpha\/2}=t_{0.05}$<\/p>\r\nBy definition, the area to the right of <em data-effect=\"italics\">t<\/em><sub>0.05<\/sub> is 0.05 and so the area to the left of <em data-effect=\"italics\">t<\/em><sub>0.05<\/sub> is 1 \u2013 0.05 = 0.95.\r\n<p id=\"eip-idm38662128\" class=\"finger\">Use a table, calculator, or computer to find that <em data-effect=\"italics\">t<\/em><sub>0.05<\/sub> = 1.729. In Google Sheets, use <code>T.INV(0.95, 19).<\/code><\/p>\r\n$E = t_{\\alpha\/2} \\cdot \\frac{s}{\\sqrt{n}} = 1.729 \\cdot \\frac{25.965}{\\sqrt{20}} = 10.038$\r\n\r\n$\\bar x - E = 127.45-10.038 = 117.412$\r\n\r\n$\\bar x + E = 127.45+10.038 = 137.488$\r\n\r\nWe estimate with 90% confidence that the mean number of all targeted industrial chemicals found in cord blood in the United States is between 117.412 and 137.488.\r\n\r\n<\/div>\r\n<\/section><\/div>\r\n<div id=\"fs-idp111080464\" data-type=\"solution\" data-label=\"\" aria-label=\"show solution\" aria-expanded=\"false\">\r\n<div class=\"ui-toggle-wrapper\"><\/div>\r\n<\/div>\r\n<\/section><\/div>\r\n<\/div>\r\n<\/section><\/div>\r\n<div id=\"fs-idm12320384\" class=\"statistics try ui-has-child-title\" data-type=\"note\" data-has-label=\"true\" data-label=\"\"><header>\r\n<h3 class=\"os-title\"><span class=\"os-title-label\">Try It <\/span><span class=\"os-number\">7.9<\/span><\/h3>\r\n<\/header><section>\r\n<div id=\"eip-467\" class=\" unnumbered\" data-type=\"exercise\"><header><\/header><section>\r\n<div id=\"eip-272\" data-type=\"problem\">\r\n<div class=\"os-problem-container \">\r\n<p id=\"eip-636\">A random sample of statistics students were asked to estimate the total number of hours they spend watching television in an average week. The responses are recorded in <a class=\"autogenerated-content\" href=\"#eip-672\">Table 7.4<\/a> below. Use this sample data to construct a 98% confidence interval for the mean number of hours statistics students will spend watching television in one week.<\/p>\r\n\r\n<div id=\"eip-672\" class=\"os-table \">\r\n<table summary=\"Table 7.4 \" data-id=\"eip-672\">\r\n<tbody>\r\n<tr>\r\n<td>0<\/td>\r\n<td>3<\/td>\r\n<td>1<\/td>\r\n<td>20<\/td>\r\n<td>9<\/td>\r\n<\/tr>\r\n<tr>\r\n<td>5<\/td>\r\n<td>10<\/td>\r\n<td>1<\/td>\r\n<td>10<\/td>\r\n<td>4<\/td>\r\n<\/tr>\r\n<tr>\r\n<td>14<\/td>\r\n<td>2<\/td>\r\n<td>4<\/td>\r\n<td>4<\/td>\r\n<td>5<\/td>\r\n<\/tr>\r\n<\/tbody>\r\n<\/table>\r\n<div class=\"os-caption-container\"><span class=\"os-title-label\">Table <\/span><span class=\"os-number\">7.4<\/span><\/div>\r\n<\/div>\r\n<\/div>\r\n<\/div>\r\n<\/section><\/div>\r\n<\/section><\/div>\r\n<\/div>","rendered":"<p><span style=\"display: none;\"><br \/>\n[latexpage]<br \/>\n<\/span><\/p>\n<div id=\"fda17024-5770-4f8f-b3fd-26217c74bd4b\" class=\"chapter-content-module\" data-type=\"page\" data-cnxml-to-html-ver=\"2.1.0\">\n<p id=\"delete_me\">In practice, we rarely know the population <span id=\"term152\" data-type=\"term\">standard deviation<\/span>. In the past, when the sample size was large, this did not present a problem to statisticians. They used the sample standard deviation <em data-effect=\"italics\">s<\/em> as an estimate for <em data-effect=\"italics\">\u03c3<\/em> and proceeded as before to calculate a <span id=\"term153\" data-type=\"term\">confidence interval<\/span> with close enough results. However, statisticians ran into problems when the sample size was small. A small sample size caused inaccuracies in the confidence interval.<\/p>\n<p id=\"element-643\">William S. Goset (1876\u20131937) of the Guinness brewery in Dublin, Ireland ran into this problem. His experiments with hops and barley produced very few samples. Just replacing <em data-effect=\"italics\">\u03c3<\/em> with <em data-effect=\"italics\">s<\/em> did not produce accurate results when he tried to calculate a confidence interval. He realized that he could not use a normal distribution for the calculation; he found that the actual distribution depends on the sample size. This problem led him to &#8220;discover&#8221; what is called the <span id=\"term154\" data-type=\"term\">Student&#8217;s t-distribution<\/span>. The name comes from the fact that Gosset wrote under the pen name &#8220;Student.&#8221;<\/p>\n<p id=\"eip-254\">Up until the mid-1970s, some statisticians used the <span id=\"term155\" data-type=\"term\">normal distribution<\/span> approximation for large sample sizes and used the Student&#8217;s t-distribution only for sample sizes of at most 30. With graphing calculators and computers, the practice now is to use the Student&#8217;s t-distribution whenever <em data-effect=\"italics\">s<\/em> is used as an estimate for <em data-effect=\"italics\">\u03c3<\/em>.<\/p>\n<p>If you draw a simple random sample of size <em data-effect=\"italics\">n<\/em> from a population that has an approximately normal distribution with mean <em data-effect=\"italics\">\u03bc<\/em> and unknown population standard deviation <em data-effect=\"italics\">\u03c3<\/em> and calculate the <em data-effect=\"italics\">t<\/em>-score $$t=\\frac{\\bar x &#8211; \\mu}{s\/\\sqrt{n}}$$ then the <em data-effect=\"italics\">t<\/em>-scores follow a <strong>Student&#8217;s t-distribution with <em data-effect=\"italics\">n<\/em> \u2013 1 degrees of freedom<\/strong>. The <em data-effect=\"italics\">t<\/em>-score has the same interpretation as the <span id=\"term156\" data-type=\"term\"><em data-effect=\"italics\">z<\/em>-score<\/span>. It measures how far $ \\bar x$ is from its mean <em data-effect=\"italics\">\u03bc<\/em>. For each sample size <em data-effect=\"italics\">n<\/em>, there is a different Student&#8217;s t-distribution.<\/p>\n<p id=\"eip-490\">The <span id=\"term157\" data-type=\"term\">degrees of freedom<\/span>, <strong><em data-effect=\"italics\">n<\/em> \u2013 1<\/strong>, come from the calculation of the sample standard deviation <strong><em data-effect=\"italics\">s<\/em><\/strong>.\u00a0 <strong>We call the number <em data-effect=\"italics\">n<\/em> \u2013 1 the degrees of freedom (df).<\/strong><\/p>\n<div id=\"eip-418\" data-type=\"list\">\n<div id=\"1\" data-type=\"title\">Properties of the Student&#8217;s t-Distribution<\/div>\n<ul>\n<li>The graph for the Student&#8217;s t-distribution is similar to the standard normal curve.<\/li>\n<li>The mean for the Student&#8217;s t-distribution is zero and the distribution is symmetric about zero.<\/li>\n<li>The Student&#8217;s t-distribution has more probability in its tails than the standard normal distribution because the spread of the t-distribution is greater than the spread of the standard normal. So the graph of the Student&#8217;s t-distribution will be thicker in the tails and shorter in the center than the graph of the standard normal distribution.<\/li>\n<li>The exact shape of the Student&#8217;s t-distribution depends on the degrees of freedom. As the degrees of freedom increases, the graph of Student&#8217;s t-distribution becomes more like the graph of the standard normal distribution.<\/li>\n<li>The underlying population of individual observations is assumed to be normally distributed with unknown population mean <em data-effect=\"italics\">\u03bc<\/em> and unknown population standard deviation <em data-effect=\"italics\">\u03c3<\/em>. The size of the underlying population is generally not relevant unless it is very small. If it is bell shaped (normal) then the assumption is met and doesn&#8217;t need discussion. Random sampling is assumed, but that is a completely separate assumption from normality.<\/li>\n<\/ul>\n<div class=\"textbox spreadsheet\">\n<h3>Google Sheets<\/h3>\n<p>Calculators and computers can easily calculate any Student&#8217;s t-probabilities. Google Sheets has the <code><a href=\"https:\/\/support.google.com\/docs\/answer\/9369014?hl=en\" target=\"_blank\" rel=\"noopener noreferrer\">T.DIST<\/a><\/code> function (along with <code>T.DIST.2T<\/code> and <code>T.DIST.RT<\/code> explained in a later chapter ) to find the probability for given values of <em data-effect=\"italics\">t<\/em>. The grammar for the <code>T.DIST<\/code> command is <code>T.DIST(x, degrees of freedom, cumulative?)<\/code>. However for confidence intervals, we need to use <strong>inverse<\/strong> probability to find the value of <em data-effect=\"italics\">t<\/em> when we know the probability.<\/p>\n<p>For Google Sheets, you can use the <code>T.INV<\/code> function. The <code>T.INV<\/code> function works similarly to the <code>NORM.INV<\/code> function. The <code>T.INV<\/code> function requires two inputs:<strong> T.INV(area to the left, degrees of freedom)<\/strong> The output is the t-score that corresponds to the area we specified.<\/p>\n<p>&nbsp;<\/p>\n<\/div>\n<\/div>\n<p id=\"eip-647\">A <a href=\"https:\/\/textbooks.jaykesler.net\/introstats\/back-matter\/student-t-distribution\/\" target=\"_blank\" rel=\"noopener noreferrer\">probability table for the Student&#8217;s t-distribution<\/a> can also be used. The table gives t-scores that correspond to the confidence level (column) and degrees of freedom (row). <span data-type=\"newline\"><br \/>\n<\/span><\/p>\n<p><span data-type=\"newline\"><br \/>\n<\/span>A Student&#8217;s t table gives <em data-effect=\"italics\">t<\/em>-scores given the degrees of freedom and the right-tailed probability. The table is very limited. <strong>Spreadsheets can easily calculate any Student&#8217;s t-probabilities.<\/strong><span data-type=\"newline\"><br \/>\n<\/span><\/p>\n<div id=\"eip-752\" data-type=\"list\">\n<div id=\"2\" data-type=\"title\"><strong>The notation for the Student&#8217;s t-distribution (using <em data-effect=\"italics\">T<\/em> as the random variable) is:<\/strong><\/div>\n<ul>\n<li><em data-effect=\"italics\">T ~ t<sub>df<\/sub><\/em> where <em data-effect=\"italics\">df<\/em> = <em data-effect=\"italics\">n<\/em> \u2013 1.<\/li>\n<li>For example, if we have a sample of size <em data-effect=\"italics\">n<\/em> = 20 items, then we calculate the degrees of freedom as <em data-effect=\"italics\">df<\/em> = <em data-effect=\"italics\">n<\/em> &#8211; 1 = 20 &#8211; 1 = 19 and we write the distribution as <em data-effect=\"italics\">T ~ t<sub>19<\/sub><\/em>.<\/li>\n<\/ul>\n<\/div>\n<p id=\"eip-737\"><strong>If the population standard deviation is not known<\/strong>, the <span id=\"term158\" data-type=\"term\">error bound for a population mean<\/span> is:<\/p>\n<ul id=\"eip-168\">\n<li>$E = t_{\\alpha\/2}\\cdot\\frac{s}{\\sqrt{n}}$<\/li>\n<li>$t_{\\alpha\/2}$ is the $t$-score with an area to the right equal to $\\frac{\\alpha}{2}$<br \/>\nNote that the <code>T.INV<\/code> function in a spreadsheet expects to be given a probability <span style=\"text-decoration: underline;\">to the left<\/span>. Since $t_{\\alpha\/2}$ is the $t$-score with an area <span style=\"text-decoration: underline;\">to the right<\/span>, we simply give the T.INV function the value $1-\\alpha\/2$.<\/li>\n<li>use <em data-effect=\"italics\">df<\/em> = <em data-effect=\"italics\">n<\/em> \u2013 1 degrees of freedom, and<\/li>\n<li><em data-effect=\"italics\">s<\/em> = sample standard deviation.<\/li>\n<\/ul>\n<p id=\"eip-819\"><strong>The format for the confidence interval is:<br \/>\n<\/strong>$(\\bar x &#8211; E, \\bar x + E)$<\/p>\n<div id=\"eip-51\" class=\"ui-has-child-title\" data-type=\"example\">\n<header>\n<h3 class=\"os-title\"><span class=\"os-title-label\">Example <\/span><span class=\"os-number\">7.8<\/span><\/h3>\n<\/header>\n<section>\n<div class=\"body\">\n<div id=\"element-632\" class=\"unnumbered\" data-type=\"exercise\">\n<header><\/header>\n<section>\n<div id=\"id1171101195216\" data-type=\"problem\">\n<div class=\"os-problem-container\">\n<p id=\"element-866\">Suppose you do a study of acupuncture to determine how effective it is in relieving pain. You measure sensory rates for 15 subjects with the results given. Use the sample data to construct a 95% confidence interval for the mean sensory rate for the population (assumed normal) from which you took the data.<\/p>\n<p>&nbsp;<\/p>\n<div id=\"id1171109556457\"><span id=\"set-328\" data-type=\"list\" data-list-type=\"labeled-item\" data-display=\"inline\">8.6; 9.4; 7.9; 6.8; 8.3; 7.3; 9.2; 9.6; 8.7; 11.4; 10.3; 5.4; 8.1; 5.5; 6.9<\/span><\/div>\n<\/div>\n<\/div>\n<div id=\"id1171108330127\" data-type=\"solution\" aria-label=\"show solution\" aria-expanded=\"false\">\n<div class=\"ui-toggle-wrapper\"><\/div>\n<section class=\"ui-body\" style=\"display: block; overflow: hidden;\" role=\"alert\">\n<h4 data-type=\"solution-title\"><span class=\"os-title-label\">Solution <\/span><span class=\"os-number\">7.8<\/span><\/h4>\n<div class=\"os-solution-container\">\n<div class=\"textbox spreadsheet\">\n<h3>Google Sheets<\/h3>\n<p>If you copy the data from the problem into a spreadsheet, including the semi-colons, all data will be placed into a single cell which makes calculations (like the mean, standard deviation, etc) on the data difficult. Instead, use the Split Text to Columns functionality so each data point will be in a separate cell. Then use <code>AVERAGE<\/code> and <code>STDEV.S<\/code> functions to calculate the mean and standard deviation of the data.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-549\" src=\"https:\/\/textbooks.jaykesler.net\/introstats\/wp-content\/uploads\/sites\/2\/2021\/01\/SplitTextToColumns.png\" alt=\"Screenshot of Google Sheets showing menu with &quot;split text to columns&quot; option\" width=\"620\" height=\"668\" \/><\/p>\n<\/div>\n<p>To find the confidence interval, you need the sample mean, $\\bar x$, and the margin of error, <em data-effect=\"italics\"> E <\/em>. First, use a spreadsheet to calculate the mean, standard deviation, and note the $n=15$.<\/p>\n<p>$\\bar x = 8.2267, ~~s=1.6722, ~~n=15$<\/p>\n<p id=\"element-152\"><em data-effect=\"italics\">df<\/em> = 15 \u2013 1 = 14 <em data-effect=\"italics\">CL<\/em> so <em data-effect=\"italics\">\u03b1<\/em> = 1 \u2013 <em data-effect=\"italics\">CL<\/em> = 1 \u2013 0.95 = 0.05<\/p>\n<p>$\\alpha=0.05$, so $t_{\\alpha\/2} = t_{0.025}$<\/p>\n<p>The area to the right of <em data-effect=\"italics\">t<\/em><sub>0.025<\/sub> is 0.025<\/p>\n<p>$t_{\\alpha\/2} = t_{0.025}=2.14$ using <code>T.INV(0.975,14)<\/code> on a spreadsheet.<\/p>\n<p>$E = t_{\\alpha\/2} \\cdot \\frac{s}{\\sqrt{n}}=2.14\\cdot \\frac{1.6722}{\\sqrt{15}}$<\/p>\n<p>$\\bar x &#8211; E = 8.267-0.924 = 7.3$<\/p>\n<p>$\\bar x +E 8.267+0.924=9.15$<\/p>\n<p>The 95% confidence interval is (7.3, 9.15).<\/p>\n<p id=\"element-273\">We estimate with 95% confidence that the true population mean sensory rate is between 7.30 and 9.15.<\/p>\n<\/div>\n<\/section>\n<\/div>\n<div id=\"fs-idp148096976\" data-type=\"solution\" aria-label=\"show solution\" aria-expanded=\"false\">\n<section class=\"ui-body\" style=\"display: block; overflow: hidden;\" role=\"alert\">\n<div class=\"os-solution-container\">\n<div id=\"eip-406\" class=\"ui-has-child-title\" data-type=\"note\" data-has-label=\"true\" data-label=\"\">\n<header>\n<h3 class=\"os-title\" data-type=\"title\"><span id=\"15\" class=\"os-title-label\" data-type=\"\">Note<\/span><\/h3>\n<\/header>\n<section>\n<div class=\"os-note-body\">\n<p id=\"fs-idm137079696\">When calculating the margin of error, <a href=\"https:\/\/textbooks.jaykesler.net\/introstats\/back-matter\/student-t-distribution\/\" target=\"_blank\" rel=\"noopener noreferrer\">a probability table for the Student&#8217;s t-distribution<\/a> can also be used to find the value of <em data-effect=\"italics\">t<\/em>. The table gives <em data-effect=\"italics\">t<\/em>-scores that correspond to the confidence level (column) and degrees of freedom (row); the <em data-effect=\"italics\">t<\/em>-score is found where the row and column intersect in the table.<\/p>\n<\/div>\n<\/section>\n<\/div>\n<\/div>\n<\/section>\n<\/div>\n<\/section>\n<\/div>\n<\/div>\n<\/section>\n<\/div>\n<div id=\"fs-idm181001040\" class=\"statistics try ui-has-child-title\" data-type=\"note\" data-has-label=\"true\" data-label=\"\">\n<header>\n<h3 class=\"os-title\"><span class=\"os-title-label\">Try It <\/span><span class=\"os-number\">7.8<\/span><\/h3>\n<\/header>\n<section>\n<div id=\"eip-496\" class=\"unnumbered\" data-type=\"exercise\">\n<header><\/header>\n<section>\n<div id=\"eip-247\" data-type=\"problem\">\n<div class=\"os-problem-container\">\n<p id=\"eip-331\">You do a study of hypnotherapy to determine how effective it is in increasing the number of hours of sleep subjects get each night. You measure hours of sleep for 12 subjects with the following results. Construct a 95% confidence interval for the mean number of hours slept for the population (assumed normal) from which you took the data.<\/p>\n<p id=\"eip-idm108202576\">8.2; 9.1; 7.7; 8.6; 6.9; 11.2; 10.1; 9.9; 8.9; 9.2; 7.5; 10.5<\/p>\n<\/div>\n<\/div>\n<\/section>\n<\/div>\n<\/section>\n<\/div>\n<div id=\"eip-804\" class=\"ui-has-child-title\" data-type=\"example\">\n<header>\n<h3 class=\"os-title\"><span class=\"os-title-label\">Example <\/span><span class=\"os-number\">7.9<\/span><\/h3>\n<\/header>\n<section>\n<div class=\"body\">\n<div id=\"eip-821\" class=\"unnumbered\" data-type=\"exercise\">\n<header><\/header>\n<section>\n<div id=\"eip-957\" data-type=\"problem\">\n<div class=\"os-problem-container\">\n<p id=\"eip-645\">The Human Toxome Project (HTP) is working to understand the scope of industrial pollution in the human body. Industrial chemicals may enter the body through pollution or as ingredients in consumer products. In October 2008, the scientists at HTP tested cord blood samples for 20 newborn infants in the United States. The cord blood of the &#8220;In utero\/newborn&#8221; group was tested for 430 industrial compounds, pollutants, and other chemicals, including chemicals linked to brain and nervous system toxicity, immune system toxicity, and reproductive toxicity, and fertility problems. There are health concerns about the effects of some chemicals on the brain and nervous system. <a class=\"autogenerated-content\" href=\"#eip-222\">Table 7.3<\/a> below shows how many of the targeted chemicals were found in each infant\u2019s cord blood.<\/p>\n<div id=\"eip-222\" class=\"os-table\">\n<table summary=\"Table 7.3\" data-id=\"eip-222\">\n<tbody>\n<tr>\n<td>79<\/td>\n<td>145<\/td>\n<td>147<\/td>\n<td>160<\/td>\n<td>116<\/td>\n<td>100<\/td>\n<td>159<\/td>\n<td>151<\/td>\n<td>156<\/td>\n<td>126<\/td>\n<\/tr>\n<tr>\n<td>137<\/td>\n<td>83<\/td>\n<td>156<\/td>\n<td>94<\/td>\n<td>121<\/td>\n<td>144<\/td>\n<td>123<\/td>\n<td>114<\/td>\n<td>139<\/td>\n<td>99<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<div class=\"os-caption-container\"><span class=\"os-title-label\">Table <\/span><span class=\"os-number\">7.3<\/span><\/div>\n<\/div>\n<p id=\"eip-idp159676448\">Use this sample data to construct a 90% confidence interval for the mean number of targeted industrial chemicals to be found in an in infant\u2019s blood.<\/p>\n<\/div>\n<\/div>\n<div id=\"eip-262\" data-type=\"solution\" data-label=\"\" aria-label=\"show solution\" aria-expanded=\"false\">\n<div class=\"ui-toggle-wrapper\"><\/div>\n<section class=\"ui-body\" style=\"display: block; overflow: hidden;\" role=\"alert\">\n<h4 data-type=\"solution-title\"><span class=\"os-title-label\">Solution <\/span><span class=\"os-number\">7.9<\/span><\/h4>\n<div class=\"os-solution-container\">\n<p>From the sample, you can calculate $\\bar x = 127.45$ and $s=25.965$. There are 20 infants in the sample, so <em data-effect=\"italics\">n<\/em> = 20, and <em data-effect=\"italics\">df<\/em> = 20 \u2013 1 = 19.<\/p>\n<p id=\"eip-idm108372720\">You are asked to calculate a 90% confidence interval: <em data-effect=\"italics\">CL<\/em> = 0.90, so <em data-effect=\"italics\">\u03b1<\/em> = 1 \u2013 <em data-effect=\"italics\">CL<\/em> = 1 \u2013 0.90 = 0.10<br \/>\n$\\frac{\\alpha}{2} = 0.05$ so $t_{\\alpha\/2}=t_{0.05}$<\/p>\n<p>By definition, the area to the right of <em data-effect=\"italics\">t<\/em><sub>0.05<\/sub> is 0.05 and so the area to the left of <em data-effect=\"italics\">t<\/em><sub>0.05<\/sub> is 1 \u2013 0.05 = 0.95.<\/p>\n<p id=\"eip-idm38662128\" class=\"finger\">Use a table, calculator, or computer to find that <em data-effect=\"italics\">t<\/em><sub>0.05<\/sub> = 1.729. In Google Sheets, use <code>T.INV(0.95, 19).<\/code><\/p>\n<p>$E = t_{\\alpha\/2} \\cdot \\frac{s}{\\sqrt{n}} = 1.729 \\cdot \\frac{25.965}{\\sqrt{20}} = 10.038$<\/p>\n<p>$\\bar x &#8211; E = 127.45-10.038 = 117.412$<\/p>\n<p>$\\bar x + E = 127.45+10.038 = 137.488$<\/p>\n<p>We estimate with 90% confidence that the mean number of all targeted industrial chemicals found in cord blood in the United States is between 117.412 and 137.488.<\/p>\n<\/div>\n<\/section>\n<\/div>\n<div id=\"fs-idp111080464\" data-type=\"solution\" data-label=\"\" aria-label=\"show solution\" aria-expanded=\"false\">\n<div class=\"ui-toggle-wrapper\"><\/div>\n<\/div>\n<\/section>\n<\/div>\n<\/div>\n<\/section>\n<\/div>\n<div id=\"fs-idm12320384\" class=\"statistics try ui-has-child-title\" data-type=\"note\" data-has-label=\"true\" data-label=\"\">\n<header>\n<h3 class=\"os-title\"><span class=\"os-title-label\">Try It <\/span><span class=\"os-number\">7.9<\/span><\/h3>\n<\/header>\n<section>\n<div id=\"eip-467\" class=\"unnumbered\" data-type=\"exercise\">\n<header><\/header>\n<section>\n<div id=\"eip-272\" data-type=\"problem\">\n<div class=\"os-problem-container\">\n<p id=\"eip-636\">A random sample of statistics students were asked to estimate the total number of hours they spend watching television in an average week. The responses are recorded in <a class=\"autogenerated-content\" href=\"#eip-672\">Table 7.4<\/a> below. Use this sample data to construct a 98% confidence interval for the mean number of hours statistics students will spend watching television in one week.<\/p>\n<div id=\"eip-672\" class=\"os-table\">\n<table summary=\"Table 7.4\" data-id=\"eip-672\">\n<tbody>\n<tr>\n<td>0<\/td>\n<td>3<\/td>\n<td>1<\/td>\n<td>20<\/td>\n<td>9<\/td>\n<\/tr>\n<tr>\n<td>5<\/td>\n<td>10<\/td>\n<td>1<\/td>\n<td>10<\/td>\n<td>4<\/td>\n<\/tr>\n<tr>\n<td>14<\/td>\n<td>2<\/td>\n<td>4<\/td>\n<td>4<\/td>\n<td>5<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<div class=\"os-caption-container\"><span class=\"os-title-label\">Table <\/span><span class=\"os-number\">7.4<\/span><\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/section>\n<\/div>\n<\/section>\n<\/div>\n<\/div>\n","protected":false},"author":1,"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-68","chapter","type-chapter","status-publish","hentry"],"part":65,"_links":{"self":[{"href":"https:\/\/textbooks.jaykesler.net\/introstats\/wp-json\/pressbooks\/v2\/chapters\/68","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/textbooks.jaykesler.net\/introstats\/wp-json\/pressbooks\/v2\/chapters"}],"about":[{"href":"https:\/\/textbooks.jaykesler.net\/introstats\/wp-json\/wp\/v2\/types\/chapter"}],"author":[{"embeddable":true,"href":"https:\/\/textbooks.jaykesler.net\/introstats\/wp-json\/wp\/v2\/users\/1"}],"version-history":[{"count":6,"href":"https:\/\/textbooks.jaykesler.net\/introstats\/wp-json\/pressbooks\/v2\/chapters\/68\/revisions"}],"predecessor-version":[{"id":530,"href":"https:\/\/textbooks.jaykesler.net\/introstats\/wp-json\/pressbooks\/v2\/chapters\/68\/revisions\/530"}],"part":[{"href":"https:\/\/textbooks.jaykesler.net\/introstats\/wp-json\/pressbooks\/v2\/parts\/65"}],"metadata":[{"href":"https:\/\/textbooks.jaykesler.net\/introstats\/wp-json\/pressbooks\/v2\/chapters\/68\/metadata\/"}],"wp:attachment":[{"href":"https:\/\/textbooks.jaykesler.net\/introstats\/wp-json\/wp\/v2\/media?parent=68"}],"wp:term":[{"taxonomy":"chapter-type","embeddable":true,"href":"https:\/\/textbooks.jaykesler.net\/introstats\/wp-json\/pressbooks\/v2\/chapter-type?post=68"},{"taxonomy":"contributor","embeddable":true,"href":"https:\/\/textbooks.jaykesler.net\/introstats\/wp-json\/wp\/v2\/contributor?post=68"},{"taxonomy":"license","embeddable":true,"href":"https:\/\/textbooks.jaykesler.net\/introstats\/wp-json\/wp\/v2\/license?post=68"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}