# NOT RUN {
mtcars$cyl <- as.factor(mtcars$cyl)
mtcars$am <- as.factor(mtcars$am)
library(mgcv)
model1 <- list(
quadratic = lm(mpg ~ cyl + am + qsec + wt + I(wt^2), data = mtcars),
additive = gam(mpg ~ cyl + am + qsec + s(wt), data = mtcars))
ceplot(data = mtcars, model = model1, sectionvars = "wt")
# }
Run the code above in your browser using DataLab