Least Squares Line
Videos
You can think of the least squares line, also referred to as the line of least squares, as the line that averages a given set of points. Given any number of coordinate points in a set, you can find the line that averages all of them by using the least squares method. The line might not intersect any of the points directly, but it will give you their average.
To find the least squares line, you can use the slope-intercept equation of the line, which we’ll write as , where
is the slope of the line, and
is the
-intercept. Just use the formulas below to find
and
.
These least squares line formulas seem complicated, but they’re actually very simple. I like to summarize them in my head like this:
If you’re given a set of coordinate points,
in the formulas above will come from the
-coordinates,
will come from the
-coordinates, and
is the number of points in your set, in this case,
.
As you can see from above, is included in the formula for
, which means you’ll have to compute
first, then
.
In summary, follow these steps to find the equation of the least squares line:
- Compute
- Compute
- Plug
and
into the formula for the slope-intercept equation of the line
- Simplify the equation as much as possible



