I am doing a multiple regression in r and want to show my regression line. I am using the following code:
ggplot(data = data_all, mapping = aes(x = wsignatory, y = Lifetime_CO2)) +
geom_point(alpha = 0.5, aes(col=wequity_dummy)) +
geom_smooth(method = lm) +
coord_cartesian(ylim = c(0, 200)) +
theme_bw() +
xlab("Weighted Signatory Variable") +
ylab("Lifetime CO2 Emissions")
ggsave("plot_Lifetime_CO2.jpeg")
My data includes a dummy variable called wloan_dummy
, and I want to color does observation points in my plot that have wloan_dummy == 1
. So far, my code shows a color range and the dots appear in light blue, blue, dark blue and black. But as wloan_dummy is a dummy, there should only be two color types. Anybody knows what the reason could be?