I have 5 plots of the format:
plot1 <- plot_model(Model2015, type = "pred", terms = "Level2") +
geom_point() + geom_line() + scale_y_continuous(limits = c(0, 0.40), breaks = seq(0, 0.40, 0.05))
plot2 <- plot_model(Model2016, type = "pred", terms = "Level2") +
geom_point() +
geom_line() + scale_y_continuous(limits = c(0, 0.40), breaks = seq(0, 0.40, 0.05))
...
And I want to combine them all into one plot. I'm having difficulty finding a functin or package that will let me plot all 5 models onto the same plot, with the same x and y axis, as opposed to having 5 plots side by side.
These are each survey weighted models using the survey package, which is why I have 5 different dataframes instead of one combined dataframe.
I want to end up with one plot with 5 different colored lines, so you can compare the trend in predictions over time.
Tried various packages like gridextra or patchwork, but they all make side-by-side plots.
Edit: Here's more of the code:
Model2015 <- svyglm(spdmon ~ Level2 + Sex + Income + Age + Race + Education + Work, N2015_design)
Model2016 <- svyglm(spdmon ~ Level2 + Sex + Income + Age + Race + Education + Work, N2016_design)
Model2017 <- svyglm(spdmon ~ Level2 + Sex + Income + Age + Race + Education + Work, N2017_design)
Model2018 <- svyglm(spdmon ~ Level2 + Sex + Income + Age + Race + Education + Work, N2018_design)
Model2019 <- svyglm(spdmon ~ Level2 + Sex + Income + Age + Race + Education + Work, N2019_design)
plot1 <- plot_model(Model2015, type = "pred", terms = "Level2") +
geom_point() + geom_line() + scale_y_continuous(limits = c(0.1, 0.40), breaks = seq(0.1, 0.40, 0.1))
plot2 <- plot_model(Model2016, type = "pred", terms = "Level2") +
geom_point() +
geom_line() + scale_y_continuous(limits = c(0, 0.40), breaks = seq(0, 0.40, 0.05))
plot3 <- plot_model(Model2017, type = "pred", terms = "Level2") +
geom_point() +
geom_line() + scale_y_continuous(limits = c(0, 0.40), breaks = seq(0, 0.40, 0.05))
plot4 <- plot_model(Model2018, type = "pred", terms = "Level2") +
geom_point() +
geom_line() + scale_y_continuous(limits = c(0, 0.40), breaks = seq(0, 0.40, 0.05))
plot5 <- plot_model(Model2019, type = "pred", terms = "Level2") +
geom_point() +
geom_line() + scale_y_continuous(limits = c(0, 0.40), breaks = seq(0, 0.40, 0.05))
And what I'm trying to do is place all of the trend lines onto one plot.