Re: [R] Linear Regression with lm Forcing the Slope to Equal 1

2007-11-17 Thread Christofer
One way of doing I think is to do it by 'hand'. In ls we minimizes SSE w.r.t. mu and beta. However in your case, you can concentrate only on minimizing SSE w.r.t. beta Regards, -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Tom La Bone Sent: Sunday, Nove

Re: [R] Linear Regression with lm Forcing the Slope to Equal 1

2007-11-17 Thread Washington Leite Junger
or simply insert the offset term into the formula lm(y~offset(x)) Washington On 17/11/2007 8:29 PM, Tom La Bone wrote: > Is there a way to do a linear regression with lm (having one predictor > variable) and constrain the slope of the line to equal 1? > You could use the offset parameter to do

Re: [R] Linear Regression with lm Forcing the Slope to Equal 1

2007-11-17 Thread Duncan Murdoch
On 17/11/2007 8:29 PM, Tom La Bone wrote: > Is there a way to do a linear regression with lm (having one predictor > variable) and constrain the slope of the line to equal 1? > You could use the offset parameter to do this, e.g. x <- 1:20 y <- x + rnorm(20) lm(y ~ 1, offset=x) Duncan Murdoch _