r - Trouble with Slope of a Regression Line in ggplots2 -
i want bubble plot regression line analysis did predicting proportion of votes hillary clinton on bernie sanders in each county's democratic primary. however, geom_smooth() keeps making line wrong slope , intercept. lm out put 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 graph comes out looking this:
my code looks 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 clinton on bernie'))
can tell why might happening?
Comments
Post a Comment