Cook’s distance shows whether one observation has an outsized effect on a regression. The Cook’s distance calculator takes the residual, the leverage, the number of parameters, the mean squared error and the number of observations, and gives Cook’s distance, the standardized residual and the usual cut-offs for distance and leverage.
How the calculation works
- Fit the regression and note, for the observation you are checking, its residual e, its leverage h (the diagonal of the hat matrix), the number of parameters p and the mean squared error (MSE).
- Cook’s distance is D = e² ÷ (p × MSE) × h ÷ (1 − h)². It combines how badly the point fits (the residual) with how much pull it has (the leverage).
- The standardized residual is e ÷ √(MSE × (1 − h)). It tells how large the residual is in standard deviations.
- Common rules of thumb flag a point when D is above 4 ÷ n and treat it as very influential when D is above 1. A leverage above 2 × p ÷ n marks a point far from the others in x.
Example
In a model with p = 3 parameters fitted to n = 40 points, with MSE = 9.5, one point has a residual of 6.2 and a leverage of 0.18. Cook’s distance is 38.44 ÷ 28.5 × 0.18 ÷ 0.6724 = 0.361. The standardized residual is 2.221. The cut-off 4 ÷ n is 0.1, so the point is potentially influential, and its leverage is above the cut-off of 0.15.
Why it matters
A single odd point can tilt a regression line and change a conclusion. Statistical software prints Cook’s distance for every point, and this calculator lets you check a value by hand, understand where it comes from or work from the numbers in a report.
Good to know
The cut-offs are rules of thumb and not tests, and the 4 ÷ n rule flags more points as n shrinks. The leverage and residual must come from the same fitted model, and the residual is the raw residual, not a standardized one. For models with many predictors, look at the plot of all distances together.
Related tools
The linear regression calculator fits a simple model, and the r-squared calculator measures how well it explains the data.