How to Determine Residuals: A Simple Guide

How to Determine Residuals: A Simple Guide


Understanding the relationship between two variables, x and y, can be achieved using simple linear regression, a statistical technique. In this process, x is referred to as the predictor variable, while y is known as the response variable. To illustrate this concept, let’s consider a dataset consisting of the weight and height measurements of seven individuals.

If we plot this data on a scatterplot, with weight on the x-axis and height on the y-axis, we can observe a general trend: as weight increases, height tends to also increase. However, to precisely quantify this relationship, we need to employ linear regression.

The Line of Best Fit

Linear regression allows us to determine the line that best fits our data. This line can be represented by the formula: ŷ = b0 + b1x, where ŷ is the predicted value of the response variable, b0 is the y-intercept, b1 is the regression coefficient, and x denotes the value of the predictor variable. By substituting the relevant values, we can derive the equation for the line of best fit for our example dataset:

height = 32.783 + 0.2001*(weight)

Calculating Residuals

The data points on our scatterplot don’t always align perfectly with the line of best fit. The discrepancy between a data point and the line is known as a residual. To calculate the residual for a specific data point, we find the difference between its actual value and the predicted value from the line of best fit.

Example 1: Calculating a Residual

Considering the weight and height of our seven individuals, let’s calculate the residual for the first data point. This person weighs 140 lbs. To determine their predicted height, we can use the equation for the line of best fit:

height = 32.783 + 0.2001*(weight)

Plugging in the weight value, we find:

height = 32.783 + 0.2001*(140)

Thus, the predicted height for this individual is 60.797 inches. Consequently, the residual is calculated as 60 – 60.797 = -0.797.

Example 2: Calculating a Residual

We can apply the same principle to calculate the residual for each data point. Let’s consider the second individual in our dataset, who weighs 155 lbs. By substituting the weight value into the line of best fit equation:

height = 32.783 + 0.2001*(weight)

We obtain:

height = 32.783 + 0.2001*(155)

This yields a predicted height of 63.7985 inches. Hence, the residual is computed as 62 – 63.7985 = -1.7985.

Calculating All Residuals

By employing the same method as demonstrated in the previous examples, we can calculate the residuals for all data points. It’s important to note that some residuals are positive while others are negative. However, when we sum all the residuals, they will always add up to zero. This occurs because linear regression minimizes the total squared residuals, resulting in data points lying both above and below the regression line.

Visualizing Residuals

Visual representation of residuals allows us to observe the difference between actual data values and the ones predicted by the regression line. On a scatterplot, residuals are depicted as distances between data points and the regression line. As previously mentioned, some residuals may be larger than others, and they can be positive or negative.

Creating a Residual Plot

One method to assess the quality of the regression line’s fit is by examining the residuals. Larger residuals indicate a poor fit, meaning that the actual data points deviate significantly from the regression line. Conversely, smaller residuals indicate a better fit, suggesting that the actual data points closely align with the regression line. To analyze all residuals at once, a residual plot can be employed. This plot displays the predicted values against the residual values for a regression model. It aids in evaluating the appropriateness of a linear regression model for a given dataset and identifying heteroscedasticity of residuals.

To learn more about creating a residual plot for a simple linear regression model using Excel, refer to this helpful tutorial.

Remember, understanding residuals and their significance is key to comprehending the accuracy and reliability of your linear regression model.