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

[R] Question about Linear Regression

2012-12-28 Thread Lorenzo Isella
Dear All, A semi-trivial question: suppose you want to carry out a linear regression of the kind y~x1+x2+x3 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 of? Can I code this as a simpl

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

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

[R] question about linear regression and leverage

2011-06-21 Thread George Markomanolis
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 can see that there are around to 250 points with big leverage value