Chapter 10. Nonlinear regression with generalized additive models

 

This chapter covers

  • Including polynomial terms in linear regression
  • Using splines in regression
  • Using generalized additive models (GAMs) for nonlinear regression

In chapter 9, I showed you how linear regression can be used to create very interpretable regression models. One of the strongest assumptions made by linear regression is that there is a linear relationship between each predictor variable and the outcome. This is often not the case, so in this chapter I’ll introduce you to a class of models that allows us to model nonlinear relationships in the data.

We’ll start by discussing how we can include polynomial terms in linear regression to model nonlinear relationships, and the advantages and disadvantages of doing this. We’ll then move on to the more sophisticated generalized additive models, which give us considerably more flexibility to model complex nonlinear relationships. I’ll also show you how these generalized additive models can handle both continuous and categorical variables, just like in linear regression.

By the end of this chapter, I hope you’ll understand how to create nonlinear regression models that are still surprisingly interpretable. We will continue to work with the ozone dataset we were using in the previous chapter. If you no longer have the ozoneClean object defined in your global environment, just rerun listings 9.1 and 9.2 from chapter 9.

10.1. Making linear regression nonlinear with polynomial terms

 
 

10.2. More flexibility: Splines and generalized additive models

 

10.3. Building your first GAM

 
 
 
 

10.4. Strengths and weaknesses of GAMs

 
 

Summary

 
 
 

Solutions to exercises

 
sitemap

Unable to load book!

The book could not be loaded.

(try again in a couple of minutes)

manning.com homepage