Skip to content
Prev 243916 / 398506 Next

How to specify a fixed intercept for linear model

The offset arg is your friend...

x <- 1:10
y <- 42 + 2*x + rnorm(length(x), 0, 0.5)

# we suspect the intercept might be 42 !
lm( y ~ 0 + x, offset=rep(42, length(x)))

Michael


On 4 December 2010 13:42, cborley87
<christopher.borley at students.plymouth.ac.uk> wrote: