Tutorials › AP Statistics › Defining a Residual as Observed Minus Predicted

Residuals · Tutorial 881 of 1000

Defining a Residual as Observed Minus Predicted

Use an observed response and its fitted-line prediction to calculate and interpret a single signed residual.

Intermediate 8 min read

What You'll Learn

  • State the residual formula using the observed response and predicted response.
  • Identify the observed and predicted values for one data point.
  • Calculate a prediction from a regression equation before finding its residual.
  • Keep the subtraction in the correct order and retain the residual’s sign.
  • Interpret a residual’s sign and units in the context of the response variable.

Observed Response Compared With a Prediction

A regression line gives a predicted response for a particular predictor value. But an observed case can have a response above or below that prediction. A residual records the signed difference between the observed response and the response predicted by the line.

In “Prediction Versus Observed Values,” the formula for a residual was introduced. Here, we focus on defining and using that formula for one observed data point. The key is to identify the actual observed response \(y\) and the fitted-line prediction \(\hat{y}\) for the same predictor value before subtracting.

Definition: For an observed data point, the residual is the observed response minus the predicted response: $$ \text{residual}=y-\hat{y}. $$ The residual is signed and has the same units as the response variable \(y\).

The hat on \(\hat{y}\) marks a predicted response. It is not the observed response \(y\). A residual compares these two response values for one case; it does not compare two predictor values or compare an observation with the line’s slope.

A Single-Point Residual: A Reliable Routine

A careful calculation has two parts. First, make sure you have the prediction for the observed \(x\)-value. Then subtract that prediction from the observed \(y\)-value. If the problem supplies \(\hat{y}\) directly, you can proceed straight to the subtraction. If it supplies a regression equation instead, evaluate the equation at the data point’s \(x\)-value to find \(\hat{y}\).

1
Match the case.
Identify the observed predictor value \(x\) and observed response \(y\) for the same data point.
2
Find the prediction.
Use the fitted regression equation at that \(x\)-value, or use the supplied predicted response \(\hat{y}\).
3
Subtract in the defined order.
Calculate \(y-\hat{y}\): observed response minus predicted response.
4
Report the signed result.
Keep the plus or minus sign, include response units, and describe the observation as above or below the prediction.

The order of subtraction determines what the sign means. A positive residual means \(y\) is greater than \(\hat{y}\): the observed response is above the line’s prediction. A negative residual means \(y\) is less than \(\hat{y}\): the observed response is below the prediction. A residual of zero means the observed response equals the prediction at that \(x\)-value.

On a scatterplot, this is a vertical comparison: hold \(x\) fixed and compare the point’s observed height \(y\) with the line’s height \(\hat{y}\). The sign tells which is higher. The residual is not an unsigned distance: removing the sign would lose whether the line predicted too high or too low for that case.

Worked Example: Observed Value Above the Prediction

Worked Example: Observed Value Above the Prediction

A fictional greenhouse project uses a fitted line to predict the height of seedlings from the number of days since planting. Let \(x\) be days and \(y\) be seedling height in centimeters. The line is \(\hat{y}=4+1.5x\). For one seedling, the observed value is \(x=8\) days and \(y=18\) centimeters. Calculate and interpret its residual.

State. The observed response is \(y=18\) centimeters. The predicted response must be found from the fitted line at the same predictor value, \(x=8\) days.

Plan. Substitute \(x=8\) into the regression equation to calculate \(\hat{y}\). Then use observed minus predicted, \(y-\hat{y}\), and interpret the signed result in centimeters.

Do. First calculate the prediction:

$$ \hat{y}=4+1.5(8) =4+12 =16\text{ centimeters}. $$

Now subtract the predicted height from the observed height:

$$ \text{residual}=y-\hat{y} =18-16 =2\text{ centimeters}. $$

Conclude. This seedling’s height is 2 centimeters above the height predicted by the fitted line for a seedling observed 8 days after planting. The positive residual is consistent with the observed response, 18 centimeters, being greater than the prediction, 16 centimeters.

Worked Example: Observed Value Below the Prediction

Worked Example: Observed Value Below the Prediction

A fictional school club models quiz scores from time spent reviewing. Let \(x\) be review time in hours and \(y\) be a student’s quiz score in points. The fitted line is \(\hat{y}=42+8x\). One student reviewed for \(x=3\) hours and earned an observed score of \(y=61\) points. Find and interpret the residual.

State. For this student, the observed response is 61 points. The corresponding prediction comes from the fitted line at \(x=3\) hours.

Plan. Evaluate the line at 3 hours, then subtract that predicted score from the observed score. Keep the sign so the result shows whether the observed score is above or below the prediction.

Do. The line predicts:

$$ \hat{y}=42+8(3) =42+24 =66\text{ points}. $$

The residual is:

$$ \text{residual}=y-\hat{y} =61-66 =-5\text{ points}. $$

Conclude. The student scored 5 points below the score predicted by the fitted line for 3 hours of review. The residual is negative because the observed score, 61 points, is less than the predicted score, 66 points.

Notice that “5 points below” describes the direction and size in context, while the numerical residual is \(-5\) points. Reporting only “5 points” would omit the direction; reporting “5 points above” would reverse it.

Worked Example: Prediction Supplied Directly

Worked Example: Prediction Supplied Directly

A fictional community garden tracks water use for individual raised beds. For one bed, the model predicts 26 liters of water on a particular day. The observed water use is 22 liters. Let \(y\) be observed water use and \(\hat{y}\) be predicted water use, both measured in liters. Calculate and interpret this bed’s residual.

State. The observed response is \(y=22\) liters, and the predicted response is \(\hat{y}=26\) liters. Both values refer to the same bed and day, so they can be compared directly.

Plan. Since the prediction is already supplied, no substitution into a regression equation is needed. Apply the definition by subtracting the predicted response from the observed response.

Do.

$$ \text{residual}=y-\hat{y} =22-26 =-4\text{ liters}. $$

Conclude. The bed used 4 liters less water than the model predicted for that day. The residual is negative because observed water use is below predicted water use.

Common Mistakes and AP Exam Tips

For a single point, the arithmetic may be brief, but a complete answer still has to show which value is observed, which is predicted, and how the sign is interpreted. These are common places where a correct calculation can go wrong in the explanation.

  • Reversing the subtraction. The definition is \(y-\hat{y}\), not \(\hat{y}-y\). Write the observed value first and the predicted value second. Reversing them changes the sign and reverses the conclusion.
  • Using the wrong predicted response. If the equation is given, substitute the \(x\)-value for the same observed case. A prediction for a different \(x\)-value cannot be used to calculate that case’s residual.
  • Dropping the sign. A residual of \(-5\) points does not mean the observed response is 5 points above the prediction. Keep the negative sign and say “below”; for a positive residual, say “above.”
  • Giving only an absolute difference. The absolute difference describes the size of the gap but not its direction. The residual is signed, so report its sign as part of the value.
  • Using predictor units. Residuals measure response differences. If \(y\) is in minutes, the residual is in minutes, even if \(x\) is measured in kilometers or hours.
  • Calling the prediction the observation. The line predicts \(\hat{y}\); the data record \(y\). A clear answer labels both before subtracting.

A strong short response shows the calculation and finishes with a contextual statement. For example, “The residual is \(61-66=-5\) points, so this student scored 5 points below the line’s prediction.” That statement makes the subtraction order, sign, units, and meaning clear without claiming that the line guarantees an individual result.

Key takeaway: For one observed data point, calculate the residual as \(y-\hat{y}\): observed response minus predicted response at the same \(x\). Keep the sign and use response units; a positive residual is above the prediction, and a negative residual is below it.

Check Your Understanding

For each question, identify the observed and predicted responses before calculating or interpreting the residual.

  1. A fitted line predicts 34 minutes for an observed case. The actual response is 39 minutes. Find the residual and interpret its sign.
  2. For a data point, \(x=4\), \(y=27\), and the fitted line is \(\hat{y}=9+4x\). Find the predicted response and residual.
  3. A data point has a predicted response of 72 points and a residual of \(-6\) points. Is its observed response above or below the prediction?
  4. A model predicts 15 kilograms, while the observed response is 12 kilograms. Write the residual using the correct subtraction order and include units.
  5. Why must the predicted response used in a residual calculation correspond to the observed point’s own predictor value?