Instructions for this demo are down below the graph.

This applet demonstrates least squares regression.

## How To Use It## Least SquaresWhen the applet starts, you see a set of data points and a horizontal line through the mean of the data, representing a first try at fitting. A poor try, but a try. Click the Use your ## The R-SquaredClick the Mean line button. Click the Squares' Sum button. If there were no linear relationship between X and Y, this horizontal line through the mean would be the least squares line. Make a note of the Sum of Squares. Click the LS line button, to show the actual least squares line. The R-Squared is based on how much smaller the squares got.R-Squared = 1 - (Sum of Squares for LS line)/(Sum of Squares for Mean line) ## Least Sum of ResidualsAn alternative regression method is to choose a line that minimizes the sum of the absolute values of the residuals. The Residuals' Sum button displays this sum, so you can find one of these lines. (There's usually more than one, so this criterion alone isn't enough to define a best fit.) |
The data points are generated using the same method as HSPM J716's assignment 1A last part.
The The The The The The The |

© 2000-2002 Samuel L. Baker

Least Squares Demo by Samuel L. Baker is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.

The author is solely responsible for this page. Its contents
have not been reviewed or approved by the University of South Carolina.