Sorry, this sketch requires a Java-compatible web browser to see.
The point of the "method of least-squares" is to create a line that best fits a given set of nonlinear points. In most people's experience, this is done by eye, but there is a more mathematical way to do it. Each point has a vertical distance away from the line that's supposed to fit it. The line created by the least squares method seeks to make the totals of those distances as small as possible. When a particular combination of y-intercept (b) and slope (a) create the lowest total possible, the least squares regression line is created, with the equation y=ax+b. Explore this concept, every red point can be moved.
sketch created by Bill Finzer, March 1995, September 1997