Data and model setup
Formula used
hii = diagonal element i of H
Di = [ei2 / (p × MSE)] × [hii / (1 − hii)2]
Leverage measures how unusual an observation is within predictor space. Large residuals describe poor fitted responses. Cook's distance combines both effects to estimate influence.
The value p includes every fitted coefficient, including the intercept. Fixed thresholds are screening rules, not absolute decisions. Always inspect context before removing observations.
How to use
- Paste data or load the supplied example dataset.
- Preview columns, then select one response and several predictors.
- Choose transformations, polynomial terms, interactions, and thresholds.
- Calculate the model and inspect flagged observations.
- Click a chart point to review detailed diagnostics.
- Temporarily exclude suspicious rows and compare model changes.
- Export charts, tables, cleaned data, or a PDF report.
Example data
| Label | Sales | Advertising | Price | Region |
|---|---|---|---|---|
| A01 | 61 | 8 | 14 | North |
| A02 | 66 | 10 | 13 | North |
| A03 | 72 | 13 | 12 | South |
| A11 | 130 | 39 | 6 | West |
| A12 | 58 | 41 | 5 | West |
The full example includes a high-leverage point, a response outlier, and an influential observation.
Frequently asked questions
What is leverage?
Leverage measures how far an observation's predictor values sit from the predictor centre. High leverage does not automatically mean poor data.
What is an influential observation?
An influential observation noticeably changes fitted coefficients or predictions. Cook's distance and DFFITS help quantify that effect.
How is an outlier different?
An outlier has an unusual response after fitting. A high-leverage point has unusual predictor values.
Should high-leverage points be deleted?
No. Verify data quality and subject context first. Compare models before and after any exclusion.
Which leverage threshold is best?
Two times p divided by n is a common screening rule. Three times p divided by n is more conservative.
Why can Cook's distance exceed one?
Cook's distance is not restricted to zero and one. Values near or above one deserve careful inspection.
What does DFFITS show?
DFFITS estimates how much one observation changes its own fitted value. Its sign shows change direction.
What are DFBetas?
DFBetas estimate each observation's standardised impact on every coefficient. Large absolute values indicate coefficient sensitivity.
Can categorical predictors be used?
This version expects numeric model predictors. A text column may still label or colour observations.
Why did the matrix become singular?
Predictors may be duplicated, constant, or perfectly related. Remove redundant terms and calculate again.
Does standardising change leverage?
Pure centring and scaling usually preserve leverage when the same model space remains. They improve numerical stability and interpretation.