# Interactive least squares line

- Author:
- tebnayr

- Topic:
- Square, Statistics

This is an activity for a statistics class where the students try and estimate the line of least squares for a set of specific points as well as being able to choose the points themselves by dragging them around or using the table.

Begin the program, there are 6 points (A to F) and a line dened from sliders
a and b as y = ax + b.
The square distances from the points to the line are shown as squares with
the total area displayed below (observe that it is currently at 301.45).
1) Move the sliders a and b to limit this area to be as small as possible.
Record the values of a, b, and the area.
2) Open the table and change the values (note do not delete the values) to
(1,1), (2,2.7), (3.2,8), (4.6,6), (5.1,7.2), and (5.9,8.1).
Now nd the line of best t for this set of points and record a, b, and the area.
3) Add the point (6.1,0.9) into the table. Highlight those coordinates, right
click and choose "create, list of points." This point should be labeled as point G.
Now right click "pt" in the algebra view and choose "object properties" adding
point G under the denition of pt.
Find the line of best t for this set of data and record a, b, and the area.
What happened?
4) Change the values of points A, B, C, D, E, F, and G to any values you
would like and again record a, b, and the area for the line of best t.
5) Play around!