I want do a bubble plot with the regression line from an analysis I did predicting the proportion of votes for Hillary Clinton over Bernie Sanders in each county's democratic primary. However, geom_smooth() keeps making a line with wrong slope and intercept. The lm out put is this:
Estimate Std. Error t-value p-value
(Intercept) 0.146790 0.058166 2.524 0.011737 *
AssoCareer -0.102984 0.020378 -5.054 4.97e-07 ***
But the graph the comes out looking like this:
My code looks like this:
ggplot(data, aes(x=AssoCareer, y=Prop.H, color="green")) +
geom_point(aes(size =Bins, shape="solid",alpha=.2),pch=21, bg='cyan1') +
geom_text(hjust = 1, size = 2, label=' ') +
coord_cartesian(ylim=c(0,1.5)) +
geom_smooth(method="lm", na.rm=T)+
xlab("County Level Explicit Association Career-Men")+
ylab("Proportion of Hillary Voters")+
ggtitle(paste('Proportion of votes for Clinton over Bernie'))
Can anyone tell why this might be happening?