Edwin,
  It is. The results from the second, using offset, should match the
results from computing the t-score from the first one using (coef(data.x) -
1)/std.err(coef(data.x)). Hope my simple symbolism make sense.
Dave.
P.S. You can also use summary(lm(data.y - data.x ~ data.x)) and ge tthe
same answer.



On Wed, Jun 12, 2013 at 6:46 AM, Pos, E.T. <E.T.Pos@uu.nl> wrote:

> Dear all,
>
> I'm having trouble with something that I presume is foolishly easy.
>
> I have a linear model with a slope slightly higher than the slope of y=x.
> Now I wish to test if the slope of this lm is actually significantly
> different from the slope of y=x (i.e. 1)
>
> One option to do this obviously is testing whether 1 falls within the 95%
> confidence interval of the original lm. I've done this and it gives me an
> indication but I would like a hard p-value for testing this significance.
> The problem I run into is that I don't know how to test for the
> significance of this difference between the slope of my lm and the line y=x.
>
> Thus far:
>
> Method #1
>
> data1.y = "some data"
> data1.x = "some more data"
> data1 = lm(data1.y~data1.x)
> abline(data1, col = "red", lwd = 2) #draw a line through the regression
> abline(a = 0, b = 1)                    # which gives me the line for x=y
> but this doesn't work for ANOVA but is nicely ilustrative
>
> #Check the 95% confidence interval
> confint(data1)
>
> Method #2
>
> # I used offset because I found that on the mailinglist in the archives
> but I'm not sure why this would indicate the difference is significant from
> the slope y=x… Any suggestions?
> data1.y = "some data"
> data1.x = "some more data"
> data1 = lm(data1.y~data1.x)
> data1.offset = lm(data1.y~data1.x+offset(data1.x))
> summary(data1.offset) #then check if the slope is significantly different
> from 1
>
> But I'm not convinced that method number 2 gives me the correct answer.
> Any idea's here?
>
> Thanks a lot,
>
> Edwin.
>
>
>         [[alternative HTML version deleted]]
>
>
> _______________________________________________
> R-sig-ecology mailing list
> R-sig-ecology@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
>
>

	[[alternative HTML version deleted]]

