I am plotting regression line for my data. Here is the data i have
library(car)
data(Sahlins)
m1<- lm(acres~consumers,data=Sahlins)
then i delete row 4, get a new data set as below.
Sahlins[-c( 4), ]
a<- Sahlins[-c( 4), ]
m2 <- lm(acres~consumers,data=a)
I try to adding two regression line (m1, and m2) for original data set Sahlins. but it just not work. Only work with two separate plot . here is the r code i have.
library(ggplot2)
ggplot(Sahlins,aes(consumers,acres))+geom_point()+geom_smooth(method="lm", se=F)
ggplot(a,aes(consumers,acres))+geom_point()+geom_smooth(method="lm", se=F)
how can i get two regression line in one plot ? this is the plot i want. enter image description here Thank you .