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 have used. > > lm3 <- lm(data$S_pH_KCl2.5_BCx~data$B_OleicoPF_BCx_per) > plot(data$S_pH_KCl2.5_BCx, data$B_OleicoPF_BCx_per) > abline(lm3) > > I have been able to do the complete operation using the software STATISTICA > but it would be great to do it with R. > > If you require more details please get in touch. > > Thanks a lot! > > Bea -- Sarah Goslee http://www.functionaldiversity.org ______________________________________________ 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.