Here is my question:
1) I ran a multiple linear regression: suppose like:
lm(attitude~quality+price+location+Income)
I mainly care about the relationship between attitude and quality, and other variables are control variables.
2) Then I wanted to do a scatter plot between attitude and quality. It is easy:
Q <-ggplot(data=data, aes(x=quality, y=attitude))
Q + geom_point(size = 1)
3) I further wanted to plot the fitted line between x and y, and the slope should be the partial regression coefficient from the multiple linear regression. That is, it should be the b1 in the following formula: attitude=b1*quality+b2*price+b3*location+b4*Income, rather than the b in the following formula: attitude=b*quality. Therefore, the following code does not work correctly, as it will plot the slope of b rather than b1.
g <- g + geom_smooth(method = lm)
Someone asked a very similar question, see here
The answer provided looks like this (replaced with my variables):
g <- g + geom_smooth(data=data, aes(x=quality, y=attitude, ymin=lcl, ymax=ucl))
However, this is a LOWESS plot (as you can see the figure posted in the post), not a linear straight line plot.
My question: how can I add a straight line of slope b1, with confidence interval band?