Suppose you are taking a measurement and the relationship between your quantities is linear. Suppose you measure three samples. How then can you draw up the equation of that line with all three points?
With two points the method is simple, but I was wondering if there is also one that does it with three (or possibly more?) points.
Answer
A straight line through two different points is unique.
If there are more than two points and they are not exactly on one line, you cannot find a line that passes exactly through the three or more points.
However, if you have reason to suspect that there is a linear relationship, you can apply linear regression and calculate the so-called “best line”. This is a straight:
y= mx + q
That line then goes through the cloud of points (xk,yk), and so for every x . willk give a difference between the observed yk and the calculated mxk+q.
The criterion for deciding why one is “better” than the others is this: one chooses the line (so in fact the m-value and q-value) such that the sum of the squares of those deviations is minimal:
k (mxk +q – yk )2 is minimal
m and q are easily found by solving a 2×2 system. Surf on “linear regression” and you will find dozens of websites with the formulas for the slope m and the constant q on the -axis.
Linear regression is already built into Excel, for example, in the LINEST command. See the help function of Excel for the correct use.

Answered by
prof.dr. Paul Hellings
Department of Mathematics, Fac. IIW, KU Leuven

Old Market 13 3000 Leuven
https://www.kuleuven.be/
.