# Residual Plots: How to Interpret Them with Examples

A residual plot is a scatterplot of a model's residuals on the vertical axis against the fitted values or a predictor on the horizontal axis. It shows what your regression line failed to explain. If the points scatter randomly around zero with no shape, the linear model is reasonable. If they form a curve, a funnel, or a cluster, the model is missing something.

## Quick Answer

- A residual is the difference between an observed value and the value your model predicts: $e = y - \hat{y}$ [1].
- A residual plot places residuals on the y-axis and fitted values (or a predictor) on the x-axis, with a horizontal line at zero [1].
- Random scatter around zero means the linear form and constant variance assumptions look fine [1][2].
- A curved pattern means the relationship is nonlinear, so a straight line is the wrong model [1][3].
- A funnel or wedge shape means the spread of residuals changes with the fitted value, which is heteroscedasticity [2][3].

## What a Residual Plot Means

A residual is the vertical distance between a data point and the fitted regression line. Positive residuals sit above the line, negative residuals sit below it. Plotting residuals is like tipping the scatterplot over so the regression line becomes a flat horizontal line at zero [1].

The precise definition: for observation $i$, the residual is

$$e_i = y_i - \hat{y}_i$$

where $y_i$ is the observed response and $\hat{y}_i$ is the value the model predicts for that observation. A residual plot graphs $e_i$ against $\hat{y}_i$ (or against a predictor variable $x_i$). The residuals keep their original horizontal positions, but their vertical coordinate becomes the residual instead of the raw response [1].

The point of the plot is to reveal structure that the raw scatterplot hides. Curvature and unequal spread are often too small to see against the scale of the original data, but they become obvious once the linear trend is subtracted [4].

## How It Works

Fitting a line by ordinary least squares (OLS) chooses the intercept $b_0$ and slope $b_1$ that minimize the sum of squared residuals. The model is

$$\hat{y} = b_0 + b_1 x$$

Each symbol means:

- $y$ is the observed response.
- $\hat{y}$ (read "y-hat") is the fitted or predicted response.
- $b_0$ is the intercept, the predicted $y$ when $x = 0$.
- $b_1$ is the slope, the predicted change in $y$ for a one-unit increase in $x$.
- $e = y - \hat{y}$ is the residual.

Two properties always hold for an OLS fit with an intercept. The residuals sum to zero, so their mean is zero. The residuals are also uncorrelated with the fitted values. That is why a well-behaved residual plot centers on the zero line.

When you plot residuals, you are checking four things at once: whether the relationship is linear, whether the spread is constant, whether any points are outliers, and whether the residuals look roughly symmetric [3][5]. For a fuller treatment of the underlying assumptions, see [Understanding Model Assumptions in Statistical Analysis](/blog/guides/understanding-model-assumptions-in-statistical-analysis).

## Worked Example

The dataset is 20 lab measurements of reaction yield (%) at temperatures from 50 to 145 °C.

| temperature_C | yield_pct | temperature_C | yield_pct |
|---|---|---|---|
| 50 | 42.1 | 100 | 63.4 |
| 55 | 44.8 | 105 | 65.0 |
| 60 | 47.2 | 110 | 66.2 |
| 65 | 49.9 | 115 | 67.1 |
| 70 | 52.3 | 120 | 68.0 |
| 75 | 54.1 | 125 | 68.4 |
| 80 | 56.8 | 130 | 68.9 |
| 85 | 58.2 | 135 | 69.1 |
| 90 | 60.5 | 140 | 69.0 |
| 95 | 62.1 | 145 | 68.7 |

We fit a straight line: yield = b0 + b1 × temperature + e.

The OLS fit gives b0 = 31.9191 and b1 = 0.2889, so the fitted line is:

$$\hat{y} = 31.9191 + 0.2889 \times \text{temperature}$$

At 100 °C, the fitted value is 31.9191 + 0.2889 × 100 = 60.8123. The observed yield there is 63.4, so the residual is 63.4 - 60.8123 = 2.5877. That point sits above the line.

The fit reports R² = 0.9203, which sounds strong. The residuals have mean -0.0000 and standard deviation 2.5149, and they range from -5.1143 to 2.7430.

Here is the code that produced these numbers:

```python
import statsmodels.api as sm
X = sm.add_constant(df['temperature'])
model = sm.OLS(df['yield'], X).fit()
resid = model.resid
fitted = model.fittedvalues
b0, b1 = model.params
print(f"OLS fit: yield = {b0:.4f} + {b1:.4f}*temperature, R^2 = {model.rsquared:.4f}. Residuals range from {resid.min():.4f} to {resid.max():.4f} with mean {resid.mean():.4f}.")
```

Output:

```
OLS fit: yield = 31.9191 + 0.2889*temperature, R^2 = 0.9203. Residuals range from -5.1143 to 2.7430 with mean -0.0000.
```

Now plot the residuals against the fitted values. The points do not scatter randomly. They rise in the middle and fall at both ends, forming an inverted U, or arch. The residuals are strongly negative at low and high temperatures and positive in the middle. That arch-shaped pattern means the linear model is inadequate, and a quadratic term is suggested. The high R² did not warn us. The residual plot did.

## How to Interpret It

Read the shape, not the individual points.

| Pattern in the residual plot | What it means | What to do |
|---|---|---|
| Random scatter around zero, no shape | Linear form and constant variance look fine [1] | Keep the model |
| U-shape or arch | Nonlinear relationship [1][3] | Add a quadratic term or transform a variable |
| Funnel or wedge (spread grows with fitted value) | Heteroscedasticity, non-constant variance [2][3] | Transform the response, such as a log transform |
| One point far from the rest | Outlier [3] | Check the data point, then consider a robust fit |
| Residuals drift up or down in time order | Time trend or autocorrelation [4][2] | Use a time-series model |

A few practical rules help. Look at the overall cloud first, not single points. Judge whether the vertical spread is roughly the same across the whole horizontal range [5]. Check whether the residuals are symmetric around zero. If the plot looks like a random cloud with no tilt, curve, or funnel, the linear model is doing its job.

## When to Use It (and when not to)

Use a residual plot every time you fit a regression and want to check the fit. It is the standard diagnostic for linearity and constant variance [1][2]. It also helps you spot outliers and see whether a transformation improved things. If you are comparing two models, plot the residuals of each and see which one looks more random.

Do not use a residual plot to prove that a model is correct. It can only show problems, not confirm that all assumptions hold. Do not use it as your only diagnostic either. A normal probability plot of the residuals checks normality, and a run-order plot checks independence over time [4][5]. For censored outcome data, standard residual plots become less appropriate and need a refined method [6].

## Residual Plot vs Scatterplot of the Raw Data

Both plots use the same observations, but they answer different questions.

| Feature | Raw scatterplot | Residual plot |
|---|---|---|
| Vertical axis | Observed response $y$ | Residual $e = y - \hat{y}$ |
| Horizontal axis | Predictor $x$ | Fitted value $\hat{y}$ or predictor $x$ |
| Shows | Overall trend and spread | What the model missed |
| Best for | Seeing the relationship | Checking model fit |
| Curvature | Often hidden by scale | Easy to see [4][3] |

The raw scatterplot shows the trend. The residual plot removes that trend so you can inspect the leftovers. Nonlinearity and heteroscedasticity are usually easier to see in the residual plot than in the original scatterplot [3].

## Common Mistakes

- Judging fit by R² alone. A high R² can hide a curved residual pattern, as the worked example shows. Always plot the residuals.
- Reading single points as patterns. One unusual point is an outlier, not a trend. Look at the whole cloud before drawing conclusions.
- Plotting residuals against the response instead of the fitted values. The standard diagnostic uses fitted values or a predictor on the x-axis [1][2].
- Ignoring a funnel shape. Growing spread means the variance assumption fails, which distorts standard errors and p-values [2].
- Forgetting to check time order. A random-looking residual plot can still hide autocorrelation. Use a run-order plot when observations have a sequence [4].
- Assuming a random-looking plot proves the model is right. It only means no problem is visible. Other checks still matter [5].

## Limitations

A residual plot is a visual tool, so it depends on your judgment. Two analysts can look at the same plot and disagree about whether a pattern is real or just noise. With small samples, random scatter can look structured by chance, and real curvature can be hard to see.

The plot also cannot tell you which fix is correct. It can show that a linear model fails, but choosing between a quadratic term, a log transform, or a different model is a separate decision. Residual plots for censored data need special methods because the standard plot misleads when some outcomes are cut off [6]. For a related check on spread and outliers, see [Box Plot Outliers: How to Identify and Interpret Them](/blog/data-analysis/box-plot-outliers).

## Frequently Asked Questions

### What does a good residual plot look like?

A good residual plot shows points scattered randomly around the zero line with no curve, no funnel, and no obvious clusters. The vertical spread should be roughly the same across the whole range of fitted values [1][5]. If you cannot see a shape, the linear model is probably reasonable.

### What does a curved residual plot mean?

A curved pattern, such as a U shape or an arch, means the relationship between the predictor and the response is nonlinear [1][3]. A straight line cannot capture it. The fix is usually to add a polynomial term or transform a variable, then refit and check the residuals again.

### What is the difference between residuals and a residual plot?

A residual is a single number, the difference between one observed value and its fitted value [1]. A residual plot is the graph of all residuals together. The numbers tell you the size of each miss. The plot tells you whether the misses follow a pattern.

### Why is my residual plot funnel-shaped?

A funnel shape means the spread of residuals grows as the fitted values grow. This is heteroscedasticity, and it violates the constant variance assumption [2][3]. It makes standard errors unreliable. A common fix is to transform the response, such as taking the log, then refit the model.

### Can a residual plot show outliers?

Yes. Outliers appear as unusually large positive or negative residuals, far from the rest of the cloud [3]. They are often easier to spot in a residual plot than in the raw scatterplot. Once you find one, check whether it is a data entry error or a genuine extreme value before deciding what to do.

## References

1. [7.2: Line Fitting, Residuals, and Correlation - Statistics LibreTexts](https://stats.libretexts.org/Bookshelves/Introductory_Statistics/OpenIntro_Statistics_(Diez_et_al)./07%3A_Introduction_to_Linear_Regression/7.02%3A_Line_Fitting_Residuals_and_Correlation)
2. [5.2.4. Are the model residuals well-behaved?](https://www.itl.nist.gov/div898/handbook/pri/section2/pri24.htm)
3. [](https://www.stat.berkeley.edu/~stark/SticiGui/Text/regressionDiagnostics.htm)
4. [4.6.1.4. Graphical Residual Analysis - Initial Model](https://www.itl.nist.gov/div898/handbook/pmd/section6/pmd614.htm)
5. [1.2.4. Interpretation of 4-Plot](https://www.itl.nist.gov/div898/handbook/eda/section2/eda24.htm)
6. [Law M, Jackson D. (2016). Residual plots for linear regression models with censored outcome data: A refined method for visualizing residual uncertainty. Communications in statistics: Simulation and computation](https://pmc.ncbi.nlm.nih.gov/articles/PMC7614636/)

## Further Reading

- [NIST/SEMATECH e-Handbook of Statistical Methods](https://www.itl.nist.gov/div898/handbook/index.htm)

## Related Articles

- [Box Plot Outliers: How to Identify and Interpret Them](/blog/data-analysis/box-plot-outliers)
- [What Are Residuals in Statistics? Definition and Formula](/blog/data-analysis/what-are-residuals-in-statistics)
- [Semi-Log Plot: Definition, When to Use It and Examples](/blog/data-analysis/semi-log-plot-definition-examples)
- [What Is a Line Plot? Definition and Examples](/blog/data-analysis/what-is-a-line-plot)
- [Pie Chart Examples: When They Work and When They Mislead](/blog/data-analysis/pie-chart-examples-when-to-use)
- [ggplot2 Tutorial for Beginners: Publication-Ready Plots for Lab Data](/blog/research-skills/how-to-make-publication-ready-plots-with-ggplot2)
- [Residual Sum of Squares: Formula and Example](/blog/research-skills/residual-sum-of-squares-formula-and-example)
- [How to Make and Read a Box Plot: Quartiles, Whiskers and Outliers](/blog/research-skills/how-to-make-a-box-plot)