Skip to content

Significance of slopes

4 messages · Christian Arnold, anna freni sterrantino, PIKAL Petr

#
Hello R community,

I have a question regarding correlation and regression analysis. I have 
two variables, x and y. Both have a standard deviation of 1; thus, 
correlation and slope from the linear regression (which also must have 
an intercept of zero) are equal.
I want to probe two particular questions:
1) Is the slope significantly different from zero? This should be easy 
with the lm function, as the p-value should reflect exactly that 
question. If I am wrong, lease correct me.
2) Is the slope significantly different from a non-zero value (e.g. 
0.5)? How can I probe that hypothesis? Any ideas?

I apologize if this question is too trivial and already answered 
somewhere, but I did not find it.

Thank you for the help!
Christian
#
Hi


r-help-bounces at r-project.org napsal dne 09.12.2008 23:21:17:
??? ??? 1
returned.
Or use offset

test for slope == -1
reg=lm(trt~ctl+offset(-1*ctl))
summary(reg)

Call:
lm(formula = trt ~ ctl + offset(-1 * ctl))

Residuals:
     Min       1Q   Median       3Q      Max 
-1.09389 -0.33069 -0.15249  0.05128  1.45497 

Coefficients:
            Estimate Std. Error t value Pr(>|t|) 
(Intercept)   7.7957     2.1661   3.599  0.00699 **
ctl           0.3770     0.4279   0.881  0.40391 
---
Signif. codes:  0 ?***? 0.001 ?**? 0.01 ?*? 0.05 ?.? 0.1 ? ? 1 

Residual standard error: 0.7485 on 8 degrees of freedom
Multiple R-squared: 0.2095,     Adjusted R-squared: 0.1106 
F-statistic:  2.12 on 1 and 8 DF,  p-value: 0.1835 

test for slope == 0.5 
reg=lm(trt~ctl+offset(0.5*ctl))

Regards
Petr
two
correlation and
zero) are equal.
with
I am
0.5)? How
somewhere,
http://www.R-project.org/posting-guide.html
http://www.R-project.org/posting-guide.html