Learn R Programming

auditor (version 0.3.0)

scoreCooksDistance: Score based on Cooks Distance

Description

Cook<U+2019>s distance are used for estimate of the influence of an single observation.

Usage

scoreCooksDistance(object, print = TRUE)

Arguments

object

An object of class ModelAudit.

print

If TRUE progress is printed.

Value

numeric vector

Details

Cook<U+2019>s distance is a tool for identifying observations that may negatively affect the model. They may be also used for indicating regions of the design space where it would be good to obtain more observations. Data points indicated by Cook<U+2019>s distances are worth checking for validity.

Cook<U+2019>s Distances are calculated by removing the i-th observation from the data and recalculating the model. It shows how much all the values in the model change when the i-th observation is removed.

Models of classes other than lm and glm the distances are computed directly from the definition, so this may take a while.

See Also

score

Examples

Run this code
# NOT RUN {
library(car)
lm_model <- lm(prestige~education + women + income, data = Prestige)
lm_au <- audit(lm_model, data = Prestige, y = Prestige$prestige)
scoreCooksDistance(lm_au)


# }

Run the code above in your browser using DataLab