Re: [R] regression slope

From: Douglas Bates <>
Date: Wed 21 Jul 2004 - 20:30:46 EST

>>>On Tue, 2004-07-20 at 17:02, Avril Coghlan wrote:
>>>> I'm a newcomer to R so please
>>>>forgive me if this is a silly question.
>>>>It's that I have a linear regression:
>>>>fm <- lm (x ~ y)
>>>>and I want to test whether the
>>>>slope of the regression is significantly
>>>>less than 1. How can I do this in R?

Another way of doing this is to use offset(x) in the model formula

summary(fm <- lm(y ~ x + offset(x)))

(I know you wrote lm(x ~ y) but I find I have to think of it as lm(y ~ x) - old habits are hard to break.)

If you want to test for "slope is significantly less than 2" you would use

summary(fm <- lm(y ~ x + offset(2*x))) mailing list PLEASE do read the posting guide! Received on Wed Jul 21 21:02:21 2004

This archive was generated by hypermail 2.1.8 : Wed 03 Nov 2004 - 22:55:09 EST