Hi! I am currently working with a project where I want to plot the regression line in a plot using ggplot. The problem occurs when I want to add the second variable, i.e. the z in the source code:
p = ggplot(data = dat, aes_string(x = "sd", y = "mean", z = "corr")) p = p + stat_smooth(method = lm, formula = y~x+z, se = FALSE, size = 0.75, linetype = "solid") p = p + geom_point() plot(p) I´m not sure if it is even possible to do multiple regression using stat_smooth, in which case do you have any alternative method? Best regards Chris -- View this message in context: http://r.789695.n4.nabble.com/Regression-using-ggplot2-tp4675676.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.