Hi

I am using ggplot to overlay two regression lines on a scatter plot each
corresponding to a treatment group.

The default plot gives a different slope for each treatment group. However,
in some cases i want the lines to be parallel -ie no significant
interaction. 

My code:

ggplot(data=df,X,Y,colour=treatment) + geom_point() +
geom_smooth(method="lm")

I think i use the 'formula' option in geom_smooth but have been unable to
find a solution.

thanks for any advice.

sy




--
View this message in context: 
http://r.789695.n4.nabble.com/ggplot-adding-regression-lines-tp4652906.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
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.

Reply via email to