Demonstrating that the Least-squares Line fits best | |
A scatterplot is presented below, with the least-squares line superimposed. A vertical line is drawn from each point to the line, to represent the residual. The sum of the squared residuals is computed and displayed. Four buttons are provided to move the line. When clicked, one moves the line up a little, another moves the line down a little, a third rotates the line clockwise around its midpoint, and the last rotates the line counter-clockwise around its midpoint. Each time one of the four buttons is clicked, the vertical lines are redrawn and the sum of squared residuals is recomputed and displayed. The least-squares line and the sum of squared residuals from the least-squares line are constantly displayed as well, to serve as a comparison.
©2004 McGraw-Hill Higher Education |