bcat_plt_diag: Regression diagnostic dashboard

View source: R/bcat_plt_diag.R

bcat_plt_diagR Documentation

Regression diagnostic dashboard

Description

Produce a multi-panel diagnostic plot for a fitted model with UC styling. Optionally prints assumption test results (Breusch-Pagan, Shapiro-Wilk, Durbin-Watson) to the console.

Usage

bcat_plt_diag(
  model,
  which = c(1, 2, 3, 4),
  labels = TRUE,
  n_labels = 3,
  tests = TRUE,
  nrow = NULL,
  ncol = NULL
)

Arguments

model

A fitted model object (e.g., lm, glm).

which

Integer vector specifying which panels to include: 1 = Residuals vs Fitted, 2 = Q-Q Plot, 3 = Scale-Location, 4 = Residuals vs Leverage. Default: c(1, 2, 3, 4).

labels

Logical. Label influential observations? Default is TRUE.

n_labels

Integer. Number of extreme observations to label. Default is 3.

tests

Logical. Print assumption test results to console? Default is TRUE.

nrow

Number of panel rows.

ncol

Number of panel columns.

Value

A patchwork object combining the diagnostic panels.

Author(s)

Saannidhya Rawat

See Also

Other plots: bcat_plt_area(), bcat_plt_bar(), bcat_plt_box(), bcat_plt_coef(), bcat_plt_hist(), bcat_plt_line(), bcat_plt_point(), bcat_plt_ts()

Examples

m <- lm(mpg ~ wt + hp + cyl, data = mtcars)
bcat_plt_diag(m)
bcat_plt_diag(m, which = c(1, 2))

Rbearcat documentation built on March 21, 2026, 5:07 p.m.