Skip to content
Back to formatted view

Raw Message

Message-ID: <434A8AFE.7060401@7d4.com>
Date: 2005-10-10T15:38:38Z
From: vincent@7d4.com
Subject: details about lm()
In-Reply-To: <434A78C2.2080802@statistik.uni-dortmund.de>

Uwe Ligges a ??crit :

> vincent at 7d4.com wrote:
>> Sorry for my lack of knowledge, but will the above trick really force
>> the regression line to pass through P ?
>> adding (0,0) in this new system of coordinates isn't it equivalent to 
>> add P to the dataset in the original system ?
> 
> 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

Thank you very much for the kind answer and for your time.
(I'll read that carefully and take my rule, pencil and R).
Vincent