IB Mathematics: Analysis and Approaches · Topic 4 · Statistics and probability
4.10 Regression of x on y
Find the regression line of x on y from data, interpret its coefficients, and use it to predict x for a given y.
1/5The usual regression line predicts y from x
Part 1 of 5: The usual regression line predicts y from x
A teacher records hours studied, , and test score, , for five students. On a scatter plot, the points rise together. The regression line of y on x is the line . It minimises the sum of squared vertical distances to the points.
This line answers one question: given , predict . It always passes through the mean point , where and are the means of the data.
Now suppose the question is reversed. The teacher wants the hours needed to reach a target score. That asks for from , and it needs a different line.
Key term
regression line of y on x
The regression line of y on x is the line that minimises the sum of squared vertical distances from the data points.
Part 2 of 5: The regression line of x on y minimises horizontal distances
To predict from , measure the distances horizontally instead. The regression line of x on y is , chosen to minimise the sum of squared horizontal distances. Its slope uses the covariance , which shows how and vary together.
The line is , where is the variance of . So .
Only the denominator differs from the other line. Both slopes share the numerator , but they divide by the variances of different variables.
The two regression lines compared
- Feature
- Predicts
- y on x
- from
- x on y
- from
- Feature
- Equation
- y on x
- x on y
- Feature
- Distances minimised
- y on x
- vertical
- x on y
- horizontal
- Feature
- Slope
- y on x
- x on y
- Feature
- Passes through
- y on x
- x on y
Key terms · tap one for its definition
regression line of x on y
The regression line of x on y is the line that minimises the sum of squared horizontal distances from the data points.
covariance
The covariance is , a measure of how and vary together.

Quick check
One question on the part you just read
Easy
Show answer and explanation
Answer: A · Worked explanation
Part 3 of 5: A worked calculation gives the equation of x on y
Now apply the formula to the teacher's data. The method has three steps.
Working with deviations from the means keeps the numbers small. A table with columns for , and their products helps to avoid slips.
- Find the means and .
- Find and .
- Substitute into the formula, noting that the factor cancels in the slope.
Worked example
Regression line of x on y
- Means: and .
- Deviations of from 60: . So .
- Products: .
- Slope: .
- Line: .
Answer: , which is
Check the result against the data. The line must pass through . Substituting gives , as required.
Technology gives the same line. Enter the data, then compare its coefficients with your hand calculation as a check.
Part 4 of 5: The coefficients describe how x changes with y
Now look at what the numbers mean. The slope says that rises by about 0.119 hours for each extra mark in . Its sign matches the sign of the covariance.
The constant is the value of when . Here it has no sensible meaning, since a time cannot be negative. Always check whether lies in a sensible range.
Units help with interpretation. Here has units of hours per mark, and is in hours.
Worked example
Predicting the hours needed
- Substitute : .
- Evaluate:
- So
Answer: About 4.19 hours of study

Quick check
One question on the part you just read
Easy
Show answer and explanation
Answer: B · Worked explanation
Part 5 of 5: Predictions are reliable only inside the data range
A prediction is only as good as the data behind it. Predicting for a inside the range of the data is interpolation. Predicting outside that range is extrapolation.
Extrapolation is risky because the pattern may not continue. The data above has scores from 48 to 76. A prediction for is interpolation, but one for is extrapolation.
Scatter matters too. When points lie close to a line, predictions are more reliable. If the points lie exactly on a straight line, both regression lines are the same line.
Key terms · tap one for its definition
interpolation
Interpolation is predicting a value from a regression line for an input inside the range of the data.
extrapolation
Extrapolation is predicting a value from a regression line for an input outside the range of the data.
Check your recall[14 marks]
6 written questions. Answer each one in your head or on paper, then open the mark scheme.
- 1.Distinguish[3 marks]
Distinguish between the regression line of y on x and the regression line of x on y.
Show mark schemeHide mark scheme
Model answer
The line of on predicts from and minimises vertical distances. The line of on predicts from and minimises horizontal distances.
- 1 mark for stating that y on x predicts y from x and x on y predicts x from y
- 1 mark for stating that y on x minimises vertical distances
- 1 mark for stating that x on y minimises horizontal distances
- 2.State[1 mark]
State the point through which both regression lines pass.
Show mark schemeHide mark scheme
Model answer
Both lines pass through the mean point .
- 1 mark for stating the mean point
- 3.Determine[3 marks]
For some data, , , and . Determine the equation of the regression line of on .
Show mark schemeHide mark scheme
Model answer
The slope is . So , which gives .
- 1 mark for finding the slope
- 1 mark for using the mean point
- 1 mark for obtaining
- 4.Calculate[2 marks]
Use the line to calculate the predicted value of when .
Show mark schemeHide mark scheme
Model answer
.
- 1 mark for substituting
- 1 mark for obtaining
- 5.Describe[2 marks]
Describe what the gradient 1.2 in the line tells you about and .
Show mark schemeHide mark scheme
Model answer
For each increase of 1 in , the predicted value of increases by 1.2. The relationship is positive.
- 1 mark for stating that x increases by 1.2 for each unit increase in y
- 1 mark for stating that the relationship is positive
- 6.Explain[3 marks]
The data had values between 20 and 60. Explain why a prediction of for may be unreliable.
Show mark schemeHide mark scheme
Model answer
A value of 200 lies outside the data range, so the prediction is extrapolation. The pattern may not continue that far. The result may even be impossible.
- 1 mark for identifying the prediction as extrapolation
- 1 mark for stating that the pattern may not continue outside the data range
- 1 mark for stating that the result may be unrealistic

Practice this topic
10 quick-fire multiple-choice questions, easy to hard. Tap an answer to see if you're right and the worked explanation. (The written questions with mark schemes are under “Check your recall” above.)
0 right0 of 10 answered
Includes the 2 quick checks in the note above.
EasyState[1 mark]
Show answer and explanation
Answer: D · Worked explanation
MediumDetermine[2 marks]
Show answer and explanation
Answer: A · Worked explanation
MediumCalculate[2 marks]
Show answer and explanation
Answer: B · Worked explanation
MediumPredict[2 marks]
Show answer and explanation
Answer: C · Worked explanation
MediumCalculate[2 marks]
Show answer and explanation
Answer: D · Worked explanation
HardPredict[2 marks]
Show answer and explanation
Answer: A · Worked explanation
HardDetermine[2 marks]
Show answer and explanation
Answer: B · Worked explanation
HardCalculate[2 marks]
Show answer and explanation
Answer: A · Worked explanation