This appendix collects exercises for each chapter of the book.
Chapter 2: Introduction
Chapter 3: Getting Started
Chapter 4: Plots of Multivariate Data
Exercise 1 Using the Salaries dataset, create one or more plots to compare different smoothing methods for the relationship between yrs.since.phd and salary shown in Figure 4.5. Include linear regression, quadratic polynomial, and loess smoothers,
Exercise 2 One alternative to a loess smooth, which allows a span argument to control the degree of smoothing is a natural spline, that can be used in geom_smooth() using the argument formula = y ~ splines::ns(x, df=), where df is the equivalent number of degrees of freedom for the spline smoother. Re-do Exercise 1, but trying out this smoothing method for several values of df.