Residual plots and assessing linearity

    Understanding Residuals and Residual Plots

    When we perform linear regression, we are fitting a straight line to a set of bivariate data. The primary goal is to model the relationship between an explanatory variable (x) and a response variable (y). A residual is the difference between an observed value of the response variable and the value predicted by the regression line. Mathematically, it's calculated as: residual = observed y - predicted y, or e = y - ŷ.

    A residual plot is a scatterplot of the residuals against the explanatory variable (x) or against the predicted values (ŷ). The x-axis represents the explanatory variable (or predicted values), and the y-axis represents the residuals. Residual plots are crucial tools for assessing the appropriateness of a linear model.

    Assessing Linearity with Residual Plots

    The main purpose of a residual plot is to determine if a linear model is the most appropriate fit for the data. If the linear model is a good fit, the residual plot should display a random scatter of points with no discernible pattern. Key indicators for assessing linearity are:

    • No obvious pattern: The most important characteristic. If residuals are scattered randomly above and below the x-axis with no clear shape (like a curve or fan shape), it suggests that the linear model is appropriate.
    • Approximately equal scatter: The spread of the residuals should be roughly consistent across all values of the explanatory variable. This indicates that the variability of the response variable is constant for all x-values (a condition known as homoscedasticity). If the spread widens or narrows, it suggests heteroscedasticity and that a linear model might not be the best fit, or that transformations might be needed.
    • No influential points or outliers: Look for individual points that are far away from the bulk of the residuals. These might indicate outliers or points that have a strong influence on the regression line.

    Interpreting Non-Linear Patterns in Residual Plots

    If a residual plot shows a distinct pattern, it suggests that a linear model is not appropriate for describing the relationship between the variables. Common patterns indicating non-linearity include:

    • Curved pattern: If the residuals show a curved shape (e.g., U-shaped or inverted U-shaped), it indicates that the relationship between x and y is non-linear. The linear model systematically overestimates values in some ranges and underestimates them in others. For example, if a plot of residuals vs. x looks like a parabola, it suggests a quadratic relationship would be more appropriate.
    • Fan-shaped pattern: If the spread of the residuals increases or decreases as x increases (forming a cone or fan shape), it indicates that the variability of the response variable is not constant. This violates the assumption of constant variance (homoscedasticity) and suggests a linear model might not be appropriate without data transformation.

    In summary, a well-behaved residual plot supports the use of a linear model. A plot with a pattern or non-constant variance suggests that a linear model may not be the best fit and that other models or transformations should be considered.

    Practice questions

    1

    What does a residual plot with a random scatter of points above and below the x-axis, with no discernible pattern, suggest about the linear model?

    2

    If a residual plot shows a U-shaped pattern, what conclusion can be drawn about the relationship between the explanatory and response variables?

    3

    How is a residual calculated in linear regression?

    4

    What does a fan-shaped pattern in a residual plot indicate about the variability of the response variable?

    Practice more free →

    Free AP4U account — unlimited practice, AI grader, and progress tracking.

    Canonical: https://apforu.com/ap/statistics/unit-2-exploring-two-variable-data/residual-plots-and-assessing-linearity