Re: [R] details about lm()

From: Uwe Ligges <ligges_at_statistik.uni-dortmund.de>
Date: Mon 10 Oct 2005 - 18:55:12 EST

vincent@7d4.com wrote:

> Domenico Cozzetto a écrit :
>
>

>>Dear all,
>>I'd like to get a linear regression of some data, and impose that the line
>>goes through a given point P. I've tried to use the lm() method in the
>>package "stats", but I wasn't able to specify the coordinates of the point
>>P. Maybe I should use another method?

>
>
> add directly P in your data is also a way

No!

Please, both of you, consult a basic textbook on linear regression.

You can transform the data (linear) so that P becomes (0,0), after that   you can estimate the slope without intercept by specifying   lm(y ~ x - 1)
The slope estimate is still valid while your intercept can be calculated
afterwards.

Uwe Ligges

> ______________________________________________
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Mon Oct 10 19:04:00 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:40:41 EST