courses › Probability & Statistics

Correlation & regression

level 43 course

Lines of best fit, residuals, and what r means.

Pen and paper is fine · no calculator needed why?

Learn first (about 3 minutes)

Opens at level 43.

Sign in to start

Builds on: The normal curve (not open yet) · Lines & slope (not open yet)

the lesson

The idea, the techniques and a tip for each skill, right here. The Learn page adds worked examples for every skill and untimed practice.

Read the lesson · about 3 minutes

The idea

A fitted line ŷ = a + bx turns an x into a prediction ŷ. The number a is the prediction when x is 0, and b, the slope, is how much the prediction changes for each extra unit of x. A residual is the miss: actual minus predicted.

The correlation r runs from −1 to 1. Its sign gives the direction, and its size says how tightly the points hug a straight line. r is not a percent, and a strong r alone never proves that one thing causes the other.

Techniques

Multiply, then add

A prediction from a fitted line.

  1. Multiply the slope by the x value first.
  2. Then add the starting value.
worked example

Example: A fitted line says cost = 150 + 12.5 × units. What does it predict for cost when units = 8?

  1. 12.5 × 8 = 100.
  2. 150 + 100 = 250.

Answer: 250

Actual minus predicted

A residual.

  1. Put x into the line to get the prediction.
  2. Residual: actual minus predicted.
  3. A negative residual means the line guessed too high.
worked example

Example: A line predicts ŷ = 4 + 3x. At x = 6 the actual y is 19. What is the residual (actual minus predicted)?

  1. Predicted: 4 + 3 × 6 = 22.
  2. Residual: 19 − 22 = −3.

Answer: −3

Slope from r

The slope of the least-squares line (the standard line of best fit), from r and both SDs.

  1. Multiply r by the standard deviation (SD) of y, the thing you predict.
  2. Divide by the SD of x.
  3. The slope has the same sign as r.
worked example

Example: The correlation between x and y is −0.5. The standard deviation of y is 12 and of x is 8. What is the slope of the least-squares line for predicting y from x?

  1. −0.5 × 12 = −6.
  2. −6 ÷ 8 = −0.75.

Answer: −0.75

Tips by skill

  • TipPredict from a line: Multiply the slope by x first, then add the starting value.
  • TipResidual: Work out the predicted value, then take actual minus predicted. Keep the sign.
  • TipRead a correlation: Sign gives direction. Size, ignoring the sign, gives strength: 0.9 strong, 0.6 moderate, 0.3 weak, 0.1 very weak. Never a percent, never proof of cause.
  • TipSlope from r: Slope = r × SD of y ÷ SD of x. The SD of what you predict goes on top.

Watch out for

  • Adding the starting value to the slope before multiplying by x.
  • Subtracting the wrong way round. A point below the line has a negative residual.
  • Reading r as a percent, or as proof of cause. It says how straight the pattern is and which way it runs.
  • Flipping the ratio. The SD of the thing you predict goes on top.

skills · practice stats

From rounds of this course only: box, review and test-out answers are left out. Once a skill has 40 tries, it compares your first 20 tries with your last 20.

rest ladder

Win 3 of your last 4 rounds and the course rests. A win is 90% right, within 2× the round's par. Pass the review when it comes back and the next rest is longer.

  1. 1 day
  2. 3 days
  3. 7 days
  4. 14 days
  5. 30 days
  6. 60 days
  7. mastered · every 90 days

your rounds

No rounds yet.