I cannot find my answer anywhere. I have two regression lines from two different datasets. I am trying to put these two regression lines in one graph. The following worked well.
regression1<-lm(Y ~ X, data = mydata1)
regression2<-lm(Y ~ X, data = mydata2)
abline(regression1)
abline(regression2)
However in this plot I just have lines and I don't have dots. I run:
regression1<-lm(Y ~ X, data = mydata1)
regression2<-lm(Y ~ X, data = mydata2)
plot(c(0,2),c(0,2),type="n") +
points(rnorm(200), rnorm(200), col = "red")
abline(regression1)
abline(regression2)
With this command, I had just dots and I don't have lines, still does not work for me. What I want is having one graph with two different lines (representing the each regression's fitted lines) and dots of these regressions. I want these with different colours. Any help would be appreciated. Thanks