This post demonstrates how to manually recreate smoothed line plots produced by ggplot2’s geom_smooth()
and stat_smooth()
functions. This is actually a fairly invovled process, but I’ve found this to be a useful excerise for better understanding what’s going on under the hood with ggplot and for learning how to manually produce similar-looking plots with more fine-tuned model specifications.