Visualizing auto performance uncertainty
Confidence intervals are a very important visual indicator of model fit. Here you'll practice changing the appearance of confidence intervals and transforming the scale of partial effects plots.
Bu egzersiz
Nonlinear Modeling with Generalized Additive Models (GAMs) in R
kursunun bir parçasıdırEgzersiz talimatları
- Plot the model (
mod) that uses thempgdata, plotting only the partial effect ofweight. Make the confidence interval shaded and"hotpink"in color. - Make another plot of the
weightpartial effect, this time shifting the scale by the value of the intercept using theshiftargument, and including the uncertainty of the model intercept using theseWithMeanargument.
Uygulamalı interaktif egzersiz
Bu örnek kodu tamamlayarak bu egzersizi bitirin.
library(mgcv)
# Fit the model
mod <- gam(hw.mpg ~ s(weight) + s(rpm) + s(price) + comp.ratio,
data = mpg, method = "REML")
# Plot the weight effect with colored shading
plot(mod, select = 1, ___)
# Make another plot adding the intercept value and uncertainty
plot(mod, select = 1, ___)