The plot command

Nonlinear Modeling with Generalized Additive Models (GAMs) in R

Noam Ross

Senior Research Scientist, EcoHealth Alliance

The plot command

plot(gam_model)
?plot.gam
Nonlinear Modeling with Generalized Additive Models (GAMs) in R

Nonlinear Modeling with Generalized Additive Models (GAMs) in R

Selecting partial effects

plot(gam_model, select = c(2, 3))
plot(gam_model, pages = 1)
plot(gam_model, pages = 1, all.terms = TRUE)

Nonlinear Modeling with Generalized Additive Models (GAMs) in R

Showing data on the plots

plot(gam_model, rug = TRUE)

Nonlinear Modeling with Generalized Additive Models (GAMs) in R

Showing data on the plots (2)

plot(gam_model, residuals = TRUE)

Nonlinear Modeling with Generalized Additive Models (GAMs) in R

Showing data on the plots (3)

plot(gam_model, rug = TRUE, residuals = TRUE,
     pch = 1, cex = 1)

Nonlinear Modeling with Generalized Additive Models (GAMs) in R

Showing standard errors

plot(gam_model, se = TRUE)

Nonlinear Modeling with Generalized Additive Models (GAMs) in R

Showing standard errors (2)

plot(gam_model, shade = TRUE)

Nonlinear Modeling with Generalized Additive Models (GAMs) in R

Showing standard errors

plot(gam_model, shade = TRUE, shade.col = "lightblue")

Nonlinear Modeling with Generalized Additive Models (GAMs) in R

Transforming standard errors

plot(gam_model, seWithMean = TRUE)

Nonlinear Modeling with Generalized Additive Models (GAMs) in R

Transforming standard errors (2)

plot(gam_model, seWithMean = TRUE, shift = coef(gam_model)[1])

Nonlinear Modeling with Generalized Additive Models (GAMs) in R

Now lets make some plots!

Nonlinear Modeling with Generalized Additive Models (GAMs) in R

Preparing Video For Download...