Least Squares Regression

Last updated 2/4/2019
Move the "seed" slider to select a new example. Move points A and B to reposition the blue line. Your goal is to make the sum of the areas for the squares shown as small as possible. WARNING: Keep point A to the left of point B. Click on the check boxes if you want to see the regression line and the corresponding sum of squares for the regression line.
The regression line minimizes the sum of the squares of the differences between the y-values of each data point and the corresponding y-yalues of the line shown. These squared differences are represented by the squares shown on the graph. Minimizing the total area of all these squares will produce the least squares area and the resulting line will be the regression line. Updated Nov. 13, 2013 and Jan. 29, 2018.