plot_residuals: Plot Residual Diagnostics

View source: R/diagnostics.R

plot_residualsR Documentation

Plot Residual Diagnostics

Description

Creates diagnostic plots for model residuals including residuals vs fitted, scale-location, and histogram of residuals.

Usage

plot_residuals(object, type = c("all", "fitted", "histogram", "qq"), ...)

Arguments

object

A fitted model object.

type

Character; type of residual plot. One of:

  • "fitted": Residuals vs fitted values

  • "histogram": Histogram of residuals

  • "qq": Q-Q plot of residuals

  • "all": All plots combined (default)

...

Additional arguments passed to plotting functions.

Value

A ggplot2 object or list of ggplot2 objects.

Examples


data(apt)
fit <- fit_demand_hurdle(apt, y_var = "y", x_var = "x", id_var = "id")
plot_residuals(fit)



beezdemand documentation built on March 3, 2026, 9:07 a.m.