1. Learn
  2. /
  3. Courses
  4. /
  5. Nonlinear Modeling with Generalized Additive Models (GAMs) in R

Exercise

Motorcycle crash data: non-linear approach

Now you will fit a non-linear model to the same mcycle data using the gam() function from the mgcv package.

Instructions

100 XP
  • Load the mgcv package.
  • Fit a model to the mcycle data where accel has a smooth, nonlinear relation to times using the gam() function.
  • Visualize the model fit using the provided call to plot().