Re: [R] lsfit residuals

2009-10-26 Thread Tanya Cashorali
Sorry here's working code, I wrote it from my iPhone before! x = runif(100, 0, 10) plot(x) abline(lsfit(1:100, x)) abline(lsfit(1:100, x + sd(x))) fit = lsfit(1:100, x + sd(x)) y = which(residuals(fit) > 0) points(y, x[y], col="red") Notice the points that are red are all the ones above the first

Re: [R] lsfit residuals

2009-10-26 Thread David Winsemius
On Oct 26, 2009, at 8:47 AM, Tanya Cashorali wrote: > Sorry here's working code, I wrote it from my iPhone before! Gee, can I get the R.app that runs on an iPhone? > > x = runif(100, 0, 10) > plot(x) > abline(lsfit(1:100, x)) > abline(lsfit(1:100, x + sd(x))) > fit = lsfit(1:100, x + sd(x)) > y

Re: [R] lsfit residuals

2009-10-26 Thread David Winsemius
On Oct 25, 2009, at 1:20 PM, Tanya Cashorali wrote: I'm trying to extract the points above and below a particular lsfit. I can only get the residuals from the original fit though. x = runif(100, 0, 10) plot(x) abline(lsfit(1:100, test)) Error in as.matrix(y) : object 'test' not found I ra