Skip to contents

Creates a "comb" plot of studentized residuals versus sequence, highlighting influence and outlier points using a robust outlier heuristic.

Usage

lm_plot.infl(
  mdl,
  opt = list(),
  parm = list(),
  df = lm_plot.df(mdl),
  plts = list()
)

Arguments

mdl

A fitted model object (typically from lm).

opt

List of options (not used).

parm

List of plotting parameters, usually from lm_plot.parms().

df

Data frame with augmented model data. Defaults to lm_plot.df(mdl).

plts

List of ggplot objects to which this plot will be added.

Value

A list containing:

  • mdl Fitted model object,

  • opt List of options (unchanged),

  • parm Parameter list for plotting,

  • df Data frame used for plotting,

  • plts List of ggplot objects, including the $infl element.

Details

The plot visualizes studentized residuals by sequence order, marking regular, outlier, and influential points. Influence thresholds are set using robust outlier detection. Influential and outlier points can be labeled, and influence threshold lines are shown.

Examples

if (FALSE) { # \dontrun{
mdl <- lm(Sepal.Length ~ Sepal.Width, data = iris)
result <- lm_plot.infl(mdl)
print(result$plts$infl)
} # }