Re: [R] Question about linear regression in R

2011-11-15 Thread John Fox
-requ...@r-project.org; r-help@r-project.org > Subject: [R] Question about linear regression in R > > Hi all, > I wrote a r program as below: > > x <- 1:10 > y <- c(3,3,3,3,3,3,3,3,3,3) > > fit <- lm(log(y) ~ x) > summary(fit) > > And I expect to ge

Re: [R] Question about linear regression in R

2011-11-15 Thread David Winsemius
On Nov 14, 2011, at 10:49 PM, Miles Yang wrote: Hi all, I wrote a r program as below: x <- 1:10 y <- c(3,3,3,3,3,3,3,3,3,3) fit <- lm(log(y) ~ x) summary(fit) And I expect to get some error message from R, because "y" is constant. But, I got the message as below: You are asking R to tel

Re: [R] Question about linear regression in R

2011-11-14 Thread R. Michael Weylandt
What exactly is it that's worrying you? It's a problematic regression for a few reasons, but ultimately it seems pretty ok, though I'd be ever so slightly worried about the R^2 value being misinterpreted. Michael On Mon, Nov 14, 2011 at 10:49 PM, Miles Yang wrote: > Hi all, > I wrote a r program

[R] Question about linear regression in R

2011-11-14 Thread Miles Yang
Hi all, I wrote a r program as below: x <- 1:10 y <- c(3,3,3,3,3,3,3,3,3,3) fit <- lm(log(y) ~ x) summary(fit) And I expect to get some error message from R, because "y" is constant. But, I got the message as below: > summary(fit) Call: lm(formula = log(y) ~ x) Residuals: Min 1