I am doing the 5 day regression challenge on Kaggle but I am having trouble getting a poisson regression line to plot when using ggplot. I want to look at the effects of Rain fall on the number of bikes that cross the bridges in NYC.
I have tried reversing the order of geom_point and geom_smooth but that hasn't worked. If I use gaussian instead, that also doesn't work.
Here's what I have written:
ggplot(data = bikes, mapping = aes(x = Precipitation, y = Total)) + geom_smooth(method = "glm", method.args = list(family = "poisson")) + geom_point() + labs(title = 'Precipitation vs. Total Bike Crossings') 