Re: [R] how to test this

From: Prof Brian Ripley <ripley_at_stats.ox.ac.uk>
Date: Wed 03 Aug 2005 - 17:19:33 EST

On Wed, 3 Aug 2005, Simon Blomberg wrote:

> This is two tests: Whether the slope != 1 and whether the intercept != 0.

Neither model given has an intercept ....

> To do this, include an offset in your model:
>
> fit <- lm(y ~ x + offset(x), data=dat)

but no intercept, so use

summary(lm(y ~ 0 + x + offset(1.05*x), data=dat))

and look if the coefficient of x is significantly different from zero.

E.g.

x <- 1:10
set.seed(1)
y <- 1.05*x + rnorm(10)
summary(lm(y ~ 0 + x + offset(1.05*x)))

Coefficients:

   Estimate Std. Error t value Pr(>|t|)
x 0.03061 0.03910 0.783 0.454

is not.

>
> HTH,
>
> Simon.
>
>
> At 03:44 PM 3/08/2005, Jin.Li@csiro.au wrote:
>>
>> I am wondering how to test whether a simple linear regression model
>> (e.g. y=1.05x) is significantly different from a 1 to 1 line (i.e. y=x).

-- 
Brian D. Ripley,                  ripley@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Received on Wed Aug 03 17:23:02 2005

This archive was generated by hypermail 2.1.8 : Sun 23 Oct 2005 - 15:02:18 EST