Dear R-Users, I am new to R, so please excuse the ignorance. I have data: x (2.14, 2.41, 1.09, 0.17, 8.18) y (3.81, 5.13, 0.63, 0.75, 6.35) I would like to use simple linear regression and test 2 things: 1) slope of line of best fit is statistically different from 1 2) y-intercept is statically different from 0 Could anyone provide me with the R terminology to do this? Thanks so much, Dan _________________________________________________________________ [[replacing trailing spam]] ilnews [[alternative HTML version deleted]]
Dan-157 wrote:> > > Dear R-Users, > > I am new to R, so please excuse the ignorance. > > I have data: > x (2.14, 2.41, 1.09, 0.17, 8.18) > y (3.81, 5.13, 0.63, 0.75, 6.35) > > I would like to use simple linear regression and test 2 things: > 1) slope of line of best fit is statistically different from 1 > 2) y-intercept is statically different from 0 >x <- c(2.14, 2.41, 1.09, 0.17, 8.18) y <- c(3.81, 5.13, 0.63, 0.75, 6.35) lm(y~x) ## regular regression L1 <- lm(y~x+offset(x)) ## regression, tested vs slope=1 summary(L1) Ben Bolker -- View this message in context: http://www.nabble.com/Linear-regression-and-slope-from-1-tf4631389.html#a13226196 Sent from the R help mailing list archive at Nabble.com.
From: daniel guertin <danguertin at hotmail.com> Subject: [R] Linear regression and slope from 1 Date: Mon, 15 Oct 2007 23:47:40 +0000 library(car) ?linear.hypothesis Hope this is what you wanted.> > Dear R-Users, > > I am new to R, so please excuse the ignorance. > > I have data: > x (2.14, 2.41, 1.09, 0.17, 8.18) > y (3.81, 5.13, 0.63, 0.75, 6.35) > > I would like to use simple linear regression and test 2 things: > 1) slope of line of best fit is statistically different from 1 > 2) y-intercept is statically different from 0 > > Could anyone provide me with the R terminology to do this? > > Thanks so much, > Dan > > > _________________________________________________________________ > [[replacing trailing spam]] > > ilnews > [[alternative HTML version deleted]] > >
Possibly Parallel Threads
- R WinEdt on Windows vista
- Problems with scan() in a tab-sep .txt file with cells that have '///' (three frontslashes)
- Re: Applications using fsync cause hangs for several seconds every few minutes
- What happens to a Samba share if the shared disk goes offline?
- inverse cumsum