Examining concurvity between auto variables
Now, let's look at concurvity between model variables.
After examining the pairwise concurvity between variables in mod
, answer the following question:
Which two variables have the greatest worst-case concurvity?
This exercise is part of the course
Nonlinear Modeling with Generalized Additive Models (GAMs) in R
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
library(mgcv)
# Fit the model
mod <- gam(hw.mpg ~ s(length) + s(width) + s(height) + s(weight),
data = mpg, method = "REML")
# Check pairwise concurvity
___