Linear Regression is a process by which the formula of a line of "best fit" is found for a set of data.  Consider the data set shown below:

x01235
y348910

Before finding the linear regression, first set an appropriate viewing rectangle.   For this example use the Viewing Rectangle  [-1, 6,1] by [0, 15, 1] so that all the data points will be clearly visible on the screen.  Then make a scatterplot of the data values.  The Viewing Rectangle and scatterplot are shown below:

To find the Linear Regression, press STAT, then RIGHT ARROW to CALC.  Select 4:LinReg(ax+b).   After LinReg(ax+b) appears on the screen, make sure L1 is listed for Xlist, and L2 is listed for Ylist. Arrow down to highlight Calculate, then press ENTER.  Then the result will appear on the screen.

In the case of the sample data given here, the line of best fit is given when a =1.5, b =3.5.  Substituting a and b into the equation gives the result for the line best fitting the data set:  

To visually inspect the results, enter the equation in while leaving PLOT1 on.  Then press GRAPH to see how well the line fits the data points. 

Copying the Regression Equation Directly into Y Values

NOTE: The regression results may be copied directly into for graphing using the following procedure: 

After the data values have been entered, press STAT, then RIGHT ARROW to CALC.  Select 4:LinReg(ax+b).    

To copy the regression equation directly into , arrow down to Store RegEQ: then press VARS, then ARROW RIGHT to Y-VARS, noting 1:Function is selected.  Press ENTER and note that 1: is already selected.  Press ENTER again.  Arrow down to Calculate, then press ENTER to calculate.   The result appears on the screen. 

Now press to see that the equation has been entered for . Press GRAPH and the line appears on the screen as shown below.

Show Me

This is the preferred method for entering the regression equation into since rounding the values can introduce significant rounding errors.



© 2019, Middle Georgia State University.  All rights reserved.