I have run polynomial regressions on the data that I am including from Quadratic to Septic but I am stuck trying to plot these regression curves on my scatter plot. I am asking for help creating code that will work for each polynomial order.
Time <- Mangan_2008_total$YearMonthDay
Abundance <- Mangan_2008_total$`Total Nymph Aa`
Above is the code I used to isolate the data I included in this post from the larger data set. Below is the data for reference.
(The dates are currently in the Gregorian calendar format. I plan to convert them to the Julian Days calendar at some point.)
Time
1 20080301
2 20080316
3 20080402
4 20080416
5 20080428
6 20080514
7 20080527
8 20080608
9 20080627
10 20080709
11 20080722
12 20080806
13 20080818
14 20080901
15 20080915
16 20080930
17 20081013
18 20081029
19 20081110
20 20081124
Abundance
1 0
2 0
3 26
4 337
5 122
6 232
7 190
8 381
9 148
10 201
11 69
12 55
13 35
14 15
15 6
16 1
17 0
18 1
19 0
20 0
I compiled that data into a data frame for easier manipulation:
Mangan_2008_nymph <- data.frame(Time, Abundance)
Here is the code for the scatter plot I made in ggplot:
Nymph_2008_Plot <- ggplot(Mangan_2008_nymph, aes(Time, Abundance)) +
geom_point(size=4, col='red') + ggtitle("2008 Amblyomma americanum Abundance") +
xlab("Time") + ylab("Nymph Abundance")
Nymph_2008_Plot
Here is the code I used for the regression analysis (To run higher order polynomial regressions, I simply swapped the 2 (the degree value) for the corresponding polynomial order):
Quadratic_2008_Nymph <- lm(Abundance ~ poly(Time, 2))
summary(Quadratic_2008_Nymph)
This is where I get stuck. How do I graph the polynomial regression curves onto my plot? If there is a way to do this with the ggplot format that would be preferred. If plotting these polynomial curves onto a ggplot plot wont work then I will switch my formatting.
Thanks in advance and comment if I need to clarify/provide more information.

