In
statistics, Cook's distance or Cook's ''D'' is a commonly used estimate of the
influence of a data point when performing a least-squares
regression analysis
In statistical modeling, regression analysis is a set of statistical processes for estimating the relationships between a dependent variable (often called the 'outcome' or 'response' variable, or a 'label' in machine learning parlance) and one ...
. In a practical
ordinary least squares
In statistics, ordinary least squares (OLS) is a type of linear least squares method for choosing the unknown parameters in a linear regression model (with fixed level-one effects of a linear function of a set of explanatory variables) by the ...
analysis, Cook's distance can be used in several ways: to indicate influential data points that are particularly worth checking for validity; or to indicate regions of the design space where it would be good to be able to obtain more data points. It is named after the American statistician
R. Dennis Cook
Ralph Dennis Cook (born June 20, 1944) is an American statistician, mostly known for Cook's distance and the Cook–Weisberg test. Cook is a Professor of Statistics at the University of Minnesota.
After graduating from Northern Montana College ...
, who introduced the concept in 1977.
Definition
Data points with large
residuals (
outlier
In statistics, an outlier is a data point that differs significantly from other observations. An outlier may be due to a variability in the measurement, an indication of novel data, or it may be the result of experimental error; the latter are ...
s) and/or high
leverage may distort the outcome and accuracy of a regression. Cook's distance measures the effect of deleting a given observation. Points with a large Cook's distance are considered to merit closer examination in the analysis.
For the algebraic expression, first define
:
where
is the
error term In mathematics and statistics, an error term is an additive type of error. Common examples include:
* errors and residuals in statistics, e.g. in linear regression
In statistics, linear regression is a linear approach for modelling the relati ...
,
is the coefficient matrix,
is the number of covariates or predictors for each observation, and
is the
design matrix
In statistics and in particular in regression analysis, a design matrix, also known as model matrix or regressor matrix and often denoted by X, is a matrix of values of explanatory variables of a set of objects. Each row represents an individual ...
including a constant. The
least squares
The method of least squares is a standard approach in regression analysis to approximate the solution of overdetermined systems (sets of equations in which there are more equations than unknowns) by minimizing the sum of the squares of the r ...
estimator then is
, and consequently the fitted (predicted) values for the mean of
are
:
where
is the
projection matrix (or hat matrix). The
-th diagonal element of
, given by
, is known as the
leverage of the
-th observation. Similarly, the
-th element of the residual vector
is denoted by
.
Cook's distance
of observation
is defined as the sum of all the changes in the regression model when observation
is removed from it
:
where
is the fitted response value obtained when excluding
, and
is the
mean squared error
In statistics, the mean squared error (MSE) or mean squared deviation (MSD) of an estimator (of a procedure for estimating an unobserved quantity) measures the average of the squares of the errors—that is, the average squared difference betwe ...
of the regression model.
Equivalently, it can be expressed using the leverage
[ ():
:
]
Detecting highly influential observations
There are different opinions regarding what cut-off values to use for spotting highly influential points. Since Cook's distance is in the metric of an ''F'' distribution with and (as defined for the design matrix above) degrees of freedom, the median point (i.e., ) can be used as a cut-off. Since this value is close to 1 for large , a simple operational guideline of has been suggested.
Note that the Cook's distance measure does not always correctly identify influential observations.
Relationship to other influence measures (and interpretation)
can be expressed using the leverage[ () and the square of the ''internally'' Studentized residual (), as follows:
:
The benefit in the last formulation is that it clearly shows the relationship between and to (while p and n are the same for all observations). If is large then it (for non-extreme values of ) will increase . If is close to 0 then will be small, while if is close to 1 then will become very large (as long as , i.e.: that the observation is not exactly on the regression line that was fitted without observation ).
is related to ]DFFITS
DFFIT and DFFITS ("difference in fit(s)") are diagnostics meant to show how influential a point is in a statistical regression, first proposed in 1980.
DFFIT is the change in the predicted value for a point, obtained when that point is left out ...
through the following relationship (note that is the ''externally'' studentized residual, and are defined here):
:
can be interpreted as the distance one's estimates move within the confidence ellipsoid that represents a region of plausible values for the parameters. This is shown by an alternative but equivalent representation of Cook's distance in terms of changes to the estimates of the regression parameters between the cases, where the particular observation is either included or excluded from the regression analysis.
An alternative to has been proposed. Instead of considering the influence a single observation has on the overall model, the statistics serves as a measure of how sensitive the prediction of the -th observation is to the deletion of each observation in the original data set. It can be formulated as a weighted linear combination of the 's of all data points. Again, the projection matrix is involved in the calculation to obtain the required weights:
:
In this context, () resembles the correlation between the predictions and .
In contrast to , the distribution of is asymptotically normal for large sample sizes and models with many predictors. In absence of outliers the expected value of is approximately . An influential observation can be identified if
:
with as the median and as the median absolute deviation of all -values within the original data set, i.e., a robust measure of location and a robust measure of scale In statistics, robust measures of scale are methods that quantify the statistical dispersion in a sample of numerical data while resisting outliers. The most common such robust statistics are the ''interquartile range'' (IQR) and the ''median abs ...
for the distribution of . The factor 4.5 covers approx. 3 standard deviations of around its centre.
When compared to Cook's distance, was found to perform well for high- and intermediate-leverage outliers, even in presence of masking effects for which failed.
Interestingly, and are closely related because they can both be expressed in terms of the matrix which holds the effects of the deletion of the -th data point on the -th prediction:
:
With at hand, is given by:
:
where if is symmetric and idempotent, which is not necessarily the case. In contrast, can be calculated as:
:
where extracts the main diagonal of a square matrix . In this context, is referred to as the influence matrix whereas resembles the so-called sensitivity matrix. An eigenvector analysis of and - which both share the same eigenvalues - serves as a tool in outlier detection, although the eigenvectors of the sensitivity matrix are more powerful.
Software implementations
Many programs and statistics packages, such as R, Python, etc., include implementations of Cook's distance.
Extensions
High-dimensional Influence Measure (HIM) is an alternative to Cook's distance for when (i.e., when there are more predictors than observations).High-dimensional influence measure
/ref> While the Cook's distance quantifies the individual observation's influence on the least squares regression coefficient estimate, the HIM measures the influence of an observation on the marginal correlations.
See also
* Outlier
In statistics, an outlier is a data point that differs significantly from other observations. An outlier may be due to a variability in the measurement, an indication of novel data, or it may be the result of experimental error; the latter are ...
* Leverage (statistics)
* Partial leverage
* DFFITS
DFFIT and DFFITS ("difference in fit(s)") are diagnostics meant to show how influential a point is in a statistical regression, first proposed in 1980.
DFFIT is the change in the predicted value for a point, obtained when that point is left out ...
* Studentized residual
Notes
References
Further reading
*
*
*
* {{cite journal, last1=Aguinis, first1=Herman , last2=Gottfredson, first2=Ryan K. , last3=Joo, first3=Harry, year=2013 , title=Best-Practice Recommendations for Defining Identifying and Handling Outliers , url=https://www.researchgate.net/publication/258174106 , journal=Organizational Research Methods , publisher=Sage , volume=16 , issue=2 , pages=270–301 , doi=10.1177/1094428112470848 , s2cid=54916947 , access-date=4 December 2015
Regression diagnostics
Statistical outliers
Statistical distance