Alternatively to Base R (as explained in Example 1), we can also use theggplot2 packageto draw a scatterplot with a fitted curve. For this, we first have to store our data vectors in a data frame object as shown
In this article, we show that robust Locally Weighted Scatter Plot Smooth, a type of Local Regression Smoothing, which requires minimal data preparation and can be run in many off the shelf statistical packages such as SAS and SPSS, can be just as effective as an early warning system....
Key R function: geom_smooth() Regression line Loess method for local regression fitting Polynomial interpolation Spline interpolation Related Book GGPlot2 Essentials for Great Data Visualization in R Prerequisites Load the ggplot2 package and set the default theme totheme_minimal(): ...