[R] r: lm question

Roger Bivand Roger.Bivand at nhh.no
Mon Jan 5 10:46:02 CET 2004


On Mon, 5 Jan 2004, allan clark wrote:

> Hi all
> 
> this is a silly question since i should know the answer.
> 
> lm(y~x) perfroms linear regression with the intercept included.
> 
> How  do i estimate the equation without the intercept?

?formula:

"The '-' operator removes the specified terms, so that '(a+b+c)^2 - a:b'
is identical to 'a + b + c + b:c + a:c'.  It can also used to remove the
intercept term: 'y~x - 1' is a line through the origin.  A model with no
intercept can be also specified as 'y~x + 0' or '0 + y~x'."

Roger

> 
> cheers
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> 

-- 
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Breiviksveien 40, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 93 93
e-mail: Roger.Bivand at nhh.no




More information about the R-help mailing list