gam
object produced by gam()
and produces some diagnostic information
about the fitting procedure and results. The default is to produce 4 residual
plots, and some information about the convergence of the smoothness selection optimization.gam.check(b, old.style=FALSE,
type=c("deviance","pearson","response"),
rep=0, level=.9, rl.col=2, rep.col="gray80", ...)
gam
object as produced by gam()
.TRUE
.residuals.gam
, used in
all plots.qq.gam()
when old.style
is
false, see there.The QQ plot produced is usually created by a call to qq.gam
, and plots deviance residuals
against approximate theoretical quantilies of the deviance residual distribution, according to the fitted model.
If this looks odd then investigate further using qq.gam
. Note that residuals for models fitted to binary data contain very little
information useful for model checking (it is necessary to find some way of aggregating them first), so the QQ plot is unlikely
to be useful in this case.
choose.k
, gam
, mgcv
, magic
library(mgcv)
set.seed(0)
dat <- gamSim(1,n=200)
b<-gam(y~s(x0)+s(x1)+s(x2)+s(x3),data=dat)
plot(b,pages=1)
gam.check(b,pch=19,cex=.3)
Run the code above in your browser using DataLab