I've coded this:
ggplot() +
geom_point(mapping = aes(x = X, y = y)) +
geom_abline(intercept = -0.9930872, slope = 0.4866284, colour = "red") +
geom_abline(intercept = -1, slope = 0.5, colour = "blue")
but cannot seem to get a working legend for my least square and populuation regression line. I've tried various stack overflow answers but nothing seems to give me what I need.
Add a legend to a ggplot2 scatter plot including additional lines
This looked like the best answer, but I can't get it to work!
Any suggestions?