What Are Leverage and Cook's Distance?
Leverage measures the influence a single observation has on the fitted values of a regression model. It quantifies how far an independent variable’s value is from the mean of that variable. High leverage points are those observations with extreme predictor values, which can potentially exert significant influence over the estimated regression line.
Cook's distance, on the other hand, provides a more comprehensive measure by considering both the leverage and the residual size of each observation. It assesses how much the predicted values for all data points would change if the corresponding observation were removed from the dataset.
Why Do We Need These Metrics?
The primary reason for using leverage and Cook's distance is to identify influential observations that might be unduly affecting the regression model. Influential points can lead to misleading conclusions about the relationships between variables, making it essential to detect and possibly address them.
By understanding these metrics, analysts can ensure their models are robust and reliable, leading to more accurate predictions and better-informed decision-making processes.
How Are Leverage and Cook's Distance Calculated?
Leverage is calculated as the diagonal elements of the hat matrix (H), which is derived from the design matrix X. Specifically, leverage values are given by hi = x_i^T(X^T X)^{-1}x_i, where x_i represents the ith row of the design matrix.
Cook's distance for an observation i is calculated as D_i = e_i^2 / (p * MSE) * h_i / (1 - h_i), where e_i is the residual for the ith observation, p is the number of parameters in the model, and MSE is the mean squared error.
Real-World Applications
In finance, leverage and Cook's distance can help identify outliers that might be skewing stock price predictions or risk assessments. In healthcare, these metrics are used to detect influential patient data points in predictive models for disease progression.
By applying these diagnostics, researchers and practitioners can ensure their models accurately represent the underlying processes without being unduly influenced by extreme observations.
Frequently asked questions
How do leverage and Cook's distance differ?
Leverage measures how far an observation’s predictor values are from the mean, while Cook's distance considers both the leverage and residual size of each observation to assess its overall influence on the regression model.
Why is it important to identify influential observations in a dataset?
Identifying influential observations helps ensure that the regression model is not unduly affected by extreme data points, leading to more reliable and robust models with accurate predictions.
Can leverage and Cook's distance be used for non-linear regression models?
While primarily developed for linear regression models, these diagnostics can also provide insights in the context of non-linear models by identifying influential points that might affect model fit and predictions.
What threshold values should I use to identify high-leverage or high-Cook's distance observations?
Typically, a leverage value greater than 2 times (p + 1) / n is considered high, where p is the number of parameters and n is the sample size. For Cook’s distance, a threshold of 4/n is often used to flag influential observations.
Try it live
Everything above runs in your browser — open Regression Diagnostics: Leverage & Cook's Distance and change the parameters while it is running. Nothing is installed, nothing is uploaded, the whole model lives in one tab.
▶ Open Regression Diagnostics: Leverage & Cook's Distance simulation