Re: [R] Regression line does not show on scatterplot

2012-12-18 Thread Sarah Goslee
You swapped the x and y variables in the plot command. lm(y~ x) but plot(x, y) On Tue, Dec 18, 2012 at 3:09 PM, Beatriz González Domínguez harimagua...@gmail.com wrote: Hello, I have done a scatterplot and now would like to add its regression line but it does not show. Below, the code I

Re: [R] Regression line does not show on scatterplot

2012-12-18 Thread Ted Harding
On 18-Dec-2012 20:09:36 Beatriz González Domínguez wrote: Hello, I have done a scatterplot and now would like to add its regression line but it does not show. Below, the code I have used. lm3 - lm(data$S_pH_KCl2.5_BCx~data$B_OleicoPF_BCx_per) plot(data$S_pH_KCl2.5_BCx,

Re: [R] Regression line does not show on scatterplot

2012-12-18 Thread Ted Harding
Sorry, I made a mistake in re-writing your code below. See at [***] On 18-Dec-2012 21:00:28 Ted Harding wrote: On 18-Dec-2012 20:09:36 Beatriz González Domínguez wrote: Hello, I have done a scatterplot and now would like to add its regression line but it does not show. Below, the code I