Find a course

Module 3: Inference and DiagnosticsLesson 7 of 1214 min

Regression Assumptions and Diagnostics

Check linearity, independence, normality and equal variance, find outliers, leverage points and influential observations, and choose sensible remedies.

Step 1 of 13Learn

A great fit that was wrong

A student modeled the stopping distance of cars from their speed using 50 test runs. R² was 0.91 and the slope had a tiny p-value. The model predicted that a car at 10 mph needs a negative stopping distance, and it underpredicted stopping distances at high speeds by a dangerous margin.

The residual plot told the story at once: a clear U-shape. Stopping distance grows roughly with the square of speed, not linearly. The straight line was the wrong shape, and the impressive R² hid it.

The standard errors, p-values and intervals in a regression output all rest on assumptions about how the data was generated. When the assumptions fail badly, those numbers can be misleading, sometimes wildly. Checking assumptions isn't a formality; it is how you know whether to believe the output.

The usual assumptions can be remembered with the acronym LINE:

  • Linearity: the mean of y changes linearly with x.
  • Independence: the errors of different observations are independent.
  • Normality: the errors are roughly normally distributed.
  • Equal variance: the spread of the errors is the same for all x.

This lesson explains what each one means, how to check it, what happens when it fails and what to do about it. It also covers unusual points that can single-handedly change a regression.

Step 2 of 13Learn

Checking LINE

Linearity is the most important assumption, because if the shape is wrong, everything built on the line is biased. Check it with the scatterplot and the residual plot: a curve in the residuals is the warning sign.

Independence usually depends on how the data was collected. Random samples of different people are independent. Daily sales from the same store, repeated measurements of the same patients and students within the same classroom often are not. Dependent errors don't bias the slope much, but they make standard errors too small, so p-values look more convincing than they should. For data in time order, plot residuals against time and look for runs; the Durbin-Watson statistic, which is near 2 when residuals are uncorrelated, is a common numeric check.

Normality of the errors matters mostly for small samples and for prediction intervals. Check it with a histogram of residuals or a normal Q-Q plot, where normal residuals fall along a straight line. With large samples, the central limit theorem makes tests on the slope fairly robust to non-normal errors.

Equal variance (homoscedasticity) fails when the residual plot fans out. The slope stays unbiased, but its standard error and the prediction intervals are wrong: too narrow where the spread is large. Note that none of the assumptions require x itself to be normally distributed.

Step 3 of 13Flashcards

LINE: the four assumptions

Tap a card to flip it.

Step 4 of 13Practice · Match the pairs

Match each assumption to the most useful way of checking it.

Tap an answer, then tap the place where it belongs (or drag it there).

  1. Linearity
  2. Equal variance
  3. Normality of errors
  4. Independence

Step 5 of 13Learn

Outliers, leverage and influence

Three kinds of unusual points behave differently:

  • An outlier has a large residual: its y-value is far from what the line predicts. It may be a data error, or a case the model doesn't describe well.
  • A high-leverage point has an x-value far from the others. Like a long lever, it has the potential to pull the line strongly toward itself. In simple regression, leverage depends only on how far x is from x̄.
  • An influential point is one whose removal noticeably changes the slope, the intercept or the conclusions. Influence typically requires high leverage and a y-value that doesn't follow the pattern of the other points.

A high-leverage point that lies right on the line of the other data is not influential; it simply confirms the pattern and makes the slope more precise. A high-leverage point far off the line can rotate the whole line.

The common measure of influence is Cook's distance, which combines leverage and residual size. Rules of thumb flag points with Cook's distance above 1, or above 4/n for a more sensitive screen. The simplest check is often the most convincing: fit the model with and without the suspicious point and compare. If the conclusion changes, report both and investigate the point. Never quietly delete a point just because it is inconvenient.

Step 6 of 13Practice · Diagram

Leverage and residual: four kinds of points

Which kind of point is most likely to change the slope if you delete it?

Tap the shape that answers the question, then press Check.

Leverage and residual: four kinds of pointsTwo-by-two matrix: Outlier, Influential point, Ordinary point, High leverage, on trend.OutlierInfluential pointOrdinary pointHigh leverage, on trendLeverage (unusual x)LowHighResidual sizeSmallLarge
Outlier

Far from the line but with a typical x, so it moves the line only a little.

Influential point

Unusual x and off the trend: it can pull the whole line toward itself.

Ordinary point

Typical x, close to the line.

High leverage, on trend

Unusual x but in line with the others; it firms up the slope.

Step 7 of 13Practice · Choose one

In a regression of 30 cities' public transit use on population, one city has a population five times larger than any other, and its transit use falls exactly where the line through the other cities predicts. How should this point be described?

Step 8 of 13Learn

Remedies when assumptions fail

When diagnostics reveal problems, there are standard remedies:

  • Curvature: transform a variable (logs, square roots) or add a curved term such as x², covered in Module 5. For stopping distance, regressing on speed² fixes the shape.
  • Funnel-shaped residuals: a log transformation of y often stabilizes the spread, especially for money and counts. Alternatively, keep the model but use robust (heteroscedasticity-consistent) standard errors, which most software offers, or weighted least squares.
  • Dependence: use methods designed for the structure, such as models with time-series terms for data in time order, or clustered standard errors and multilevel models for grouped data like students within schools.
  • Non-normal errors in small samples: transformations, or bootstrap confidence intervals that don't rely on normality.
  • Influential points: check the data for errors first. If the point is correct, report results with and without it, or use robust regression methods that limit the influence of any single point.
  • Missing predictors: sometimes a pattern in the residuals means an important variable is missing. Plot residuals against variables not in the model; a trend means that variable belongs in it.

After any fix, recheck the diagnostics. A remedy that solves one problem can create another, such as a transformation that straightens the curve but complicates interpretation.

Step 9 of 13Compare

Diagnose, then remedy

AspectWhat you seeStandard remedy
CurvatureBend in the residual plotTransform, or add x²
Unequal spreadFunnel-shaped residualsLog of y, or robust standard errors
DependenceResiduals track each other over time or groupsTime-series terms, clustered SEs
Influential pointLine moves when one point is droppedCheck data; report with and without

Step 10 of 13Note

Step 11 of 13Practice · What would you do?

What would you do?

A regression of company revenue on number of employees for 25 firms gives a slope of $180,000 per employee. One firm, with far more employees than the others, has unusually low revenue. Without it, the slope is $310,000 per employee. What should you do?

Step 12 of 13Practice · Choose one

A residual plot for a model predicting home prices shows residuals spreading out more and more as predicted prices increase. Which remedy is most commonly appropriate?

Step 13 of 13Practice · True or false

Linear regression requires the explanatory variable x to be normally distributed.