Question: On the training set, fit two models. The first should be a linear model of `wage` on `year`, `age`, and `education`. The second should be
On the training set, fit two models. The first should be a linear model of `wage` on `year`, `age`, and `education`. The second should be an additive model of `wage` on `year`, `s(age)`, and `education`, using the `gam` package. For the second model, plot the effects fit to each predictor, with `plot()`. Then, use each of these two models to make predictions on the test set, and report the associated test errors. Which model predicts better? What does that tell you about the nonlinearity that we allowed in the additive model for the `age` predictor
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
