{"id":307,"date":"2021-07-14T15:59:11","date_gmt":"2021-07-14T15:59:11","guid":{"rendered":"https:\/\/courses.lumenlearning.com\/introstatscorequisite\/chapter\/the-regression-equation\/"},"modified":"2023-12-05T09:46:24","modified_gmt":"2023-12-05T09:46:24","slug":"the-regression-equation","status":"publish","type":"chapter","link":"https:\/\/courses.lumenlearning.com\/introstatscorequisite\/chapter\/the-regression-equation\/","title":{"raw":"Creating the Least-Squares Regression Equation","rendered":"Creating the Least-Squares Regression Equation"},"content":{"raw":"<div class=\"textbox learning-objectives\">\r\n<h3>Learning Outcomes<\/h3>\r\n<section>\r\n<ul>\r\n \t<li>Find the equation of the least-squares regression line using technology<\/li>\r\n \t<li>Interpret the slope and y-intercept of a least-squares regression line<\/li>\r\n<\/ul>\r\n<\/section><\/div>\r\nData rarely fit a straight line exactly. Usually, you must be satisfied with rough predictions. Typically, you have a set of data whose scatter plot appears to \"fit\" a straight line. This is called a\u00a0<strong>Line of Best Fit<\/strong> or <strong>Least-Squares Line<\/strong>.\r\n<div class=\"textbox tryit\"><header>\r\n<h3 class=\"title\" data-type=\"title\">Activity<\/h3>\r\n<\/header>If you know a person's pinky (smallest) finger length, do you think you could predict that person's height? Collect data from your class (pinky finger length, in inches). The independent variable,\u00a0<em data-effect=\"italics\">x<\/em>, is pinky finger length, and the dependent variable,\u00a0<em data-effect=\"italics\">y<\/em>, is height. For each set of data, plot the points on graph paper. Make your graph big enough and\u00a0<strong>use a ruler<\/strong>. Then \"by eye\" draw a line that appears to \"fit\" the data. For your line, pick two convenient points and use them to find the slope of the line. Find the\u00a0<em data-effect=\"italics\">y<\/em>-intercept of the line by extending your line so it crosses the\u00a0<em data-effect=\"italics\">y<\/em>-axis. Using the slopes and the\u00a0<em data-effect=\"italics\">y<\/em>-intercepts, write your equation of \"best fit.\" Do you think everyone will have the same equation? Why or why not? According to your equation, what is the predicted height for a pinky length of 2.5 inches?\r\n\r\n<\/div>\r\n<div class=\"textbox exercises\">\r\n<h3>Example 1<\/h3>\r\nA random sample of 11 statistics students produced the following data, where\u00a0<em>x<\/em> is the third exam score out of 80, and <em>y<\/em> is the final exam score out of 200. Can you predict the final exam score of a random student if you know the third exam score?\r\n<table>\r\n<thead>\r\n<tr>\r\n<th>x (third exam score)<\/th>\r\n<th>y (final exam score)<\/th>\r\n<\/tr>\r\n<\/thead>\r\n<tbody>\r\n<tr>\r\n<td>65<\/td>\r\n<td>175<\/td>\r\n<\/tr>\r\n<tr>\r\n<td>67<\/td>\r\n<td>133<\/td>\r\n<\/tr>\r\n<tr>\r\n<td>71<\/td>\r\n<td>185<\/td>\r\n<\/tr>\r\n<tr>\r\n<td>71<\/td>\r\n<td>163<\/td>\r\n<\/tr>\r\n<tr>\r\n<td>66<\/td>\r\n<td>126<\/td>\r\n<\/tr>\r\n<tr>\r\n<td>75<\/td>\r\n<td>198<\/td>\r\n<\/tr>\r\n<tr>\r\n<td>67<\/td>\r\n<td>153<\/td>\r\n<\/tr>\r\n<tr>\r\n<td>70<\/td>\r\n<td>163<\/td>\r\n<\/tr>\r\n<tr>\r\n<td>71<\/td>\r\n<td>159<\/td>\r\n<\/tr>\r\n<tr>\r\n<td>69<\/td>\r\n<td>151<\/td>\r\n<\/tr>\r\n<tr>\r\n<td>69<\/td>\r\n<td>159<\/td>\r\n<\/tr>\r\n<\/tbody>\r\n<\/table>\r\nTable showing the scores on the final exam based on scores from the third exam.\r\n\r\n<img class=\"aligncenter wp-image-2299 size-full\" src=\"https:\/\/s3-us-west-2.amazonaws.com\/courses-images\/wp-content\/uploads\/sites\/5668\/2021\/07\/11151311\/1b03001ef7ab9a550343ffaee913db0941338dd2.jpeg\" alt=\"This is a scatter plot of the data provided. The third exam score is plotted on the x-axis, and the final exam score is plotted on the y-axis. The points form a strong, positive, linear pattern.\" width=\"487\" height=\"317\" \/>\r\n\r\nScatter plot showing the scores on the final exam based on scores from the third exam.\r\n\r\n<\/div>\r\n<div class=\"textbox key-takeaways\">\r\n<h3>try it 1<\/h3>\r\nScuba divers have maximum dive times they cannot exceed when going to different depths. The data in the table below show different depths with the maximum dive times in minutes. Use your calculator to find the least-squares regression line and predict the maximum dive time for 110 feet.\r\n<table>\r\n<thead>\r\n<tr>\r\n<th><em>X<\/em> (depth in feet)<\/th>\r\n<th><em>Y<\/em> (maximum dive time)<\/th>\r\n<\/tr>\r\n<\/thead>\r\n<tbody>\r\n<tr>\r\n<td>50<\/td>\r\n<td>80<\/td>\r\n<\/tr>\r\n<tr>\r\n<td>60<\/td>\r\n<td>55<\/td>\r\n<\/tr>\r\n<tr>\r\n<td>70<\/td>\r\n<td>45<\/td>\r\n<\/tr>\r\n<tr>\r\n<td>80<\/td>\r\n<td>35<\/td>\r\n<\/tr>\r\n<tr>\r\n<td>90<\/td>\r\n<td>25<\/td>\r\n<\/tr>\r\n<tr>\r\n<td>100<\/td>\r\n<td>22<\/td>\r\n<\/tr>\r\n<\/tbody>\r\n<\/table>\r\n[reveal-answer q=\"605447\"]Show Answer[\/reveal-answer]\r\n[hidden-answer a=\"605447\"]\r\n\r\n[latex]\\displaystyle\\hat{{y}}={127.24}-{1.11}{x}[\/latex]\r\n\r\nAt 110 feet, a diver could dive for only five minutes.\r\n\r\n[\/hidden-answer]\r\n\r\n<\/div>\r\nThe third exam score,\u00a0<em>x<\/em>, is the independent variable and the final exam score, <em>y<\/em>, is the dependent variable. We will plot a regression line that best \"fits\" the data. If each of you were to fit a line \"by eye,\" you would draw different lines. We can use what is called a\u00a0<strong>least-squares regression line<\/strong> to obtain the best-fit line.\r\n\r\nConsider the following diagram. Each point of data is of the form (<em>x<\/em>, <em>y<\/em>) and each point of the line of best fit using least-squares linear regression has the form [latex]\\left ( x, {\\hat y} \\right )[\/latex].\r\n\r\nThe\u00a0[latex]\\displaystyle\\hat{{y}}[\/latex] is read \"<strong><em data-redactor-tag=\"em\">y<\/em> hat<\/strong>\" and is the\u00a0<strong>estimated value of <\/strong><em><strong data-redactor-tag=\"strong\">y<\/strong><\/em>. It is the value of <em>y<\/em> obtained using the regression line. It is not generally equal to <em>y<\/em> from data.\r\n\r\n<img class=\"aligncenter wp-image-2300 size-full\" src=\"https:\/\/s3-us-west-2.amazonaws.com\/courses-images\/wp-content\/uploads\/sites\/5668\/2021\/07\/11151354\/6be87cc77483ecafa6709b1ac0da826854ddb3ca.jpeg\" alt=\"The scatter plot of exam scores with a line of best fit. One data point is highlighted along with the corresponding point on the line of best fit. Both points have the same x-coordinate. The distance between these two points illustrates how to compute the sum of squared errors.\" width=\"731\" height=\"324\" \/>\r\n\r\nThe term\u00a0[latex]\\displaystyle{y}_{0}-\\hat{y}_{0}={\\epsilon}_{0}[\/latex] is called the \"<strong>error<\/strong>\" or <strong>residual<\/strong>. It is not an error in the sense of a mistake. The <strong>absolute value of a residual<\/strong> measures the vertical distance between the actual value of <em>y<\/em> and the estimated value of <em>y<\/em>. In other words, it measures the vertical distance between the actual data point and the predicted point on the line.\r\n\r\nIf the observed data point lies above the line, the residual is positive, and the line underestimates the actual data value for\u00a0<em>y<\/em>. If the observed data point lies below the line, the residual is negative, and the line overestimates that actual data value for <em>y<\/em>.\r\n\r\nIn the diagram above,\u00a0[latex]\\displaystyle{y}_{0}-\\hat{y}_{0}={\\epsilon}_{0}[\/latex] is the residual for the point shown. Here the point lies above the line and the residual is positive.\r\n\r\n<em>\u03b5<\/em> = the Greek letter <strong>epsilon<\/strong>\r\n\r\nFor each data point, you can calculate the residuals or errors,\r\n[latex]\\displaystyle{y}_{i}-\\hat{y}_{i}={\\epsilon}_{i}[\/latex] for <em>i<\/em> = 1, 2, 3, ..., 11.\r\n\r\nEach |<em>\u03b5<\/em>| is a vertical distance.\r\n\r\nFor the example about the third exam scores and the final exam scores for the 11 statistics students, there are 11 data points. Therefore, there are 11\u00a0<em>\u03b5<\/em> values. If you square each \u03b5 and add, you get\r\n\r\n[latex]\\displaystyle{({\\epsilon}_{{1}})}^{{2}}+{({\\epsilon}_{{2}})}^{{2}}+\\ldots+{({\\epsilon}_{{11}})}^{{2}}={\\stackrel{{11}}{{\\stackrel{\\sum}{{{}_{{{i}={1}}}}}}}}{\\epsilon}^{{2}}[\/latex]\r\n\r\nThis is called the\u00a0<strong>Sum of Squared Errors (SSE)<\/strong>.\r\n\r\nUsing calculus, you can determine the values of\u00a0<em>a<\/em> and <em>b<\/em> that make the <strong>SSE<\/strong> a minimum. When you make the <strong>SSE<\/strong> a minimum, you have determined the points that are on the line of best fit. It turns out that the line of best fit has the equation:\r\n<p style=\"text-align: center;\">[latex]\\displaystyle\\hat{{y}}={a}+{b}{x}[\/latex]<\/p>\r\nwhere\r\n[latex]\\displaystyle{a}=\\overline{y}-{b}\\overline{{x}}[\/latex]\r\n\r\nand\r\n\r\n[latex]{b}=\\dfrac{{\\sum{({x}-\\overline{{x}})}{({y}-\\overline{{y}})}}}{{\\sum{({x}-\\overline{{x}})}^{{2}}}}[\/latex].\r\n\r\nThe sample means of the\u00a0<em>x<\/em> values and the <em>y<\/em> values are [latex]\\displaystyle\\overline{{x}}[\/latex] and [latex]\\overline{{y}}[\/latex].\u00a0The best-fit line always passes through the point [latex]\\left ({\\overline x},{\\overline y} \\right )[\/latex].\r\n\r\nThe slope\u00a0<em>b<\/em> can be written as [latex]\\displaystyle{b}={r}{\\left(\\dfrac{{s}_{{y}}}{{s}_{{x}}}\\right)}[\/latex] where <em>s<\/em><em><sub data-redactor-tag=\"sub\">y<\/sub><\/em> = the standard deviation of the\u00a0<em>y<\/em> values and <em>s<\/em><em><sub data-redactor-tag=\"sub\">x<\/sub><\/em> = the standard deviation of the <em>x<\/em> values. <em>r<\/em> is the correlation coefficient, which is discussed in the next section.\r\n<h2>Least Squares Criteria for Best Fit<\/h2>\r\nThe process of fitting the best-fit line is called\u00a0<strong>linear regression<\/strong>. The idea behind finding the best-fit line is based on the assumption that the data are scattered about a straight line. The criteria for the best-fit line is that the sum of the squared errors (SSE) is minimized, that is, made as small as possible. Any other line you might choose would have a higher SSE than the best-fit line. This best-fit line is called the <strong>least-squares regression line<\/strong>.\r\n<h4>Note<\/h4>\r\nComputer spreadsheets, statistical software, and many calculators can quickly calculate the best-fit line and create the graphs. The calculations tend to be tedious if done by hand. Instructions to use the TI-83, TI-83+, and TI-84+ calculators to find the best-fit line and create a scatterplot are shown at the end of this section.\r\n<div class=\"textbox exercises\">\r\n<h3>Example 2<\/h3>\r\n<h2>Third Exam vs Final Exam Example<\/h2>\r\nThe graph of the line of best fit for the third-exam\/final-exam example is as follows:\r\n\r\n<img class=\"aligncenter wp-image-2301 size-full\" src=\"https:\/\/s3-us-west-2.amazonaws.com\/courses-images\/wp-content\/uploads\/sites\/5668\/2021\/07\/11151504\/4c0ec8eccde173c8ad29ac66b1a5e9bb10b6e8d1.jpeg\" alt=\"The scatter plot of exam scores with a line of best fit. One data point is highlighted along with the corresponding point on the line of best fit.\" width=\"487\" height=\"312\" \/>\r\n\r\nThe least-squares regression line (best-fit line) for the third-exam\/final-exam example has the equation:\r\n<p style=\"text-align: center;\">[latex]\\displaystyle\\hat{{y}}=-{173.51}+{4.83}{x}[\/latex]<\/p>\r\n&nbsp;\r\n\r\n<strong>Remember,<\/strong> it is always important to plot a scatter diagram first. If the scatter plot indicates that there is a linear relationship between the variables, then it is reasonable to use a best-fit line to make predictions for <em>y<\/em> given <em>x<\/em> within the domain of <em>x<\/em>-values in the sample data, <strong>but not necessarily for <em data-redactor-tag=\"em\">x<\/em>-values outside that domain<\/strong>. You could use the line to predict the final exam score for a student who earned a grade of 73 on the third exam. You should NOT use the line to predict the final exam score for a student who earned a grade of 50 on the third exam, because 50 is not within the domain of the <em>x<\/em>-values in the sample data, which are between 65 and 75.\r\n\r\n<\/div>\r\n<h2>Understanding Slope<\/h2>\r\nThe slope of the line,\u00a0<em>b<\/em>, describes how changes in the variables are related. It is important to interpret the slope of the line in the context of the situation represented by the data. You should be able to write a sentence interpreting the slope in plain English.\r\n\r\n<strong>Interpretation of the Slope: <\/strong>The slope of the best-fit line tells us how the dependent variable (<em>y<\/em>) changes for every one-unit increase in the independent (<em>x<\/em>) variable, on average.\r\n\r\n<strong>For example 2:<\/strong>\r\n<ul>\r\n \t<li>Slope: The slope of the line is <em>b<\/em> = 4.83.<\/li>\r\n \t<li>Interpretation: For a one-point increase in the score on the third exam, the final exam score increases by 4.83 points, on average.<\/li>\r\n<\/ul>\r\n<header>\r\n<h2 class=\"os-title\" data-type=\"title\"><span class=\"os-title-label\">USING THE TI-83, 83+, 84, 84+ CALCULATOR<\/span><\/h2>\r\n<\/header>\r\n<h3>Using the Linear Regression T Test: LinRegTTest<\/h3>\r\n<ol>\r\n \t<li>In the STAT list editor, enter the X data in list L1 and the Y data in list L2, paired so that the corresponding (<em>x<\/em>,<em>y<\/em>) values are next to each other in the lists. (If a particular pair of values is repeated, enter it as many times as it appears in the data).<\/li>\r\n \t<li>On the STAT TESTS menu, scroll down with the cursor to select the LinRegTTest. (Be careful to select LinRegTTest, as some calculators may also have a different item called LinRegTInt).<\/li>\r\n \t<li>On the LinRegTTest input screen enter: Xlist: L1 ; Ylist: L2 ; Freq: 1<\/li>\r\n \t<li>On the next line, at the prompt <em>\u03b2<\/em> or <em>\u03c1<\/em>, highlight \"\u2260 0\" and press ENTER<\/li>\r\n \t<li>Leave the line for \"RegEq:\" blank<\/li>\r\n \t<li>Highlight Calculate and press ENTER.<\/li>\r\n<\/ol>\r\n<img class=\"aligncenter wp-image-2302 size-full\" src=\"https:\/\/s3-us-west-2.amazonaws.com\/courses-images\/wp-content\/uploads\/sites\/5668\/2021\/07\/11151634\/18649be8089fb2f8b0c2b567ff134a1f356fcd24.jpeg\" alt=\"1. Image of calculator input screen for LinRegTTest with input matching the instructions above. 2.Image of corresponding output calculator output screen for LinRegTTest: Output screen shows: Line 1. LinRegTTest; Line 2. y = a + bx; Line 3. beta does not equal 0 and rho does not equal 0; Line 4. t = 2.657560155; Line 5. df = 9; Line 6. a = \uf02d173.513363; Line 7. b = 4.827394209; Line 8. s = 16.41237711; Line 9. r squared = .4396931104; Line 10. r = .663093591\" width=\"487\" height=\"302\" \/>\r\n\r\nThe output screen contains a lot of information. For now, we will focus on a few items from the output and will return later to the other items.\r\n\r\nThe second line says\u00a0<em>y<\/em> = <em>a<\/em> + <em>bx<\/em>. Scroll down to find the values <em>a<\/em> = \u2013173.513, and <em>b<\/em> = 4.8273; the equation of the best-fit line is <em>\u0177<\/em> = \u2013173.51 + 4.83<em>x.<\/em>\r\n\r\nThe two items at the bottom are <em>r<\/em><sub>2<\/sub> = 0.43969 and <em>r<\/em> = 0.663. For now, just note where to find these values; we will discuss them in the next two sections.\r\n<h4>Graphing the Scatterplot and Regression Line<\/h4>\r\n<ol>\r\n \t<li>We are assuming your X data is already entered in list L1 and your Y data is in list L2<\/li>\r\n \t<li>Press 2nd STATPLOT ENTER to use Plot 1<\/li>\r\n \t<li>On the input screen for PLOT 1, highlight <strong>On<\/strong>, and press ENTER<\/li>\r\n \t<li>For TYPE: highlight the very first icon which is the scatterplot and press ENTER<\/li>\r\n \t<li>Indicate Xlist: L1 and Ylist: L2<\/li>\r\n \t<li>For Mark: it does not matter which symbol you highlight.<\/li>\r\n \t<li>Press the ZOOM key and then the number 9 (for menu item \"ZoomStat\") ; the calculator will fit the window to the data<\/li>\r\n \t<li>To graph the best-fit line, press the \"Y=\" key and type the equation \u2013173.5 + 4.83X into equation Y1. (The X key is immediately left of the STAT key). Press ZOOM 9 again to graph it.<\/li>\r\n \t<li>Optional: If you want to change the viewing window, press the WINDOW key. Enter your desired window using Xmin, Xmax, Ymin, Ymax<\/li>\r\n<\/ol>\r\n<h4>Note<\/h4>\r\nAnother way to graph the line after you create a scatter plot is to use LinRegTTest. Make sure you have done the scatter plot. Check it on your screen. Go to LinRegTTest and enter the lists. At RegEq: press VARS and arrow over to Y-VARS. Press 1 for 1:Function. Press 1 for 1:Y1. Then arrow down to Calculate and do the calculation for the line of best fit. Press Y = (you will see the regression equation). Press GRAPH. The line will be drawn.\"","rendered":"<div class=\"textbox learning-objectives\">\n<h3>Learning Outcomes<\/h3>\n<section>\n<ul>\n<li>Find the equation of the least-squares regression line using technology<\/li>\n<li>Interpret the slope and y-intercept of a least-squares regression line<\/li>\n<\/ul>\n<\/section>\n<\/div>\n<p>Data rarely fit a straight line exactly. Usually, you must be satisfied with rough predictions. Typically, you have a set of data whose scatter plot appears to &#8220;fit&#8221; a straight line. This is called a\u00a0<strong>Line of Best Fit<\/strong> or <strong>Least-Squares Line<\/strong>.<\/p>\n<div class=\"textbox tryit\">\n<header>\n<h3 class=\"title\" data-type=\"title\">Activity<\/h3>\n<\/header>\n<p>If you know a person&#8217;s pinky (smallest) finger length, do you think you could predict that person&#8217;s height? Collect data from your class (pinky finger length, in inches). The independent variable,\u00a0<em data-effect=\"italics\">x<\/em>, is pinky finger length, and the dependent variable,\u00a0<em data-effect=\"italics\">y<\/em>, is height. For each set of data, plot the points on graph paper. Make your graph big enough and\u00a0<strong>use a ruler<\/strong>. Then &#8220;by eye&#8221; draw a line that appears to &#8220;fit&#8221; the data. For your line, pick two convenient points and use them to find the slope of the line. Find the\u00a0<em data-effect=\"italics\">y<\/em>-intercept of the line by extending your line so it crosses the\u00a0<em data-effect=\"italics\">y<\/em>-axis. Using the slopes and the\u00a0<em data-effect=\"italics\">y<\/em>-intercepts, write your equation of &#8220;best fit.&#8221; Do you think everyone will have the same equation? Why or why not? According to your equation, what is the predicted height for a pinky length of 2.5 inches?<\/p>\n<\/div>\n<div class=\"textbox exercises\">\n<h3>Example 1<\/h3>\n<p>A random sample of 11 statistics students produced the following data, where\u00a0<em>x<\/em> is the third exam score out of 80, and <em>y<\/em> is the final exam score out of 200. Can you predict the final exam score of a random student if you know the third exam score?<\/p>\n<table>\n<thead>\n<tr>\n<th>x (third exam score)<\/th>\n<th>y (final exam score)<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>65<\/td>\n<td>175<\/td>\n<\/tr>\n<tr>\n<td>67<\/td>\n<td>133<\/td>\n<\/tr>\n<tr>\n<td>71<\/td>\n<td>185<\/td>\n<\/tr>\n<tr>\n<td>71<\/td>\n<td>163<\/td>\n<\/tr>\n<tr>\n<td>66<\/td>\n<td>126<\/td>\n<\/tr>\n<tr>\n<td>75<\/td>\n<td>198<\/td>\n<\/tr>\n<tr>\n<td>67<\/td>\n<td>153<\/td>\n<\/tr>\n<tr>\n<td>70<\/td>\n<td>163<\/td>\n<\/tr>\n<tr>\n<td>71<\/td>\n<td>159<\/td>\n<\/tr>\n<tr>\n<td>69<\/td>\n<td>151<\/td>\n<\/tr>\n<tr>\n<td>69<\/td>\n<td>159<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Table showing the scores on the final exam based on scores from the third exam.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-2299 size-full\" src=\"https:\/\/s3-us-west-2.amazonaws.com\/courses-images\/wp-content\/uploads\/sites\/5668\/2021\/07\/11151311\/1b03001ef7ab9a550343ffaee913db0941338dd2.jpeg\" alt=\"This is a scatter plot of the data provided. The third exam score is plotted on the x-axis, and the final exam score is plotted on the y-axis. The points form a strong, positive, linear pattern.\" width=\"487\" height=\"317\" \/><\/p>\n<p>Scatter plot showing the scores on the final exam based on scores from the third exam.<\/p>\n<\/div>\n<div class=\"textbox key-takeaways\">\n<h3>try it 1<\/h3>\n<p>Scuba divers have maximum dive times they cannot exceed when going to different depths. The data in the table below show different depths with the maximum dive times in minutes. Use your calculator to find the least-squares regression line and predict the maximum dive time for 110 feet.<\/p>\n<table>\n<thead>\n<tr>\n<th><em>X<\/em> (depth in feet)<\/th>\n<th><em>Y<\/em> (maximum dive time)<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>50<\/td>\n<td>80<\/td>\n<\/tr>\n<tr>\n<td>60<\/td>\n<td>55<\/td>\n<\/tr>\n<tr>\n<td>70<\/td>\n<td>45<\/td>\n<\/tr>\n<tr>\n<td>80<\/td>\n<td>35<\/td>\n<\/tr>\n<tr>\n<td>90<\/td>\n<td>25<\/td>\n<\/tr>\n<tr>\n<td>100<\/td>\n<td>22<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<div class=\"qa-wrapper\" style=\"display: block\"><span class=\"show-answer collapsed\" style=\"cursor: pointer\" data-target=\"q605447\">Show Answer<\/span><\/p>\n<div id=\"q605447\" class=\"hidden-answer\" style=\"display: none\">\n<p>[latex]\\displaystyle\\hat{{y}}={127.24}-{1.11}{x}[\/latex]<\/p>\n<p>At 110 feet, a diver could dive for only five minutes.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p>The third exam score,\u00a0<em>x<\/em>, is the independent variable and the final exam score, <em>y<\/em>, is the dependent variable. We will plot a regression line that best &#8220;fits&#8221; the data. If each of you were to fit a line &#8220;by eye,&#8221; you would draw different lines. We can use what is called a\u00a0<strong>least-squares regression line<\/strong> to obtain the best-fit line.<\/p>\n<p>Consider the following diagram. Each point of data is of the form (<em>x<\/em>, <em>y<\/em>) and each point of the line of best fit using least-squares linear regression has the form [latex]\\left ( x, {\\hat y} \\right )[\/latex].<\/p>\n<p>The\u00a0[latex]\\displaystyle\\hat{{y}}[\/latex] is read &#8220;<strong><em data-redactor-tag=\"em\">y<\/em> hat<\/strong>&#8221; and is the\u00a0<strong>estimated value of <\/strong><em><strong data-redactor-tag=\"strong\">y<\/strong><\/em>. It is the value of <em>y<\/em> obtained using the regression line. It is not generally equal to <em>y<\/em> from data.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-2300 size-full\" src=\"https:\/\/s3-us-west-2.amazonaws.com\/courses-images\/wp-content\/uploads\/sites\/5668\/2021\/07\/11151354\/6be87cc77483ecafa6709b1ac0da826854ddb3ca.jpeg\" alt=\"The scatter plot of exam scores with a line of best fit. One data point is highlighted along with the corresponding point on the line of best fit. Both points have the same x-coordinate. The distance between these two points illustrates how to compute the sum of squared errors.\" width=\"731\" height=\"324\" \/><\/p>\n<p>The term\u00a0[latex]\\displaystyle{y}_{0}-\\hat{y}_{0}={\\epsilon}_{0}[\/latex] is called the &#8220;<strong>error<\/strong>&#8221; or <strong>residual<\/strong>. It is not an error in the sense of a mistake. The <strong>absolute value of a residual<\/strong> measures the vertical distance between the actual value of <em>y<\/em> and the estimated value of <em>y<\/em>. In other words, it measures the vertical distance between the actual data point and the predicted point on the line.<\/p>\n<p>If the observed data point lies above the line, the residual is positive, and the line underestimates the actual data value for\u00a0<em>y<\/em>. If the observed data point lies below the line, the residual is negative, and the line overestimates that actual data value for <em>y<\/em>.<\/p>\n<p>In the diagram above,\u00a0[latex]\\displaystyle{y}_{0}-\\hat{y}_{0}={\\epsilon}_{0}[\/latex] is the residual for the point shown. Here the point lies above the line and the residual is positive.<\/p>\n<p><em>\u03b5<\/em> = the Greek letter <strong>epsilon<\/strong><\/p>\n<p>For each data point, you can calculate the residuals or errors,<br \/>\n[latex]\\displaystyle{y}_{i}-\\hat{y}_{i}={\\epsilon}_{i}[\/latex] for <em>i<\/em> = 1, 2, 3, &#8230;, 11.<\/p>\n<p>Each |<em>\u03b5<\/em>| is a vertical distance.<\/p>\n<p>For the example about the third exam scores and the final exam scores for the 11 statistics students, there are 11 data points. Therefore, there are 11\u00a0<em>\u03b5<\/em> values. If you square each \u03b5 and add, you get<\/p>\n<p>[latex]\\displaystyle{({\\epsilon}_{{1}})}^{{2}}+{({\\epsilon}_{{2}})}^{{2}}+\\ldots+{({\\epsilon}_{{11}})}^{{2}}={\\stackrel{{11}}{{\\stackrel{\\sum}{{{}_{{{i}={1}}}}}}}}{\\epsilon}^{{2}}[\/latex]<\/p>\n<p>This is called the\u00a0<strong>Sum of Squared Errors (SSE)<\/strong>.<\/p>\n<p>Using calculus, you can determine the values of\u00a0<em>a<\/em> and <em>b<\/em> that make the <strong>SSE<\/strong> a minimum. When you make the <strong>SSE<\/strong> a minimum, you have determined the points that are on the line of best fit. It turns out that the line of best fit has the equation:<\/p>\n<p style=\"text-align: center;\">[latex]\\displaystyle\\hat{{y}}={a}+{b}{x}[\/latex]<\/p>\n<p>where<br \/>\n[latex]\\displaystyle{a}=\\overline{y}-{b}\\overline{{x}}[\/latex]<\/p>\n<p>and<\/p>\n<p>[latex]{b}=\\dfrac{{\\sum{({x}-\\overline{{x}})}{({y}-\\overline{{y}})}}}{{\\sum{({x}-\\overline{{x}})}^{{2}}}}[\/latex].<\/p>\n<p>The sample means of the\u00a0<em>x<\/em> values and the <em>y<\/em> values are [latex]\\displaystyle\\overline{{x}}[\/latex] and [latex]\\overline{{y}}[\/latex].\u00a0The best-fit line always passes through the point [latex]\\left ({\\overline x},{\\overline y} \\right )[\/latex].<\/p>\n<p>The slope\u00a0<em>b<\/em> can be written as [latex]\\displaystyle{b}={r}{\\left(\\dfrac{{s}_{{y}}}{{s}_{{x}}}\\right)}[\/latex] where <em>s<\/em><em><sub data-redactor-tag=\"sub\">y<\/sub><\/em> = the standard deviation of the\u00a0<em>y<\/em> values and <em>s<\/em><em><sub data-redactor-tag=\"sub\">x<\/sub><\/em> = the standard deviation of the <em>x<\/em> values. <em>r<\/em> is the correlation coefficient, which is discussed in the next section.<\/p>\n<h2>Least Squares Criteria for Best Fit<\/h2>\n<p>The process of fitting the best-fit line is called\u00a0<strong>linear regression<\/strong>. The idea behind finding the best-fit line is based on the assumption that the data are scattered about a straight line. The criteria for the best-fit line is that the sum of the squared errors (SSE) is minimized, that is, made as small as possible. Any other line you might choose would have a higher SSE than the best-fit line. This best-fit line is called the <strong>least-squares regression line<\/strong>.<\/p>\n<h4>Note<\/h4>\n<p>Computer spreadsheets, statistical software, and many calculators can quickly calculate the best-fit line and create the graphs. The calculations tend to be tedious if done by hand. Instructions to use the TI-83, TI-83+, and TI-84+ calculators to find the best-fit line and create a scatterplot are shown at the end of this section.<\/p>\n<div class=\"textbox exercises\">\n<h3>Example 2<\/h3>\n<h2>Third Exam vs Final Exam Example<\/h2>\n<p>The graph of the line of best fit for the third-exam\/final-exam example is as follows:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-2301 size-full\" src=\"https:\/\/s3-us-west-2.amazonaws.com\/courses-images\/wp-content\/uploads\/sites\/5668\/2021\/07\/11151504\/4c0ec8eccde173c8ad29ac66b1a5e9bb10b6e8d1.jpeg\" alt=\"The scatter plot of exam scores with a line of best fit. One data point is highlighted along with the corresponding point on the line of best fit.\" width=\"487\" height=\"312\" \/><\/p>\n<p>The least-squares regression line (best-fit line) for the third-exam\/final-exam example has the equation:<\/p>\n<p style=\"text-align: center;\">[latex]\\displaystyle\\hat{{y}}=-{173.51}+{4.83}{x}[\/latex]<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Remember,<\/strong> it is always important to plot a scatter diagram first. If the scatter plot indicates that there is a linear relationship between the variables, then it is reasonable to use a best-fit line to make predictions for <em>y<\/em> given <em>x<\/em> within the domain of <em>x<\/em>-values in the sample data, <strong>but not necessarily for <em data-redactor-tag=\"em\">x<\/em>-values outside that domain<\/strong>. You could use the line to predict the final exam score for a student who earned a grade of 73 on the third exam. You should NOT use the line to predict the final exam score for a student who earned a grade of 50 on the third exam, because 50 is not within the domain of the <em>x<\/em>-values in the sample data, which are between 65 and 75.<\/p>\n<\/div>\n<h2>Understanding Slope<\/h2>\n<p>The slope of the line,\u00a0<em>b<\/em>, describes how changes in the variables are related. It is important to interpret the slope of the line in the context of the situation represented by the data. You should be able to write a sentence interpreting the slope in plain English.<\/p>\n<p><strong>Interpretation of the Slope: <\/strong>The slope of the best-fit line tells us how the dependent variable (<em>y<\/em>) changes for every one-unit increase in the independent (<em>x<\/em>) variable, on average.<\/p>\n<p><strong>For example 2:<\/strong><\/p>\n<ul>\n<li>Slope: The slope of the line is <em>b<\/em> = 4.83.<\/li>\n<li>Interpretation: For a one-point increase in the score on the third exam, the final exam score increases by 4.83 points, on average.<\/li>\n<\/ul>\n<header>\n<h2 class=\"os-title\" data-type=\"title\"><span class=\"os-title-label\">USING THE TI-83, 83+, 84, 84+ CALCULATOR<\/span><\/h2>\n<\/header>\n<h3>Using the Linear Regression T Test: LinRegTTest<\/h3>\n<ol>\n<li>In the STAT list editor, enter the X data in list L1 and the Y data in list L2, paired so that the corresponding (<em>x<\/em>,<em>y<\/em>) values are next to each other in the lists. (If a particular pair of values is repeated, enter it as many times as it appears in the data).<\/li>\n<li>On the STAT TESTS menu, scroll down with the cursor to select the LinRegTTest. (Be careful to select LinRegTTest, as some calculators may also have a different item called LinRegTInt).<\/li>\n<li>On the LinRegTTest input screen enter: Xlist: L1 ; Ylist: L2 ; Freq: 1<\/li>\n<li>On the next line, at the prompt <em>\u03b2<\/em> or <em>\u03c1<\/em>, highlight &#8220;\u2260 0&#8221; and press ENTER<\/li>\n<li>Leave the line for &#8220;RegEq:&#8221; blank<\/li>\n<li>Highlight Calculate and press ENTER.<\/li>\n<\/ol>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-2302 size-full\" src=\"https:\/\/s3-us-west-2.amazonaws.com\/courses-images\/wp-content\/uploads\/sites\/5668\/2021\/07\/11151634\/18649be8089fb2f8b0c2b567ff134a1f356fcd24.jpeg\" alt=\"1. Image of calculator input screen for LinRegTTest with input matching the instructions above. 2.Image of corresponding output calculator output screen for LinRegTTest: Output screen shows: Line 1. LinRegTTest; Line 2. y = a + bx; Line 3. beta does not equal 0 and rho does not equal 0; Line 4. t = 2.657560155; Line 5. df = 9; Line 6. a = \uf02d173.513363; Line 7. b = 4.827394209; Line 8. s = 16.41237711; Line 9. r squared = .4396931104; Line 10. r = .663093591\" width=\"487\" height=\"302\" \/><\/p>\n<p>The output screen contains a lot of information. For now, we will focus on a few items from the output and will return later to the other items.<\/p>\n<p>The second line says\u00a0<em>y<\/em> = <em>a<\/em> + <em>bx<\/em>. Scroll down to find the values <em>a<\/em> = \u2013173.513, and <em>b<\/em> = 4.8273; the equation of the best-fit line is <em>\u0177<\/em> = \u2013173.51 + 4.83<em>x.<\/em><\/p>\n<p>The two items at the bottom are <em>r<\/em><sub>2<\/sub> = 0.43969 and <em>r<\/em> = 0.663. For now, just note where to find these values; we will discuss them in the next two sections.<\/p>\n<h4>Graphing the Scatterplot and Regression Line<\/h4>\n<ol>\n<li>We are assuming your X data is already entered in list L1 and your Y data is in list L2<\/li>\n<li>Press 2nd STATPLOT ENTER to use Plot 1<\/li>\n<li>On the input screen for PLOT 1, highlight <strong>On<\/strong>, and press ENTER<\/li>\n<li>For TYPE: highlight the very first icon which is the scatterplot and press ENTER<\/li>\n<li>Indicate Xlist: L1 and Ylist: L2<\/li>\n<li>For Mark: it does not matter which symbol you highlight.<\/li>\n<li>Press the ZOOM key and then the number 9 (for menu item &#8220;ZoomStat&#8221;) ; the calculator will fit the window to the data<\/li>\n<li>To graph the best-fit line, press the &#8220;Y=&#8221; key and type the equation \u2013173.5 + 4.83X into equation Y1. (The X key is immediately left of the STAT key). Press ZOOM 9 again to graph it.<\/li>\n<li>Optional: If you want to change the viewing window, press the WINDOW key. Enter your desired window using Xmin, Xmax, Ymin, Ymax<\/li>\n<\/ol>\n<h4>Note<\/h4>\n<p>Another way to graph the line after you create a scatter plot is to use LinRegTTest. Make sure you have done the scatter plot. Check it on your screen. Go to LinRegTTest and enter the lists. At RegEq: press VARS and arrow over to Y-VARS. Press 1 for 1:Function. Press 1 for 1:Y1. Then arrow down to Calculate and do the calculation for the line of best fit. Press Y = (you will see the regression equation). Press GRAPH. The line will be drawn.&#8221;<\/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-307\">\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>Statistics, The Regression Equation. <strong>Provided by<\/strong>: OpenStax. <strong>Located at<\/strong>: <a target=\"_blank\" href=\"https:\/\/openstax.org\/books\/statistics\/pages\/12-2-the-regression-equation\">https:\/\/openstax.org\/books\/statistics\/pages\/12-2-the-regression-equation<\/a>. <strong>License<\/strong>: <em><a target=\"_blank\" rel=\"license\" href=\"https:\/\/creativecommons.org\/licenses\/by\/4.0\/\">CC BY: Attribution<\/a><\/em>. <strong>License Terms<\/strong>: Access for free at https:\/\/openstax.org\/books\/statistics\/pages\/1-introduction<\/li><li>Introductory Statistics. <strong>Authored by<\/strong>: Barbara Illowsky, Susan Dean. <strong>Provided by<\/strong>: OpenStax. <strong>Located at<\/strong>: <a target=\"_blank\" href=\"https:\/\/openstax.org\/books\/introductory-statistics\/pages\/1-introduction\">https:\/\/openstax.org\/books\/introductory-statistics\/pages\/1-introduction<\/a>. <strong>License<\/strong>: <em><a target=\"_blank\" rel=\"license\" href=\"https:\/\/creativecommons.org\/licenses\/by\/4.0\/\">CC BY: Attribution<\/a><\/em>. <strong>License Terms<\/strong>: Access for free at https:\/\/openstax.org\/books\/introductory-statistics\/pages\/1-introduction<\/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":169134,"menu_order":14,"template":"","meta":{"_candela_citation":"[{\"type\":\"cc\",\"description\":\"Statistics, The Regression Equation\",\"author\":\"\",\"organization\":\"OpenStax\",\"url\":\"https:\/\/openstax.org\/books\/statistics\/pages\/12-2-the-regression-equation\",\"project\":\"\",\"license\":\"cc-by\",\"license_terms\":\"Access for free at https:\/\/openstax.org\/books\/statistics\/pages\/1-introduction\"},{\"type\":\"cc\",\"description\":\"Introductory Statistics\",\"author\":\"Barbara Illowsky, Susan Dean\",\"organization\":\"OpenStax\",\"url\":\"https:\/\/openstax.org\/books\/introductory-statistics\/pages\/1-introduction\",\"project\":\"\",\"license\":\"cc-by\",\"license_terms\":\"Access for free at https:\/\/openstax.org\/books\/introductory-statistics\/pages\/1-introduction\"}]","CANDELA_OUTCOMES_GUID":"","pb_show_title":"on","pb_short_title":"","pb_subtitle":"","pb_authors":[],"pb_section_license":""},"chapter-type":[],"contributor":[],"license":[],"class_list":["post-307","chapter","type-chapter","status-publish","hentry"],"part":303,"_links":{"self":[{"href":"https:\/\/courses.lumenlearning.com\/introstatscorequisite\/wp-json\/pressbooks\/v2\/chapters\/307","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/courses.lumenlearning.com\/introstatscorequisite\/wp-json\/pressbooks\/v2\/chapters"}],"about":[{"href":"https:\/\/courses.lumenlearning.com\/introstatscorequisite\/wp-json\/wp\/v2\/types\/chapter"}],"author":[{"embeddable":true,"href":"https:\/\/courses.lumenlearning.com\/introstatscorequisite\/wp-json\/wp\/v2\/users\/169134"}],"version-history":[{"count":24,"href":"https:\/\/courses.lumenlearning.com\/introstatscorequisite\/wp-json\/pressbooks\/v2\/chapters\/307\/revisions"}],"predecessor-version":[{"id":4016,"href":"https:\/\/courses.lumenlearning.com\/introstatscorequisite\/wp-json\/pressbooks\/v2\/chapters\/307\/revisions\/4016"}],"part":[{"href":"https:\/\/courses.lumenlearning.com\/introstatscorequisite\/wp-json\/pressbooks\/v2\/parts\/303"}],"metadata":[{"href":"https:\/\/courses.lumenlearning.com\/introstatscorequisite\/wp-json\/pressbooks\/v2\/chapters\/307\/metadata\/"}],"wp:attachment":[{"href":"https:\/\/courses.lumenlearning.com\/introstatscorequisite\/wp-json\/wp\/v2\/media?parent=307"}],"wp:term":[{"taxonomy":"chapter-type","embeddable":true,"href":"https:\/\/courses.lumenlearning.com\/introstatscorequisite\/wp-json\/pressbooks\/v2\/chapter-type?post=307"},{"taxonomy":"contributor","embeddable":true,"href":"https:\/\/courses.lumenlearning.com\/introstatscorequisite\/wp-json\/wp\/v2\/contributor?post=307"},{"taxonomy":"license","embeddable":true,"href":"https:\/\/courses.lumenlearning.com\/introstatscorequisite\/wp-json\/wp\/v2\/license?post=307"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}