CHEN, Cheng
2013-Aug-04 17:19 UTC
[R] why my R^2 is so small while there do seem to be a dependency there?
Hi gurus! What I need to do is to find a model, which can predict what the * observation* should look like given a *factor* input. i am doing a simple linear fit in R: lm(observation~0+factor, data=d), the R^2 is 0.002, which is really small. however, when I do a 'SELECT AVG observation by 0.001 BRACKET factor', there result is something like: *factor* | *average observersion* -0.003 -2 -0.002 -2 -0.001 -1 0.000 1 0.001 0 0.002 1 0.003 2 from a user perspective, i definitely see a pattern here, but somehow this pattern is not captured by a linear model. Is my understanding correct? so R gurus, which model do you suggest me to try for such data? Thanks! -- *CHEN*, Cheng [[alternative HTML version deleted]]
Rui Barradas
2013-Aug-04 20:41 UTC
[R] why my R^2 is so small while there do seem to be a dependency there?
Hello, Hoe did you get 0.002? Can you ?dput your data? d <- read.table(text = " factor observation -0.003 -2 -0.002 -2 -0.001 -1 0.000 1 0.001 0 0.002 1 0.003 2 ", header = TRUE) fit <- lm(observation ~ 0 + factor, data = d) summary(fit) # R2 is 0.8595, not 0.002 Hope this helps, Rui Barradas Em 04-08-2013 18:19, CHEN, Cheng escreveu:> Hi gurus! > > What I need to do is to find a model, which can predict what the * > observation* should look like given a *factor* input. > > i am doing a simple linear fit in R: > > lm(observation~0+factor, data=d), the R^2 is 0.002, which is really small. > > however, when I do a 'SELECT AVG observation by 0.001 BRACKET factor', > there result is something like: > > *factor* | *average observersion* > > -0.003 -2 > > -0.002 -2 > > -0.001 -1 > > 0.000 1 > > 0.001 0 > > 0.002 1 > 0.003 2 > > > from a user perspective, i definitely see a pattern here, but somehow this > pattern is not captured by a linear model. Is my understanding correct? > > so R gurus, which model do you suggest me to try for such data? > > Thanks! > >