Re: [R] Creating two lines of best fit on a scatter plot

2010-04-07 Thread Andrew Dolman
lm1 <- lm(y~x, data=mydata, subset=mydata$patchchoice==1) lm2 <- lm(y~x, data=mydata, subset=mydata$patchchoice==2) abline(lm1, col="Blue") abline(lm2, col="Red" ) Should do it. Not likely the best way but a way. Andy. andydol...@gmail.com On 7 April 2010 19:17, Samantha Reynolds wrote:

[R] Creating two lines of best fit on a scatter plot

2010-04-07 Thread Samantha Reynolds
Hello I am trying to plot two lines of best fit on a scatter plot. I'm plotting number of visits (y) against personality (x), half the plots are blue for patchchoice one and the other plots are red for patchchoice two (these options come from one factor, see below) . So i need a line for

[R] Creating two lines of best fit on a scatter plot

2010-04-07 Thread Samantha Reynolds
Hello I am trying to plot two lines of best fit on a scatter plot. I'm plotting number of visits (y) against personality (x), half the plots are blue for patchchoice one and the other plots are red for patchchoice two (these options come from one factor, see below) . So i need a line for