2024-02-13
Adding regression and smoothing lines to ggplot visualizations
Describing, fitting, and using models
Linear regression
Other regression
Generalized additive models
LOESS smooths
Linear regression
Polynomial model
Quantile regression (fitting line to medians or other quantiles)
Generalized additive model (piecewise splines)
LOESS (local linear and quadratic regression)
Putting multiple smooths on one plot
Smooths on facetted plots
Requires package quantreg
Regression lines (based on a model) and “smooths” (no simple model) can be used to draw attention to patterns in data
We are using smooths for their visual effect
Logical reasoning for the lines you draw is important (next lessons)
Course notes
Healy Chapter 6. Work with models.