There are four plots: top left, down and across:
- QQ chart of balances
- Bar Chart
- Residual vs. linear predictor chart
- Schedule of observations with set values.
In the code below, I assume it bcontains your installed model according to your example. First of all, we need
type <- "deviance"
resid <- residuals(b, type = type)
linpred <- napredict(b$na.action, b$linear.predictors)
observed.y <- napredict(b$na.action, b$y)
, NA, , linear.predictors y, .
10 gam.check(). ,
gam.check
R.
:
QQ plot
qq.gam():
qq.gam(b, rep = 0, level = 0.9, type = type, rl.col = 2,
rep.col = "gray80")
hist(resid, xlab = "Residuals", main = "Histogram of residuals")
plot(linpred, resid, main = "Resids vs. linear pred.",
xlab = "linear predictor", ylab = "residuals")
plot(fitted(b), observed.y, xlab = "Fitted Values",
ylab = "Response", main = "Response vs. Fitted Values")