Least-Squares Line

Pronunciation: /list skwɛərz laɪn/ Explain

A least-square line is a line that minimizes the distance between the data points it represents and the line itself. Manipulative 1 is an example of a least squares line fitted to data.

Click on the blue points and drag them to change the figure.

Move the points to create a near-vertical line. Move the points to create a near-horizontal line.
Manipulative 1 - Least Squares Line Created with GeoGebra.

How to Calculate a Least Squares Line

In the equations, N is the number of points. x is the x-coordinate of a point. y is the y-coordinate of a point. All calculated amounts are approximate.

Legendx y x2 xy
A0.3 1.80.09 0.54
B0.8 2.20.64 1.76
C1.9 2.63.61 4.94
D2.2 2.14.84 4.62
E3.3 2.910.89 9.57
F3.9 2.515.21 9.75
Sum12.414.1 35.2831.18

m=(n*sum(xy)-sum(x)*sum(y))/(n*sum(x squared)-(sum(x) squared)) = (6*31.18-12.4*14.1)/(5*35.28)-12.4 squared)=(187.08-174.84)/(176.4-153.76)=12.24/22.64=0.54
y=mx + b implies y=0.54x + 1.234


  1. McAdams, David E.. All Math Words Dictionary, least-squares line. 2nd Classroom edition 20150108-4799968. pg 107. Life is a Story Problem LLC. January 8, 2015. Buy the book

Cite this article as:

McAdams, David E. Least-Squares Line. 4/24/2019. All Math Words Encyclopedia. Life is a Story Problem LLC. https://www.allmathwords.org/en/l/leastsquareline.html.

Image Credits

Revision History

4/24/2019: Changed equations and expressions to new format. (McAdams, David E.)
12/21/2018: Reviewed and corrected IPA pronunication. (McAdams, David E.)
8/31/2018: Removed broken links, updated license, implemented new markup, implemented new Geogebra protocol. (McAdams, David E.)
7/18/2018: Changed title to common format. (McAdams, David E.)
7/12/2007: Initial version. (McAdams, David E.)

All Math Words Encyclopedia is a service of Life is a Story Problem LLC.
Copyright © 2018 Life is a Story Problem LLC. All rights reserved.
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License