Learn R Programming

diagL1 (version 1.0.0)

CookDistance: Calculate Cook Distance

Description

Calculate Cook Distance

Usage

CookDistance(model)

Value

Cook Distance

A vector with Cook Distance for each observation.

.

Arguments

model

Object returned from regL1 representing the fit of the L1 model.

References

Sun, R.-B. and Wei, B.-C. (2004). On influence assessment for lad regression. Statistics & Probability Letters, 67, 97-110. tools:::Rd_expr_doi("10.1016/j.spl.2003.08.018").

Examples

Run this code
set.seed(123)
x = matrix(rnorm(100), ncol = 2)
y = x[, 1] + x[, 2] + rlaplace(50, 0, 5)

# Fits a linear regression L1 model
mod1 = regL1(y ~ x)
CookDistance(mod1)

Run the code above in your browser using DataLab