[R] Comparing linear regression coefficients to a slope of 1

David Winsemius dwinsemius at comcast.net
Sun Nov 25 02:31:19 CET 2012


On Nov 24, 2012, at 4:27 PM, Catriona Hendry wrote:

> Hi!
>
> I have a question that is probably very basic, but I cannot figure  
> out how
> to do it. I simply need to compare the significance of a regression  
> slope
> against a slope of 1, instead of the default of zero.
>
> I know this topic has been posted before, and I have tried to use the
> advice given to others to fix my problem. I tried the offset command  
> based
> on one of these advice threads as follows:
>
> Regression <- lm(y~x+offset(1*x))
>
> but this resulted in a regression line that was plotted  
> perpendicular to
> the data when added with the abline function.
>

If the slope were in fact == 1 then what would the offset need to be  
to "correct it" so that it were == 0?

Failing this effort at clapping one hand, then please produce the  
requested dataset and other bits of window dressing requested in the  
Posting Guide, including whether this is a homework problem and what  
your academic institution's expectations are for soliciting help over  
the Internet.

-- 

David Winsemius, MD
Alameda, CA, USA




More information about the R-help mailing list