[R] Y-intercept Value

Berwin A Turlach berwin at maths.uwa.edu.au
Tue Aug 7 05:20:59 CEST 2007

G'day Benjamin,

On Mon,  6 Aug 2007 22:49:04 -0400
Benjamin Zuckerberg <bzuckerb at syr.edu> wrote:

> Quick question...is there a way of specifying a y-intercept value  
> within a lm statement.  For example, if I wanted to specify the  
> regression to pass through the origin I would enter lm(y~0+x).  But  
> can I specify an actual term such as 1,2,3,4, etc. as an intercept  
> value?  Thank you!

Not tested, but lm(y-1~x+0) should work for an intercept value of 1.

But I have to wonder why you are interested in this.  Isn't regression
through the intercept already bad enough? ;-)




More information about the R-help mailing list