The model given, ~0 +factor, omitted an intercept. R^2 is meaningless without an intercept.
Further discussion should go to a statistics list like stats.stackexchange.com, as these are statistics, not R, issues. Cheers, Bert On Sun, Aug 4, 2013 at 1:41 PM, Rui Barradas <ruipbarra...@sapo.pt> wrote: > 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! >> >> > > ______________________________________________ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. -- Bert Gunter Genentech Nonclinical Biostatistics Internal Contact Info: Phone: 467-7374 Website: http://pharmadevelopment.roche.com/index/pdb/pdb-functional-groups/pdb-biostatistics/pdb-ncb-home.htm ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.