Statistics & Probability · Grade 9

Residuals and the Correlation Coefficient

Quick answer

A residual is the gap between an actual data point and the value a model predicts for it. Plotting every residual shows whether a line was the right model: random scatter means yes, a curve means no. The correlation coefficient r summarizes a straight-line relationship in one number between −1 and 1, with its sign giving direction and its size giving strength.

What you'll learn

  • Calculate and interpret a residual
  • Use a residual plot to judge whether a linear model fits
  • Interpret the correlation coefficient r

A residual is the model’s miss

A line of best fit predicts a value for every xx. The actual data rarely lands exactly on it, and the gap has a name.

residual=actual−predicted\text{residual} = \text{actual} - \text{predicted}

A line predicts test scores from hours studied: y^=7x+32\hat{y} = 7x + 32. A student who studied 55 hours scored 7070.

predicted=7(5)+32=67residual=70−67=3\text{predicted} = 7(5) + 32 = 67 \qquad \text{residual} = 70 - 67 = 3
ResidualWhere the point sitsReads as
positiveabove the linedid better than predicted
zeroon the lineexactly as predicted
negativebelow the linedid worse than predicted

The order matters. Actual minus predicted, always. Reversing it flips every sign and turns “above the line” into “below”.

The hat on y^\hat{y} marks a predicted value, keeping it separate from the yy that was actually measured.

The residual plot

Calculate the residual for every point, then plot each one against its xx. That is a residual plot, and it answers a question the scatter plot cannot answer by eye: was a straight line the right model at all?

Residual plotConclusion
random scatter around zeroa linear model fits
a curved patternthe data is curved; a line is the wrong model
a fan that widensthe line’s errors grow with xx

Random is good. If the line captured the trend, what is left over is noise, and noise has no shape. A pattern in the residuals is trend the line failed to capture.

A residual plot with a curved pattern Nine residuals plotted against x on a grid from 0 to 10 across and -4 to 4 up, with the x-axis marking a residual of zero. The points trace a U shape: about 2 at x = 1, near zero at x = 2, dropping to about -2 around x = 4 to 6, back near zero at x = 8 and about 1.6 at x = 9. 246810-4-224xy
A residual plot with a curved pattern

That U shape means the data bends. A straight line cuts under it at both ends and over it in the middle, so the residuals come out positive, then negative, then positive again. The fix is a different model, often a quadratic or an exponential, not a better line.

Why a curve can hide in a scatter plot

A gently curved cloud of points can look close enough to straight on a scatter plot. The line runs through the middle and seems to fit.

The residual plot takes the trend away and magnifies what remains. Small, systematic misses that were invisible beside a large rising trend become the only thing on the graph.

That is why the residual plot is checked after fitting a line, even one that looked good. The scatter plot shows whether there is a trend; the residual plot shows whether you described it correctly.

The correlation coefficient

The correlation coefficient, rr, summarizes how tightly data follows a straight line in a single number.

−1≤r≤1-1 \le r \le 1
rrMeaning
11perfect positive line — every point on a rising line
close to 11strong positive linear relationship
close to 00weak or no linear relationship
close to −1-1strong negative linear relationship
−1-1perfect negative line

The sign is direction. The distance from zero is strength. An rr of −0.9-0.9 is a stronger relationship than r=0.6r = 0.6, because 0.90.9 is farther from zero. The minus sign only says the line runs downhill.

rr has no units and does not change if you switch units, say from inches to centimeters. It measures the shape of the cloud, not the size of the numbers.

Computing rr by hand is long, and in practice a graphing calculator or a spreadsheet’s CORREL function produces it. The skill that matters is reading it.

What r cannot tell you

ClaimWhy rr does not support it
the relationship is lineara curve can produce a large rr over a short range
there is no relationshipa perfect U shape can give rr close to 00
one causes the otherrr says nothing about why the points line up

A large rr with a curved residual plot means the relationship is strong and not linear. Always pair rr with a look at the residuals.

And a strong correlation is still only a correlation. Correlation is not causation: a third, lurking variable can move both quantities together.

Worked examples

Common mistakes

Practice problems

  1. The actual value is 3030 and the predicted value is 2626. Find the residual.

    Answer

    44

    Full solution

    30−26=430 - 26 = 4.

  2. The actual value is 1212 and the predicted value is 1515. Find the residual.

    Answer

    −3-3

    Full solution

    12−15=−312 - 15 = -3, so the point is below the line.

  3. A point has a residual of 00. Where does it sit?

    Answer

    On the line

    Full solution

    Actual equals predicted.

  4. Using y^=2x+5\hat{y} = 2x + 5, find the residual for the point (6,20)(6, 20).

    Answer

    33

    Full solution

    y^=2(6)+5=17\hat{y} = 2(6) + 5 = 17, and 20−17=320 - 17 = 3.

  5. What range of values can rr take?

    Answer

    From −1-1 to 11

    Full solution

    The ends are perfect straight lines.

  6. Describe r=0.95r = 0.95.

    Answer

    A strong positive linear relationship

    Full solution

    Close to 11 and positive.

  7. Which is stronger, r=−0.4r = -0.4 or r=0.3r = 0.3?

    Answer

    r=−0.4r = -0.4

    Full solution

    0.40.4 is farther from zero than 0.30.3.

  8. A residual plot shows a clear U shape. Is a linear model appropriate?

    Hint

    What does a pattern in the residuals mean?

    Answer

    No

    Full solution

    A pattern in the residuals is trend the line missed.

    A U shape means the line runs under the data at both ends and over it in the middle, so the data curves.

    A quadratic model would suit it better than any straight line.

  9. Ice cream sales and sunburns give r=0.87r = 0.87 across a year. Does eating ice cream cause sunburn?

    Answer

    No

    Full solution

    The correlation is strong, but rr only measures how well the points line up.

    Hot, sunny weather increases both ice cream sales and sunburns. It is a lurking variable, and it explains the correlation without either one causing the other.

  10. Using y^=4x+3\hat{y} = 4x + 3, Kara finds the residual for (5,20)(5, 20) as 23−20=323 - 20 = 3 and says the point is above the line. Find her error.

    Hint

    Which comes first in a residual, actual or predicted?

    Answer

    She subtracted in the wrong order. The residual is −3-3; the point is below the line.

    Full solution

    Kara’s prediction is right: y^=4(5)+3=23\hat{y} = 4(5) + 3 = 23.

    A residual is actual minus predicted. The actual value is 2020, so the residual is 20−23=−320 - 23 = -3.

    A negative residual means the point is below the line — the student did worse than the model predicted.

    Reversing the subtraction changes more than the sign on paper. It reverses the conclusion, putting the point on the wrong side of the line.

Frequently asked questions

What is a residual?

Actual value minus predicted value. A positive residual means the point sits above the line; a negative one means it sits below.

What does a residual plot show?

Whether the model's errors are random. Scattered residuals with no pattern mean the line fits; a curved pattern means the data needs a different model.

What does the correlation coefficient r measure?

How closely data follows a straight line. It runs from −1 to 1: the sign gives the direction and the distance from zero gives the strength.

Does r = 0 mean no relationship?

It means no straight-line relationship. Data can follow a perfect curve and still have r close to zero.

Does a strong correlation prove cause?

No. r measures how well points line up, not why. A lurking variable can drive both quantities.

Standards alignment

This lesson covers the following Common Core State Standards for Mathematics.

  • CCSS.MATH.CONTENT.HSS.ID.B.6aInterpreting Categorical and Quantitative DataFit a function to the data; use functions fitted to data to solve problems in the context of the data.
  • CCSS.MATH.CONTENT.HSS.ID.B.6bInterpreting Categorical and Quantitative DataInformally assess the fit of a function by plotting and analyzing residuals.
  • CCSS.MATH.CONTENT.HSS.ID.C.8Interpreting Categorical and Quantitative DataCompute (using technology) and interpret the correlation coefficient of a linear fit.