check.gamViz | R Documentation |
Takes a fitted GAM model and produces some diagnostic information about the fitting procedure and results. The default is to produce 4 residual plots, some information about the convergence of the smoothness selection optimization, and to run diagnostic tests of whether the basis dimension choises are adequate.
## S3 method for class 'gamViz'
check(
obj,
type = c("auto", "deviance", "pearson", "response", "tunif", "tnormal"),
k.sample = 5000,
k.rep = 200,
maxpo = 10000,
a.qq = list(),
a.hist = list(),
a.respoi = list(),
...
)
obj |
an object of class |
type |
type of residuals, see residuals.gamViz, used in all plots. |
k.sample |
above this k testing uses a random sub-sample of data. |
k.rep |
how many re-shuffles to do to get p-value for k testing. |
maxpo |
maximum number of residuals points that will be plotted in the scatter-plots.
If number of datapoints > |
a.qq |
list of arguments to be passed to |
a.hist |
list of arguments to be passed to |
a.respoi |
list of arguments to be passed to |
... |
currently not used. |
This is a essentially a re-write of mgcv::gam.check
using ggplot2
. See
mgcv::gam.check for details.
An object of class checkGam
, which is simply a list of ggplot
objects.
library(mgcViz)
set.seed(0)
dat <- gamSim(1, n = 200)
b <- gam(y ~ s(x0) + s(x1) + s(x2) + s(x3), data = dat)
b <- getViz(b)
# Checks using default options
check(b)
# Change some algorithmic and graphical parameters
check(b,
a.qq = list(method = "tnorm",
a.cipoly = list(fill = "light blue")),
a.respoi = list(size = 0.2),
a.hist = list(bins = 10))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.