A smoother line is a line that is fitted to the data that helps you explore the potential relationships between two variables without fitting a specific model, such as a regression line or a theoretical distribution. Smoother lines are most useful when the curvature of the relationship does not change sharply. Data smoothing can then help to identify simplified changes in order to help predict different trends and patterns.
We’ll use the “palmerpenguins” package for this example
#Data
## Loading required package: ggplot2
ggscatter(x="flipper_length_mm",
y="bill_length_mm",
data=penguins)
## Warning: Removed 2 rows containing missing values (geom_point).
Loess stands for Locally Weighted Scatterplot Smoothing. It is also called ‘weighted smoothing’.
ggscatter(x="flipper_length_mm",
y="bill_length_mm",
add = "loess", # data smoother
data=penguins)
## `geom_smooth()` using formula 'y ~ x'
## Warning: Removed 2 rows containing non-finite values (stat_smooth).
## Warning: Removed 2 rows containing missing values (geom_point).
# Additional Reading