Draw a compact three-panel residual diagnostic figure showing raw residuals versus fitted values, a studentized residual QQ plot, and a studentized residual histogram.

plot_residual_panel(
  fit,
  main_prefix = "Model",
  fitted_jitter = 0,
  hist_breaks = "auto",
  hist_rug = TRUE,
  ...
)

Arguments

fit

A fitted mars object.

main_prefix

Prefix used for the panel titles.

fitted_jitter

Non-negative numeric scalar giving the horizontal jitter amount applied to fitted values in the raw-residual-versus-fitted panel. Use 0 to disable jitter.

hist_breaks

Histogram breaks for the studentized residual panel. Use "auto" to select "Sturges" when fewer than 30 finite studentized residuals are available and "FD" otherwise. Passed to hist() after resolution.

hist_rug

Logical; if TRUE, draw a rug plot beneath the histogram using the finite studentized residuals.

...

Additional arguments passed to the first plot() call.

Value

Invisibly returns a data frame containing the fitted values, jittered fitted values used for plotting, raw residuals, studentized residuals, and the histogram break rule used.