11.57 Scatter Plot Smooth Loess


ds %>%
  sample_n(100) %>%
  ggplot(aes(x=min_temp, y=max_temp)) +
  geom_point() +
  stat_smooth(method="loess", formula=y~x)

A smooth curve here fits the statistical loess function for a single smoother line to the points.

The resulting plot uses ggplot2::geom_smooth() with a so called locally weighted scatterplot smoothing method or LOESS to produce the smoothed line. As a result we can observe statistically something of a relationship between the two variables although it is not a simple relationship.

Your donation will support ongoing availability and give you access to the PDF version of this book. Desktop Survival Guides include Data Science, GNU/Linux, and MLHub. Books available on Amazon include Data Mining with Rattle and Essentials of Data Science. Popular open source software includes rattle, wajig, and mlhub. Hosted by Togaware, a pioneer of free and open source software since 1984. Copyright © 1995-2022 Graham.Williams@togaware.com Creative Commons Attribution-ShareAlike 4.0