1 Definition and purpose
A residual plot is a graphical display that places residuals—differences between observed responses and model predictions—against one or more selected quantities. In practice, it is used to reveal whether the fitted model captures the systematic structure in the data and whether the remaining errors behave in a manner consistent with the model’s assumptions.
1.1 Residuals in statistical modeling
In statistical modeling, a residual for an observation is computed as the observed value minus the corresponding fitted (predicted) value. The collection of residuals summarizes what the model fails to explain. When the model is well matched to the data-generating process, residuals tend to fluctuate randomly around zero with no discernible pattern.
1.2 Role in model diagnostics
Residual plots support diagnostic checking by turning abstract residual behavior into visible structure. Patterns in the scatter—such as systematic curvature, changing spread, or isolated extreme points—often indicate that the model is missing features (e.g., nonlinear relationships), violates assumptions (e.g., nonconstant variance), or is distorted by a small number of influential observations.
1.3 Comparison with other diagnostic plots
Residual plots are frequently used alongside other diagnostic tools, including normal quantile (Q–Q) plots, scale–location plots, leverage plots, and influence measures. While a Q–Q plot focuses on the distribution of residuals, residual plots emphasize how residuals vary with predictors, fitted values, or time. Together, these graphics help distinguish issues related to distributional form from issues related to functional form or heterogeneity of error variance.
2 Construction of a residual plot
Constructing a residual plot requires choosing what to plot on each axis, computing residuals from the fitted model, and adding reference features that help interpret deviations from the expected zero-error pattern.
2.1 Selecting the horizontal axis
The horizontal axis determines what question the residual plot addresses. Common choices include fitted values (to check how residuals change with the model level), individual predictors (to detect missed functional forms), or other derived quantities.
2.1.1 Residuals versus fitted values
Plotting residuals against fitted values examines whether model errors remain stable across the range of predicted responses. It is a common approach because it directly reflects how the model’s prediction magnitude relates to error behavior.
2.1.2 Residuals versus predictors
Plotting residuals against predictors helps identify nonlinearity or missing terms associated with specific variables. If residuals form a curve with respect to a predictor, it suggests that the model’s relationship with that predictor may be misspecified.
2.2 Computing residuals
Residuals are computed from the fitted model. In linear regression, residuals are straightforward differences between observed and predicted responses. In generalized settings, residual definitions vary by method (for example, using deviance residuals or Pearson residuals), but the principle remains: each residual reflects mismatch between observed outcomes and the model’s expected values under the assumed distribution.
2.3 Adding reference lines
A horizontal reference line at zero is typically included to show where residuals would fall if the model predictions matched observations perfectly on average. Some residual plots also add a smooth trend line (e.g., a nonparametric smoother) or confidence bands to highlight systematic patterns rather than random scatter.
3 Common types of residual plots
Different residual plot variants target different diagnostic questions. The choice depends on the modeling context and the assumption under scrutiny.
3.1 Residuals versus fitted values plot
This plot places residuals on the vertical axis and fitted values on the horizontal axis. It is useful for diagnosing nonlinearity in the mean structure and heteroscedasticity, since changing vertical spread or systematic curvature indicates that errors vary with the model’s predicted level.
3.2 Residuals versus predictor plot
Here, residuals are graphed against one explanatory variable at a time. The resulting pattern can indicate whether a predictor has an omitted nonlinear effect, an interaction not included in the model, or a need for variable transformation.
3.3 Normalized and standardized residual plots
Normalized or standardized residual plots rescale residuals to account for differences in variance across observations. Standardization often divides residuals by an estimate of their standard deviation, making it easier to compare residual magnitudes and to spot unusually large departures that are not merely a consequence of varying model-based uncertainty.
3.4 Partial residual plots
Partial residual plots (also called component-plus-residual plots) combine the fitted contribution of a selected term with its corresponding residual component. They are especially helpful in models that use basis expansions or smooth terms, since they reveal the apparent shape of a specific effect while holding the rest of the model constant.
4 Interpretation of patterns
Residual plots are interpreted by looking for structure in the scatter. The goal is not to judge “good-looking” plots, but to connect visible features to plausible violations of model assumptions.
4.1 Random scatter
A healthy residual plot typically shows points scattered randomly around zero without systematic trends or changing variance. In such cases, the model captures the mean relationship adequately, and remaining variability behaves in a roughly consistent manner across fitted levels or predictor values.
4.2 Curvature and nonlinearity
If residuals display a curved pattern relative to fitted values or a predictor, it suggests the model’s functional form is incomplete. For example, a “U-shaped” or “S-shaped” pattern can indicate missing polynomial terms, incorrect link functions, or an omitted nonlinear transformation.
4.3 Heteroscedasticity
Heteroscedasticity appears as a change in the vertical spread of residuals across the horizontal axis. A funnel shape, where residual variance increases or decreases with fitted values, points to nonconstant error variance. This can motivate variance-stabilizing transformations, weighted regression, or robust standard error methods.
4.4 Outliers and influential observations
Residual plots can reveal observations with residuals far from the rest. Outliers may be legitimate data points that are poorly explained by the model, or they may reflect data errors. Some large residuals are also influential: they can substantially affect fitted parameters, especially when they coincide with high leverage.
4.5 Clustering and dependence
Instead of independent noise, residuals may cluster or form patterns over an ordered index such as time or sequence. Autocorrelation can manifest as runs of positive or negative residuals. Dependence may suggest that the model ignores temporal structure, omitted group effects, or other correlation in the error term.
5 Use in regression diagnostics
Residual plots are most widely associated with regression diagnostics, but the underlying logic—checking how errors behave—applies broadly.
5.1 Linear regression
In linear regression, residuals versus fitted values and residuals versus each predictor are central diagnostic tools. They help assess linearity, constant variance, and possible outliers. When combined with standardized residuals, they also support identification of unusually large errors.
5.2 Multiple regression
For multiple regression, residual plots can be generated for fitted values and for each predictor to detect misfit tied to particular covariates. Analysts often examine patterns in each plot separately, since different predictors can require different functional adjustments.
5.3 Logistic regression
For logistic regression, raw residuals are not always directly interpretable due to the nonlinear link between the linear predictor and the mean response. Residual diagnostics therefore often rely on deviance or Pearson residuals. Residual plots can still reveal inadequacies such as lack of fit in the mean structure, unmodeled heterogeneity, or systematic departures across predicted probabilities.
5.4 Time series and autocorrelation checks
In time series contexts, residual plots against time or lagged predictors can highlight serial dependence. A residual plot that shows persistent patterns rather than randomness can indicate that error terms are correlated and that a model accounting for autocorrelation may be needed.
6 Model assumption assessment
Residual plots offer visual checks for several common modeling assumptions, often suggesting targeted remedies when problems are detected.
6.1 Linearity
Linearity refers to the model’s ability to represent the conditional mean as specified. If residuals versus fitted values show curvature or residuals versus predictors show systematic bends, the mean function may be inadequately modeled and may require re-specification.
6.2 Constant variance
Constant variance assumes errors have equal spread across the range of predictor values (or fitted values). Residual plots displaying changing variance provide evidence against this assumption, motivating methods such as transformations, heteroscedasticity-robust inference, or weighted models.
6.3 Independence
Independence concerns whether residuals are uncorrelated across observations. When ordering exists (e.g., time), run patterns or gradual drifts can indicate dependence, implying that independent-error assumptions may be violated.
6.4 Error distribution
Many regression diagnostics rely on assumptions about the distribution of errors. Residual plots do not fully replace distributional checks, but they can signal abnormal behavior such as heavy tails or skewness through extreme residuals or nonuniform patterns. For distribution assessment, residual plots are typically complemented by Q–Q plots and formal tests.
7 Extensions and variations
Residual plotting adapts to broader model classes, including generalized linear models, nonlinear frameworks, and machine learning systems.
7.1 Residual plots for generalized linear models
Generalized linear models use a link function and a specific mean-variance relationship, which affects residual definitions. Residual plots often use deviance residuals or standardized Pearson residuals to make the diagnostics comparable across the fitted range and to highlight departures from the assumed distributional form.
7.2 Residual plots in nonlinear models
For nonlinear parametric models, residual plots are still informative for detecting lack of fit and variance changes. Because fitted values can be more complex functions of parameters, the residual behavior may reveal whether the nonlinear structure captures the data’s mean pattern or misses a systematic relationship.
7.3 Residual plots for machine learning models
Machine learning models may produce fitted values without an explicit error model or parametric error distribution. Residual plots remain useful as descriptive diagnostics: analysts can examine residuals against fitted values, predictions, or key features to identify overfitting patterns, underfitting regions, or heterogeneity in error. However, interpretation should be cautious because many ML methods do not directly define residuals in the same inferential sense as classical regression.
8 Practical considerations
Effective use of residual plots depends on sample size, scaling choices, and careful interpretation of borderline patterns.
8.1 Sample size effects
In small samples, residual plots can appear noisy, making real patterns harder to detect. In large samples, even minor deviations can appear clearly structured, leading to concerns that may not translate into practically meaningful model flaws. Interpreting residual behavior therefore benefits from considering context and magnitude.
8.2 Scale and transformation issues
The scale of the response and predictors influences what patterns are visible. Transformations of the response (or use of alternative link functions) can change residual spread and improve linearity. Analysts often compare residual plots before and after transformations to judge whether changes stabilize variance or reduce systematic curvature.
8.3 Interpreting borderline patterns
Some plots show faint trends rather than obvious shapes. Borderline curvature or slight funneling can be caused by sampling variability, especially when the model includes many predictors. Smoothers and aggregation over bins can help clarify whether the pattern is consistent enough to warrant model changes.
8.4 Software implementation
Most statistical software can generate residual plots automatically for standard regression models, often with options for different residual types and reference lines. Implementation details vary: standardized residuals may use leverage-based variance estimates, while GLM packages may offer multiple residual definitions. Reproducible workflows typically record the model formula, residual type, and plotting settings.
9 Limitations
Residual plots are powerful, but they have constraints that can affect conclusions.
9.1 Subjective interpretation
Reading patterns in scatterplots can be subjective. Two analysts may disagree about whether a mild curve constitutes meaningful nonlinearity. Complementary quantitative diagnostics can reduce this ambiguity.
9.2 Sensitivity to leverage points
Residual plots can be influenced by high-leverage observations, which may produce extreme residuals or dominate visible structure. Distinguishing whether a point is merely unusual versus truly influential often requires leverage and influence diagnostics in addition to residual views.
9.3 Incomplete diagnostic information
A residual plot addresses relationships involving the chosen axes, but it may not detect issues that manifest in other ways. For example, a model could have correct residual behavior versus fitted values yet still fail under a different conditioning variable or in a different subpopulation.
10 Related concepts
Residual plot interpretation is closely connected to several broader ideas in residual analysis and model validation.
10.1 Residual analysis
Residual analysis refers to the systematic examination of residuals using graphical tools, summary statistics, and sometimes formal tests. It is an umbrella concept that includes residual plots, distributional assessments, and investigation of systematic error components.
10.2 Q-Q plot
A Q–Q plot compares the distribution of residuals to a theoretical reference distribution, commonly the normal distribution in classical regression. While residual plots focus on how residuals vary with predictors or fitted values, Q–Q plots focus on whether residuals resemble the assumed distribution.
10.3 Leverage and influence
Leverage measures how much an observation’s predictor values affect its fitted value, and influence measures how much that observation affects overall model parameters. Residual plots reveal unusual errors, but leverage and influence metrics clarify whether those errors materially affect the model fit.
10.4 Model validation
Model validation encompasses procedures used to evaluate predictive performance and adequacy beyond the training sample. Residual diagnostics support model checking, while validation typically uses resampling or holdout data to assess generalization.