Skip to content
Prev 78707 / 398503 Next

details about lm()

vincent at 7d4.com wrote:

            
E.g., among several other, the great comprehensive books by John Fox are 
really well written and easy to understand ...
Well, you do not add that point, but transform the others:
Say you have (let's make a very simple 1-D example) points P_i = (x_i, 
y_i), and P = (x_0, y_0). Then calculate for all i:

   P'_i = (x_i - x_0, y_i - y_0)

Now you can calculate a regression without any Intercept by

   lm(y ~ x - 1)

You got the slope now and the Intercept is 0 so far for P'.

After that, you can re-transform to get the real data's intercept:

   Intercept = -(slope * x_0) + y_0


Uwe Ligges