June 2016
Beginner to intermediate
1783 pages
71h 22m
English
In this recipe, we will learn how to use lowess, which is a nonparametric model, and add the resulting prediction curve to a scatter plot.
For this recipe, we don't need to load any additional libraries. We just need to type the recipe in the R prompt or run it as a script.
First, let's create a simple scatter plot with the preloaded cars dataset and add a couple of lowess lines to it:
plot(cars, main = "lowess(cars)") lines(lowess(cars), col = "blue") lines(lowess(cars, f=0.3), col = "orange")

Standard R sessions include the lowess() function. It is a smoother ...
Read now
Unlock full access