[R] simple test on slope of lm()
Warnes, Gregory R
gregory_r_warnes at groton.pfizer.com
Mon Nov 25 15:24:19 CET 2002
The gregmisc library contains a function 'glh.test' for testing general
linear hypotheses which can be used to perform this test:
> x <- rnorm(100)
> y <- x + rnorm(100)
> model <- lm(y ~ x)
> model
Call:
lm(formula = y ~ x)
Coefficients:
(Intercept) x
-0.1031 1.0172
> library(gregmisc)
Loading required package: MASS
Attaching package `gregmisc':
The following object(s) are masked from package:base :
lowess
> # test: 0*b0 + 1*b1 = 1
> glh.test( model, cm=c(0,1), d=1)
Test of General Linear Hypothesis
Call:
glh.test(reg = model, cm = c(0, 1), d = 1)
F = 0.0285, df1 = 1, df2 = 98, p-value = 0.8663
-Greg
> -----Original Message-----
> From: Fred JEAN [mailto:frederic.jean at univ-brest.fr]
> Sent: Friday, November 22, 2002 4:09 PM
> To: r-help at stat.math.ethz.ch
> Subject: [R] simple test on slope of lm()
>
>
> Hello
>
> I want to compare the slope (let's say 'b') of a linear model
> obtained
> with lm() to a theoretical value (let's say 'th').
>
> To do so, I think I should compute a 't value' using
> something like :
>
> (b - 'th')/standard.deviation(b)
>
> and then look at the p-value of this computed t.
>
> I don't understand how to do this in a simple way, just using lm()
> outputs for example.
>
> I'm sorry of such a naive/newbie question, and thank you so much for
> taking time to answer.
>
> Fred
> -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.
> -.-.-.-.-.-.-.-.-
> r-help mailing list -- Read
> http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
> Send "info", "help", or "[un]subscribe"
> (in the "body", not the subject !) To:
> r-help-request at stat.math.ethz.ch
> _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._.
> _._._._._._._._._
>
LEGAL NOTICE
Unless expressly stated otherwise, this message is confidential and may be privileged. It is intended for the addressee(s) only. Access to this E-mail by anyone else is unauthorized. If you are not an addressee, any disclosure or copying of the contents of this E-mail or any action taken (or not taken) in reliance on it is unauthorized and may be unlawful. If you are not an addressee, please inform the sender immediately.
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
More information about the R-help
mailing list