4.5 The Birthrates Example

In this chapter we relaxed the linearity assumption of classical regression by introducing polynomial regression, regression splines, and smoothing splines. All three approaches remain linear in the parameters, so they can still be fit by (penalized) least squares, yet they are flexible enough to capture nonlinear relationships. We now illustrate smoothing splines—the method that requires the least manual tuning of knots—with a classic data set on U.S. birth rates.

The analysis of this data set is available in R and Python.

     

Remark:

In the following Python file, you will also find the code for all the R examples illustrated in this chapter: Examples in Python