Hello,
Thanks.
But the parameter offset is new to me.
Please kindly explain why setting offset to x will give a significant test
of whether the slope coefficient is different from one.
(I checked the ?lm but still do not understand it well)
Thanks again
Elaine
On Wed, May 1, 2013 at 11:12 AM,
Parameters are different from functions, and offset is a function. Kindly read
the help for that function and the references given there.
---
Jeff NewmillerThe . . Go Live...
The offset(x) term means to include x (or whatever is in the parentheses)
into the model as is, without computing a slope for that term. You could
also include offset( 1 * x ) instead which might make this a bit more
explicit (but would not actually make any difference). Since x by itself
is
On Wed, 1 May 2013, Elaine Kuo wrote:
Hello,
I am work with a linear regression model:
y=ax+b with the function of lm.
y= observed migration distance of butterflies
x= predicted migration distance of butterflies
Usually the result will show
if the linear term a is significantly
Hello,
I am work with a linear regression model:
y=ax+b with the function of lm.
y= observed migration distance of butterflies
x= predicted migration distance of butterflies
Usually the result will show
if the linear term a is significantly different from zero based on the
p-value.
Now
It is easy to construct your own test. I test against null of 0 first so I
can be sure I match the right result from summary.lm.
## get the standard error
seofb - sqrt(diag(vcov(lm1)))
## calculate t. Replace 0 by your null
myt - (coef(lm1) - 0)/seofb
mypval - 2*pt(abs(myt), lower.tail = FALSE,
Or use an offset
lm( y ~ x+offset(x), data = dat)
The offset gives x a coefficient of 1, so the coefficient of x in this
model is the difference between the coefficient of x in the model without
an offset and 1 -- the thing you want.
-thomas
On Wed, May 1, 2013 at 2:54 PM, Paul Johnson
7 matches
Mail list logo