influence_stats {api2lm}R Documentation

Influence statistics

Description

influence_stats returns a data frame with influence-related statistics ordered from the largest to smallest magnitude of the criterion.

Usage

influence_stats(
  model,
  n = 6L,
  rtype = c("studentized", "standardized"),
  criterion = c("cooks", "dffits")
)

Arguments

model

A fitted model object from the lm function.

n

an integer vector of length up to dim(x) (or 1, for non-dimensioned objects). Values specify the indices to be selected in the corresponding dimension (or along the length) of the object. A positive value of n[i] includes the first/last n[i] indices in that dimension, while a negative value excludes the last/first abs(n[i]), including all remaining indices. NA or non-specified values (when length(n) < length(dim(x))) select all indices in that dimension. Must contain at least one non-missing value.

rtype

The residual type to plot on the y-axis. The default is "studentized". The other option is "standardized".

criterion

The criterion that decides the size of the points. The default is "cooks". The other option is "dffits".

Value

A data frame of influence-related statistics.

Author(s)

Joshua French

See Also

rstandard, rstudent, hatvalues cooks.distance, dffits

Examples

lmod <- lm(murder ~ hs_grad + urban + poverty + single,
           data = crime2009)
influence_stats(lmod, n = 3)
influence_stats(lmod, rtype = "stan", crit = "df")

[Package api2lm version 0.2 Index]