Re: [R] Question about linear regression in R

2011-11-15 Thread John Fox
Dear Miles, Within rounding error, you got the right intercept, log(3); slope, 0; residuals, all 0; residual standard error, 0; and standard errors of the intercept and slope, both 0. The R^2 should have been undefined (i.e., 0/0), but dividing one number that's 0 within rounding error by another

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