cooks.distance {india} | R Documentation |
Cook's distances
Description
Cook's distance is a measure to assess the influence of the ith observation on the model parameter estimates. This function computes the Cook's distance based on leave-one-out cases deletion for ordinary least squares, nonlinear least squares, lad and ridge regression.
Usage
## S3 method for class 'lad'
cooks.distance(model, ...)
## S3 method for class 'nls'
cooks.distance(model, ...)
## S3 method for class 'ols'
cooks.distance(model, ...)
## S3 method for class 'ridge'
cooks.distance(model, type = "cov", ...)
Arguments
model |
an R object, returned by |
type |
only required for |
... |
further arguments passed to or from other methods. |
Value
A vector whose ith element contains the Cook's distance,
D_i(\bold{M},c) = \frac{(\hat{\bold{\beta}}_{(i)} - \hat{\bold{\beta}})^T\bold{M}
(\hat{\bold{\beta}}_{(i)} - \hat{\bold{\beta}})}{c},
for i = 1,\dots,n
, with \bold{M}
a positive definite matrix and c > 0
. Specific
choices of \bold{M}
and c
are done for objects of class ols
, nls
,
lad
and ridge
.
The Cook's distance for nonlinear regression is based on linear approximation, which may be inappropriate for expectation surfaces markedly nonplanar.
References
Cook, R.D., Weisberg, S. (1980). Characterizations of an empirical influence function for detecting influential cases in regression. Technometrics 22, 495-508. doi:10.1080/00401706.1980.10486199
Cook, R.D., Weisberg, S. (1982). Residuals and Influence in Regression. Chapman and Hall, London.
Ross, W.H. (1987). The geometry of case deletion and the assessment of influence in nonlinear regression. The Canadian Journal of Statistics 15, 91-103. doi:10.2307/3315198
Sun, R.B., Wei, B.C. (2004). On influence assessment for LAD regression. Statistics & Probability Letters 67, 97-110. doi:10.1016/j.spl.2003.08.018
Walker, E., Birch, J.B. (1988). Influence measures in ridge regression. Technometrics 30, 221-227. doi:10.1080/00401706.1988.10488370
Examples
# Cook's distances for linear regression
fm <- ols(stack.loss ~ ., data = stackloss)
CD <- cooks.distance(fm)
plot(CD, ylab = "Cook's distances", ylim = c(0,0.8))
text(21, CD[21], label = as.character(21), pos = 3)
# Cook's distances for LAD regression
fm <- lad(stack.loss ~ ., data = stackloss)
CD <- cooks.distance(fm)
plot(CD, ylab = "Cook's distances", ylim = c(0,0.4))
text(17, CD[17], label = as.character(17), pos = 3)
# Cook's distances for ridge regression
data(portland)
fm <- ridge(y ~ ., data = portland)
CD <- cooks.distance(fm)
plot(CD, ylab = "Cook's distances", ylim = c(0,0.5))
text(8, CD[8], label = as.character(8), pos = 3)
# Cook's distances for nonlinear regression
data(skeena)
model <- recruits ~ b1 * spawners * exp(-b2 * spawners)
fm <- nls(model, data = skeena, start = list(b1 = 3, b2 = 0))
CD <- cooks.distance(fm)
plot(CD, ylab = "Cook's distances", ylim = c(0,0.35))
obs <- c(5, 6, 9, 19, 25)
text(obs, CD[obs], label = as.character(obs), pos = 3)