Re: [R] Question about Linear Regression

2012-12-28 Thread Jeremy Miles
You can run that as it is. The term to search for on Google is 'dummy coding'. Jeremy On 28 December 2012 07:45, Lorenzo Isella wrote: > > where x3 is a dichotomous variable assuming only 0 and 1 values (x1 and x2 > are continuous variables). > Is there any particular caveat I should be aware o

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

Re: [R] question about linear regression and leverage

2011-06-21 Thread Bert Gunter
You really really need to consult with a local statistician for help. You are making a valiant effort, but it is clear that you have insufficient background and experience. Get help from an expert if you can. It is no dishonor, you will learn a lot, and you will avoid incorrect conclusions. Cheers

Re: [R] question about linear regression and leverage

2011-06-21 Thread George Markomanolis
Dear David, Thanks for your answer. Yes now that you mentioned these points are in the beginning of a variable range. From the plot of the residuals seems to have non constant variance which is solved by a transformation. I checked also for interactions by using the symbol : between two variables

Re: [R] question about linear regression and leverage

2011-06-21 Thread David Winsemius
On Jun 21, 2011, at 3:49 AM, George Markomanolis wrote: Dear all, I am new to this field and I have a question about a linear regression. I have a dataset of around to 31000 points and I want to apply a linear regression. The R-squared is 0.9 however when I check the diagnostic plots I ca