plot_residuals: Plot residual diagnostics

View source: R/plot_results.R

plot_residualsR Documentation

Plot residual diagnostics

Description

Creates a two-panel diagnostic plot: residuals vs fitted values and a Q-Q plot of residuals.

Usage

plot_residuals(earth_result, response_idx = NULL)

Arguments

earth_result

An object of class "earthUI_result" as returned by fit_earth().

response_idx

Integer or NULL. For multivariate models, which response column to plot (1-based). Default NULL uses the first response.

Value

A ggplot2::ggplot object showing residuals vs fitted values. Use plot_qq() for the Q-Q plot separately.

Examples


result <- fit_earth(mtcars, "mpg", c("cyl", "disp", "hp", "wt"))
plot_residuals(result)


earthUI documentation built on March 26, 2026, 1:07 a.m.