Outliers, Influence and Residual Checks
One odd data point can swing a regression line; learn to spot it, measure its pull, and decide what to do.
Key takeaways
- An outlier is a point far from the pattern of the others; leverage measures how unusual a point's x value is; influence measures how much the fitted line changes if the point is removed.
- A point far out in x has high leverage, and it can bend the line while leaving itself with a small residual.
- A point far from the line but near the average x mostly shifts the intercept, not the slope.
- Plotting residuals against fitted values is the standard way to spot odd points and broken assumptions.
- Never delete a point just because it hurts your result; investigate it, report with and without it, and explain your choice.
Dev runs a food truck. For five weeks he has kept a tidy log: how many social media posts he made, and how much he sold. More posts, more sales. A regression line through the five weeks climbs nicely. Then comes week six. He posted ten times, a record, and then the truck broke down on Saturday. Sales were a sad $300.
One new row in the spreadsheet. Dev reruns the regression and the line, which was climbing, goes almost flat. His whole story about social media just changed because of a single bad week.
That is what this lesson is about. A regression line is built from every point, and not every point gets an equal say. Some points can drag the whole line toward themselves. Good analysts learn to find those points, measure how much they matter, and decide what to do with them, without simply deleting whatever is inconvenient.
Three words that are not the same
People use "outlier" loosely. Statisticians separate three ideas.
An outlier in the y direction is a point whose outcome is surprising given its x. Its residual, the gap between the actual y and the y the line predicts, is large. We met residuals in the line of best fit lesson: the leftover after the line has done its work.
Leverage is about x, not y. A point with an x value far from the average x has high leverage. Think of a seesaw: a child sitting at the far end has more power over the tilt than one sitting near the middle. Leverage tells you how much potential a point has to move the line.
Influence is the actual result: how much the estimates change when you take the point out. A point is influential when it has both something unusual about its x and a y that does not follow the others.
For a simple regression with one x, the leverage of a point has a clean formula:
Leverage is at least 1/n. It grows as x moves farther from the average. The average leverage is 2/n in simple regression.
Here n is the number of observations, x̄ is the average x, and Sxx is the sum of squared gaps of every x from the average. The idea is plain: points near the middle get leverage close to 1 ÷ n, and points far out get more.
A fully worked example
Dev's first five weeks of data (posts per week, sales in hundreds of dollars):
| Week | Posts x | Sales y |
|---|---|---|
| 1 | 1 | 2 |
| 2 | 2 | 3 |
| 3 | 3 | 5 |
| 4 | 4 | 6 |
| 5 | 5 | 8 |
Step 1: the line without week six. The average x is 3 and the average y is 4.8. The gaps from the averages multiply as follows: (−2)(−2.8) = 5.6, (−1)(−1.8) = 1.8, (0)(0.2) = 0, (1)(1.2) = 1.2, (2)(3.2) = 6.4. They add to 15. The squared x gaps are 4, 1, 0, 1, 4, which add to 10.
slope = 15 ÷ 10 = 1.5
intercept = 4.8 − 1.5 × 3 = 0.3
fitted line: sales = 0.3 + 1.5 × posts Each extra weekly post goes with $150 more in sales (1.5 hundreds). The residuals are small: 0.2, −0.3, 0.2, −0.3, 0.2. Since they add to zero, we can trust the arithmetic.
Step 2: add week six, with x = 10 and y = 3. Now n = 6. The x values add to 25, so x̄ = 25 ÷ 6 ≈ 4.167. The y values add to 27, so ȳ = 4.5.
The sum of x times y is 2 + 6 + 15 + 24 + 40 + 30 = 117. The gap-product sum is 117 − (25 × 27) ÷ 6 = 117 − 112.5 = 4.5. The sum of squared x values is 1 + 4 + 9 + 16 + 25 + 100 = 155, so Sxx = 155 − 25² ÷ 6 = 155 − 104.17 = 50.83.
slope = 4.5 ÷ 50.83 ≈ 0.09
intercept = 4.5 − 0.09 × 4.167 ≈ 4.13 The slope fell from 1.5 to about 0.09. A single point wiped out nearly the entire effect.
Step 3: leverage and residual of week six.
leverage = 1/6 + (10 − 4.167)² ÷ 50.83 = 0.167 + 34.03 ÷ 50.83 ≈ 0.836
fitted value at x = 10: 4.13 + 0.09 × 10 ≈ 5.02
residual = 3 − 5.02 ≈ −2.02 Look closely at that residual. It is −2.02, about $200. That is bigger than the others, but it does not look dramatic, because the line has already bent toward the point. Leverage is 0.836, nearly the maximum of 1. So the point grabbed the line, and in doing so hid its own oddness.
The five ordinary weeks give a slope of 1.5. Adding the week-six point at x = 10 drops it to about 0.09.
The two kinds of oddness
Not every strange point is dangerous in the same way. Suppose instead that week six had been a normal-looking 3 posts, but with sales of 10 (a big festival nearby). The y value is a huge surprise. Rerun the numbers: the six x values add to 18, so the average x stays 3; the slope stays at 1.5, and only the intercept rises from 0.3 to about 1.17. Its leverage is just 1/6 ≈ 0.167, the lowest possible, because x sits at the average.
So a point far out in the x direction can wreck the slope. A point far out only in the y direction, with x in the middle, mostly slides the whole line up or down.
The danger zone is the top-right: far out in x and off the pattern in y.
The third cell is worth a note. A high-leverage point that fits the pattern is a gift: it makes the slope more precise and gives the other points a long stretch of x to be measured against. So high leverage is a warning light, not a verdict.
Residual checks: reading the picture
You can always look at the data when there is one x. With many x variables, as in multiple regression, you cannot draw the whole cloud. The workhorse tool is the residual plot: fitted values on the horizontal axis and residuals on the vertical axis.
If the model is working, the residuals look like a shapeless cloud around zero. Patterns tell you what is wrong:
- A curve (a smile or frown). The relationship is not a straight line. Consider squares or logs, as in logs, squares and functional form.
- A fan (narrow on one side, wide on the other). The spread of the errors changes. See heteroskedasticity.
- A wave in time order. Errors that follow each other, as in autocorrelation.
- One or two points far from the rest. Candidates for outliers.
Software also reports standardized residuals, which are residuals divided by their estimated standard deviation so they are comparable. A common rule of thumb flags values beyond about 2 or 3 in size. A related measure, Cook's distance, combines leverage and residual into one number for how much a point moves all the coefficients. Check your software's documentation for its suggested cutoffs, since conventions differ.
The leave-one-out test
The simplest influence check needs no special formula: run the regression again without the point and compare. Dev did this above. The slope changed from 0.09 to 1.5, which is a big change, so week six is highly influential.
Write down what you find and show both versions. If the conclusion survives, you have a robust result. If not, the honest statement is "this result depends on one observation."
Common mistake: deleting the inconvenient point
It is tempting to say, "Week six is weird, so I will drop it." Sometimes that is right. A broken truck is a reason why week six is different from a typical week, and Dev could fairly say his model is about normal weeks. But there are traps.
- Dropping points because they hurt your hypothesis. If you would not have dropped the point had it helped your story, you are cherry-picking.
- Treating every outlier as an error. A point can be real and important. A few billionaires in an income data set are not mistakes. A rare financial crash is a true event. Dropping them hides the part of the world you want to understand.
- Not checking for mistakes first. A salary entered as 5,000,000 instead of 50,000 is a typo. Trace it to the source if you can.
- Dropping silently. If you remove a point, say so, say why, and show results both ways.
A good order of operations:
Investigate first, decide second, report always.
There are middle paths too. You can take logs to squeeze extreme values toward the pack, use a method that downweights extreme points (called robust or median regression), or add a dummy variable for the odd observation. A dummy gives one point its own intercept, so it no longer pulls the rest. That tool is covered in the lesson on dummy variables. All of these are choices to report, not tricks to hide.
Words to know
Outlier an observation that lies far from the general pattern of the others, usually in its y value given x.
Leverage a measure of how far a point's x values are from the average, and so how much power it has to pull the fitted line.
Influence how much the estimated coefficients change when a single observation is removed.
Residual plot a graph of residuals against fitted values used to spot curves, fans and odd points.
Standardized residual a residual divided by its estimated standard deviation so values can be compared on one scale.
Cook's distance a single number that combines a point's leverage and residual to show its total pull on the coefficients.
Check yourself
- In your own words, what is the difference between an outlier and a high-leverage point?
- Without week six, Dev's slope is 1.5 and the intercept is 0.3. What sales does the line predict for 4 posts?
- In the six-point data with x̄ ≈ 4.167 and Sxx ≈ 50.83, find the leverage of a point with x = 10.
- Why is the residual of week six only about −2.02 even though the point is so influential?
- A residual plot shows a clear fan, narrow on the left and wide on the right. What assumption does this suggest is broken?
- Explain why you should report results both with and without a suspicious point instead of simply deleting it.
Show the answers
- An outlier has a surprising y given its x (a large residual), while a high-leverage point has an unusual x far from the average; they can occur together or alone.
- Sales = 0.3 + 1.5 × 4 = 6.3, which is $630.
- Leverage = 1/6 + (10 − 4.167)² ÷ 50.83 = 0.167 + 34.03 ÷ 50.83 ≈ 0.167 + 0.669 = 0.836.
- High leverage means the fitted line bends toward the point, so the line ends up close to it and its own residual is small; influence hides itself.
- It suggests heteroskedasticity, meaning the spread of the errors is not constant, so ordinary standard errors may be wrong.
- Showing both lets readers see whether the conclusion depends on one observation, and it avoids the appearance of cherry-picking only the data that supports the story.