Which straight line fits a cloud of points best? Turn a line by hand until the squares add up to the least, and discover least squares, the balance point, predicting from the line, and what an outlier does to it.
Step 1 of 5 · By hand
Step 1 of 5
By hand
A correlation says how strong a link is. Sometimes you want more: a line that predicts for any . In the linear functions Unit you met the line , with slope and intercept . Which such line fits the points best?
Every line misses every point by some vertical distance, its residual. On the board each residual is a stick from the bead to the line, with a square on each stick. The best line is the one whose squares add up to the least: the line of best fit, by least squares. Squares and not plain distances, for the same reason as in the standard deviation: distances above and below would cancel.
Your line turns about , and the coloured square under the plot is the average square about it, . The chart beside the Scene shows the squares’ area for every slope. Find the best line.
Step 2 of 5
The balance point
The board now turns your line to the exact line of best fit and prints it: . The hat on means “predicted value”, as against a value that was measured.
The slope of the line of best fit is
But first, a question about the point the line turned about.
Step 3 of 5
Predicting
This is what the line is for: predicting at an that was not measured exactly. Put the into the equation.
A prediction inside the range of the readings, here between and , is called interpolation, and it is reasonable. A prediction far outside it, extrapolation, is risky: no reading tells you the link stays a straight line out there.
Step 4 of 5
One far point
In the Lesson on averages you saw that an outlier pulls the mean and leaves the median nearly where it was. The line of best fit is built from squares, so it behaves like the mean, not the median.
Step 5 of 5
How much the line explains
The board also prints . The two squares under the plot compare the average square about the mean, , with the average square about the line, . is the share of the scatter in the line accounts for, and the share left over as noise. Here : the line accounts for of the scatter.
Move Noise and watch the two squares close up or draw apart. To finish, work out for a real study.
Loading the interactive version…
Loading the interactive version…
Each step sets up the Scene for you, and a control marked “fixed” stays put for that step.
Practice · Reach the target
Your line passes through . Change Slope of your line until the squares’ area is at most above the least possible, then press Check.
Practice · Reach the target
Your line passes through . Change Slope of your line until the squares’ area is at most above the least possible, then press Check.
Practice · Choose
Which point does the line of best fit always pass through, whatever the cloud of points?
Practice · Choose
Which point does the line of best fit always pass through, whatever the cloud of points?
Practice · Calculate
The board prints the line of best fit, . By it, what is the predicted value of at ? Round to two decimal places.
Practice · Calculate
The board prints the line of best fit, . By it, what is the predicted value of at ? Round to two decimal places.
Practice · Predict, then look
Switch on Outlier: one reading on the right, far below the rest. What happens to the slope of the line of best fit, now ?
Practice · Predict, then look
Switch on Outlier: one reading on the right, far below the rest. What happens to the slope of the line of best fit, now ?
Practice · Calculate
A study finds between hours of study and marks. What per cent of the scatter in the marks (of the squares’ area about the mean) does the line of best fit account for? Write the number only.
Practice · Calculate
A study finds between hours of study and marks. What per cent of the scatter in the marks (of the squares’ area about the mean) does the line of best fit account for? Write the number only.
Lesson complete. Every practice question here is done.