Model diagnostic plots

appraise(model, ...)

# S3 method for gam
  method = c("direct", "simulate", "normal"),
  n_uniform = 10,
  n_simulate = 50,
  type = c("deviance", "pearson", "response"),
  n_bins = c("sturges", "scott", "fd"),
  ncol = 2,
  level = 0.9,
  ci_col = "black",
  ci_alpha = 0.2,
  point_col = "black",
  point_alpha = 1,
  line_col = "red",

# S3 method for lm
appraise(model, ...)



a fitted model. Currently only class "gam".


arguments passed to cowplot::plot_grid(), except for align and axis, which are set internally.


character; method used to generate theoretical quantiles.


numeric; number of times to randomize uniform quantiles in the direct computation method (method = "direct") for QQ plots.


numeric; number of data sets to simulate from the estimated model when using the simulation method (method = "simulate") for QQ plots.


character; type of residuals to use. Only "deviance", "response", and "pearson" residuals are allowed.


character or numeric; either the number of bins or a string indicating how to calculate the number of bins.


numeric; number of columns to draw plots in. See cowplot::plot_grid().


numeric; the coverage level for QQ plot reference intervals. Must be strictly 0 < level < 1. Only used with method = "simulate".

ci_alpha, ci_col

numeric; the level of alpha transparency for the QQ plot reference interval when method = "simulate", or points drawn in plots.

point_col, point_alpha

colour and transparency used to draw points in the plots. See graphics::par() section Color Specification. This is passed to the individual plotting functions, and therefore affects the points of all plots.


colour specification for the 1:1 line in the QQ plot and the reference line in the residuals vs linear predictor plot.

See also


library(mgcv) set.seed(2) ## simulate some data... dat <- gamSim(1, n = 400, dist = "normal", scale = 2)
#> Gu & Wahba 4 term additive model
mod <- gam(y ~ s(x0) + s(x1) + s(x2) + s(x3), data = dat) ## run some basic model checks appraise(mod, point_col = "steelblue", point_alpha = 0.4)