Re: [R] Regression lines

2007-01-12 Thread Sarah Goslee
Fortune? On 1/12/07, Peter Dalgaard <[EMAIL PROTECTED]> wrote: > Prof Brian Ripley wrote: > > > > Where did you tell it 'x' was the abscissa and 'y' the ordinate? > > (Nowhere: R is lacking a mind_read() function!) > Please stop complaining about missing features. Patches will be considered. > > O

Re: [R] Regression lines

2007-01-12 Thread Duncan Murdoch
On 1/12/2007 5:56 AM, Barry Rowlingson wrote: > ken knoblauch wrote: >> This should do the trick: >> >> mind_reader <- function() { >> ll <- letters[round(runif(6, 1, 26))] > > I see my paraNormal distribution package hasn't found its way to CRAN yet: > > http://tolstoy.newcastle.edu.au/R/

Re: [R] Regression lines

2007-01-12 Thread Tom Backer Johnsen
Barry Rowlingson wrote: > ken knoblauch wrote: >> This should do the trick: >> >> mind_reader <- function() { >> ll <- letters[round(runif(6, 1, 26))] > > I see my paraNormal distribution package hasn't found its way to CRAN yet: > > http://tolstoy.newcastle.edu.au/R/help/05/04/1701.html

Re: [R] Regression lines

2007-01-12 Thread Barry Rowlingson
ken knoblauch wrote: > This should do the trick: > > mind_reader <- function() { > ll <- letters[round(runif(6, 1, 26))] I see my paraNormal distribution package hasn't found its way to CRAN yet: http://tolstoy.newcastle.edu.au/R/help/05/04/1701.html Barry

[R] Regression lines

2007-01-12 Thread ken knoblauch
This should do the trick: mind_reader <- function() { ll <- letters[round(runif(6, 1, 26))] ff <- ll[1] for (ix in 2:length(ll)) { ff <- paste(ff, ll[ix], sep = "") } if (exists(ff)) { cat("The function that you were t

Re: [R] Regression lines

2007-01-12 Thread Peter Dalgaard
Prof Brian Ripley wrote: > > Where did you tell it 'x' was the abscissa and 'y' the ordinate? > (Nowhere: R is lacking a mind_read() function!) Please stop complaining about missing features. Patches will be considered. Oh, it's you, Brian. Never mind then. You'll get to it, I'm sure. ;-) --

Re: [R] Regression lines

2007-01-12 Thread Uwe Ligges
Tom Backer Johnsen wrote: > My simpleminded understanding of simple regression is that when > plotting regression lines for x on y and y on x in the same plot, the > lines should cross each other at the respective means. But, given the > R function below, abline (lm(y~x)) works fine, but abli

Re: [R] Regression lines

2007-01-12 Thread Prof Brian Ripley
On Fri, 12 Jan 2007, Tom Backer Johnsen wrote: > My simpleminded understanding of simple regression is that when > plotting regression lines for x on y and y on x in the same plot, the > lines should cross each other at the respective means. But, given the > R function below, abline (lm(y~x)) wor

Re: [R] Regression lines

2007-01-12 Thread Roger Bivand
On Fri, 12 Jan 2007, Tom Backer Johnsen wrote: > My simpleminded understanding of simple regression is that when > plotting regression lines for x on y and y on x in the same plot, the > lines should cross each other at the respective means. But, given the > R function below, abline (lm(y~x))

[R] Regression lines

2007-01-12 Thread ken knoblauch
Try this version of your function and then think about it tst <- function () { attach (attitude) x <- rating y <- learning detach (attitude) plot (x, y) abline(v=mean(x)) abline(h=mean(y)) abline (lm(y~x)) cc <- coef(lm(x ~ y)) abline (-cc[1]/cc[2], 1/cc[2]) } > My simpleminded understanding of

[R] Regression lines

2007-01-12 Thread Tom Backer Johnsen
My simpleminded understanding of simple regression is that when plotting regression lines for x on y and y on x in the same plot, the lines should cross each other at the respective means. But, given the R function below, abline (lm(y~x)) works fine, but abline (lm(x~y)) does not. Why? funct

Re: [R] Regression lines for differently-sized groups on the same plot

2005-07-20 Thread Laura M Marx
Sundar Dorai-Raj writes: > Hi, Laura, > > Would ?predict.glm be better? > > plot(logarea, hempresence, > xlab = "Surface area of log (m2)", > ylab="Probability of hemlock seedling presence", > type="n", font.lab=2, cex.lab=1.5, axes=TRUE) > lines(logarea, predict(hemhem, logreg

Re: [R] Regression lines for differently-sized groups on the same plot

2005-07-19 Thread Sundar Dorai-Raj
Laura M Marx wrote: > Hi there, > I've looked through the very helpful advice about adding fitted lines to > plots in the r-help archive, and can't find a post where someone has offered > a solution for my specific problem. I need to plot logistic regression fits > from three differently-si

[R] Regression lines for differently-sized groups on the same plot

2005-07-19 Thread Laura M Marx
Hi there, I've looked through the very helpful advice about adding fitted lines to plots in the r-help archive, and can't find a post where someone has offered a solution for my specific problem. I need to plot logistic regression fits from three differently-sized data subsets on a plot of th