Least Squares Regression Lines on the GDC: y on x and x on y | Analysis and Approaches IB Maths notes

Free preview: Least Squares Regression Lines on the GDC: y on x and x on y

The Line of Best Fit, Done Properly

Analysis and approaches and Applications and interpretation: SL and HL (common content, SL 4.4; the x on y line is Analysis and approaches SL 4.10)

Ask ten people to draw a line of best fit by eye on the same scatter diagram and you get ten different lines. Which is "best"? We need a rule everyone agrees on, so that everyone gets the same line and the same predictions.

You met regression lines in the scatter diagram note. Now let's see what "best" means, and how to get the line from your GDC.

The words you need

  • The independent (explanatory) variable x is the one controlled or measured first.
  • The dependent (response) variable y is the one we want to predict.
  • For each point, the vertical gap from the point to the line, e=y−(a+bx), is called its residual.

Eight data points with the regression line y = 11.40 + 1.980x drawn through them; short vertical segments join each point to the line, showing the residuals, some above and some below the line

Following the diagram

  • The line is the regression line of y on x for the eight points from the correlation note.
  • Each short vertical segment is a residual: positive above the line, negative below.
  • The least squares line is the one that makes the sum of the squared residuals as small as possible.
  • Why vertical gaps? Because we are predicting y from x, so errors in y are what matter.

y=a+bx

💡 In plain words

  • b is the gradient: how much y changes, on average, when x goes up by 1.
  • The line always passes through the mean point (x¯,y¯).
  • The IB and most GDCs write the same line as y = ax + b, with a as the gradient. Check which letter multiplies x.

Recipe: the line of y on x on your GDC

  1. Enter x in list 1 and y in list 2, keeping each pair in the same row. Why: the GDC pairs values by row.
  2. Run linear regression with list 1 as x and list 2 as y.
  3. Read the gradient and intercept. Write the line to 3 s.f., with the GDC's letters sorted out.
  4. Keep the full values stored for predictions. Why: rounded values give slightly wrong predictions.
  5. Check: the line passes through the mean point.

Example: the eight points are x = 2, 4, 5, 7, 8, 10, 11, 13 and y = 15, 19, 22, 24, 29, 30, 35, 36.

📝 On your GDC: regression line of y on x

  1. Enter x in list 1 and y in list 2.
  2. Choose your GDC's linear regression tool (the form y = ax + b), with list 1 as x and list 2 as y.
  3. The screen gives a = 1.9795..., b = 11.403... and r = 0.985... (in the GDC's form y = ax + b).
  4. Write the line to 3 s.f.: y = 1.98x + 11.4. Keep the full values stored for predictions.

Check: the line passes through the mean point (7.5, 26.25), since 1.9796 × 7.5 + 11.403 = 26.25.

✏️ YOUR TURN 1

Try this first:

Use your GDC to find the regression line of y on x for the points (1, 3), (2, 5), (3, 4), (4, 7), (5, 8). Check that it passes through the mean point.

Answer:

  • Linear regression gives gradient 1.2 and intercept 1.8: y=1.8+1.2x (here the values are exact).
  • Mean point: x¯=3, y¯=275=5.4. Check: 1.8+1.2×3=5.4 ✓

✏️ YOUR TURN 2

Try this first:

A regression line of y on x has gradient 2.5. The mean point of the data is (4, 18). Find the equation of the line.

Answer:

  • The line passes through (x¯,y¯)=(4,18): 18=a+2.5×4, so a=8.
  • y=8+2.5x.

Predictions, and the Line of x on y

Unlock the full note: start 7 days free.

Log in or subscribe to read the rest of this note. Members also get the AI tutor, practice quizzes, mock exams and flashcards for this topic.

Log in · Subscribe · Start free trial

All notes in Correlation and regression (SL 4.4, 4.10)

  1. Scatter Diagrams, Correlation and Regression Lines
  2. Pearson's Correlation Coefficient r: Meaning and GDC Method
  3. Least Squares Regression Lines on the GDC: y on x and x on y

What's inside for this topic

3 teacher notes, 56 practice questions, 31 flashcards, 2 quizzes.

Get the full notes, every practice question, flashcards, quizzes and mock papers.

Start your free 7-day trial

Questions? Chat with us on WhatsApp · Try one live lesson

Previous note: Pearson's Correlation Coefficient r: Meaning and GDC Method

Least Squares Regression Lines on the GDC: y on x and x on y on other exam boards

All Analysis and Approaches IB Maths topics · IB Maths