A Community Devoted to the Preservation and Practice of Celestial Navigation and Other Methods of Traditional Position-Finding
From: Lars Bergman
Date: 2018 Oct 11, 11:47 -0700
A simple example may clarify what I am trying to explain. Consider three pairs of observational data:
A linear fit of these data gives the expression Yfit = 7.5 · X - 8.333 which is a straight line that minimize the sum of the squares of the vertical distances between all given Y-values and that line. The formulas to get the two coefficients is shown at the link Tony pointed at.
The (arithmetic) mean of the X values is Xmean = (3 + 4 + 5) / 3 = 4. If you put this mean value into above expression you get Yfit = 7.5 · 4 - 8.333 = 21.667. This result is actually precisely equal to the mean of the Y values, Ymean = (15 + 20 + 30) / 3 = 21.667.
So the mean of your X-values and the mean of your Y-values is a point on that best fit line. You don't need to calculate the regression coeficients.