We introduce the basic concept here since it is natural for students to be curious about where functions come from. Open the file Linefit.xls . Obviously, any line that we would accept as a reasonable fit to this data must have a negative slope. If we were to maneuver the edge of a transparent ruler on this scatterplot with a slope equal to -0.5 then a reasonable guess for the y intercept might be 265 . Column B contains the actual values of Y. Column C contains estimated values of Y calculated with a slope m and a y-intercept b .
Some residuals are positive and some negative.
Column E contains the squares of each of these errors. We square the errors before adding to avoid having positive and negative errors cancel each other out. Set H2 to be the target cell, and minimize SSE by changing the slope and intercept in cells D2 and D3. Graphical calculators and statistical software programs have built-in regression tools that can easily produce information about regression lines or curves given the coordinates of the points. Excel has such a tool built into its charting utility.