nt: Sunday, November 18, 2007 7:00 AM
To: r-help@r-project.org
Subject: [R] Linear Regression with lm Forcing the Slope to Equal 1
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?
Tom
--
View this message in con
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
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
_
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?
Tom
--
View this message in context:
http://www.nabble.com/Linear-Regression-with-lm-Forcing-the-Slope-to-Equal-1-tf4828804.html#a13815432
Sent from the R help maili
4 matches
Mail list logo