Scribe logoScribeNotes & practice
Sign inStart free
  1. Notes
  2. ›IB Mathematics: Analysis and Approaches
  3. ›4 Statistics and probability
  4. ›4.4 Correlation and regression

IB Mathematics: Analysis and Approaches · Topic 4 · Statistics and probability

4.4 Correlation and regression

Interpret scatter diagrams, classify correlation, and find the equation of a regression line from data.

  • 4 min read
  • 5 parts
  • 10 questions
  • Draft
Start a Quick 5 on this topic→Jump to the 10 questions
1/5A scatter diagram shows how two variables relate
  1. 1A scatter diagram shows how two variables relate
  2. 2Correlation describes the direction and strength of a linear link
  3. 3The regression line is the best-fitting straight line
  4. 4The mean point and gradient give the equation
  5. 5Predictions are reliable only within the range of the data
  6. Check your recall
  7. Practice: 10 questions
1

Part 1 of 5: A scatter diagram shows how two variables relate

A teacher records the hours each student spent revising and the student’s test mark. Every student gives a pair of values. Data in pairs like this are bivariate data.

Plot each pair as a point, with the explaining variable on the horizontal axis. The result is a scatter diagram. It shows a pattern before you calculate anything.

Here, revision time xxx is the variable we use to explain the mark yyy. Look for the overall direction, how tightly the points cluster, and any point far from the rest.

Exam tip

Label each axis with the variable and its units. Put the explaining variable on the horizontal axis.

Key terms · tap one for its definition

bivariate data

Bivariate data are data in which two variables are measured for each item, giving pairs of values (x,y)(x,y)(x,y).

scatter diagram

A scatter diagram is a graph in which each pair of values (x,y)(x,y)(x,y) is plotted as one point.

Part 1 done

2

Part 2 of 5: Correlation describes the direction and strength of a linear link

Points that rise from left to right show that yyy tends to increase as xxx increases. Points that fall show the opposite. This kind of linear association between two variables is called correlation.

The correlation coefficient rrr (Pearson’s product-moment) puts a number on it, with −1≤r≤1-1\le r\le1−1≤r≤1. The sign gives the direction. Values near ±1\pm1±1 mean the points lie close to a line.

Reading the pattern and the value of r

PatternValue of rName
Points rise, close to a lineclose to +1+1+1strong positive
Points fall, close to a lineclose to -1strong negative
Points loosely follow a trendnearer 0weak
No visible patternabout 0none
Pattern
Points rise, close to a line
Value of r
close to +1+1+1
Name
strong positive
Pattern
Points fall, close to a line
Value of r
close to -1
Name
strong negative
Pattern
Points loosely follow a trend
Value of r
nearer 0
Name
weak
Pattern
No visible pattern
Value of r
about 0
Name
none

The coefficient measures only linear association. A clear curve can still give rrr close to 0.

Common mistake

A high value of ∣r∣|r|∣r∣ shows association, not cause. A third factor may drive both variables.

Key terms · tap one for its definition

correlation

Correlation is the strength and direction of the linear association between two variables.

correlation coefficient

The correlation coefficient rrr is a number from -1 to +1+1+1 measuring the strength and direction of linear association.

Part 2 done

Quick check

One question on the part you just read

Easy

Identify the correlation shown when points rise from left to right and lie close to a straight line.
Show answer and explanation

Answer: A · Worked explanation

Points that rise as xxx increases show positive correlation. Points lying close to a line show that it is strong. Strong negative correlation would have points falling from left to right, and weak correlation would show a wide scatter. Check both the direction and the closeness of the points before naming the correlation.
3

Part 3 of 5: The regression line is the best-fitting straight line

To make predictions, we draw one straight line through the points. The regression line of yyy on xxx is the line y=ax+by=ax+by=ax+b that fits best. It minimises the sum of the squared vertical distances from the points to the line.

The line always passes through the mean point (xˉ,yˉ)(\bar{x},\bar{y})(xˉ,yˉ​). Its gradient uses the covariance sxys_{xy}sxy​ and the variance of the xxx-values, sx2s_x^2sx2​.

The equation is y−yˉ=sxysx2(x−xˉ)y-\bar{y}=\frac{s_{xy}}{s_x^2}(x-\bar{x})y−yˉ​=sx2​sxy​​(x−xˉ), where sxy=∑xyn−xˉyˉs_{xy}=\frac{\sum xy}{n}-\bar{x}\bar{y}sxy​=n∑xy​−xˉyˉ​ and sx2=∑x2n−xˉ2s_x^2=\frac{\sum x^2}{n}-\bar{x}^2sx2​=n∑x2​−xˉ2. A calculator’s linear regression function gives the same line. The vertical distances are the gaps between each observed yyy and the value the line predicts.

Key terms · tap one for its definition

regression line

The regression line of yyy on xxx is the line y=ax+by=ax+by=ax+b that minimises the sum of the squared vertical distances to the points.

covariance

The covariance sxys_{xy}sxy​ is the mean of the products xyxyxy minus the product of the means, ∑xyn−xˉyˉ\frac{\sum xy}{n}-\bar{x}\bar{y}n∑xy​−xˉyˉ​.

Part 3 done

4

Part 4 of 5: The mean point and gradient give the equation

Now apply the formula to data. Each student has a revision time xxx in hours and a mark yyy. Work out the two means first. Then find the sums that the covariance and variance need.

Worked example

Finding a regression line

Five students revise for x=1,2,3,4,5x=1,2,3,4,5x=1,2,3,4,5 hours and score y=2,4,5,4,6y=2,4,5,4,6y=2,4,5,4,6 marks. Find the regression line of yyy on xxx.
  1. 1
    Means: xˉ=155=3\bar{x}=\frac{15}{5}=3xˉ=515​=3 and yˉ=215=4.2\bar{y}=\frac{21}{5}=4.2yˉ​=521​=4.2.
  2. 2
    Sums: ∑xy=2+8+15+16+30=71\sum xy=2+8+15+16+30=71∑xy=2+8+15+16+30=71 and ∑x2=55\sum x^2=55∑x2=55.
  3. 3
    Covariance: sxy=715−3×4.2=14.2−12.6=1.6s_{xy}=\frac{71}{5}-3\times4.2=14.2-12.6=1.6sxy​=571​−3×4.2=14.2−12.6=1.6.
  4. 4
    Variance of xxx: sx2=555−32=11−9=2s_x^2=\frac{55}{5}-3^2=11-9=2sx2​=555​−32=11−9=2.
  5. 5
    Gradient: 1.62=0.8\frac{1.6}{2}=0.821.6​=0.8, so y−4.2=0.8(x−3)y-4.2=0.8(x-3)y−4.2=0.8(x−3).

Answer: The regression line is y=0.8x+1.8y=0.8x+1.8y=0.8x+1.8.

Figure 1. The line passes through the mean point, with the data points lying close to it.

For these data r≈0.853r\approx0.853r≈0.853, a strong positive correlation. The gradient 0.8 means each extra hour of revision adds 0.8 marks on average. The intercept 1.8 is the predicted mark for no revision. The line rises from left to right, matching the positive correlation. Points above the line scored more than predicted, and points below scored less.

Part 4 done

Quick check

One question on the part you just read

Easy

Identify which value of rrr shows the strongest linear association.
Show answer and explanation

Answer: B · Worked explanation

Strength depends on how close ∣r∣|r|∣r∣ is to 1, not on the sign. Here ∣−0.9∣=0.9|-0.9|=0.9∣−0.9∣=0.9 is the largest, so the points lie closest to a line sloping downward. The value 0.7 is tempting because it is positive, but a positive sign does not mean a stronger link.
5

Part 5 of 5: Predictions are reliable only within the range of the data

A regression line predicts yyy for a given xxx. Predicting inside the range of the data is interpolation. It is usually reliable when ∣r∣|r|∣r∣ is close to 1.

Predicting outside that range is extrapolation. The pattern may not continue, so the result is less reliable. For x=6x=6x=6 in the example, the line gives 0.8×6+1.8=6.60.8\times6+1.8=6.60.8×6+1.8=6.6 marks.

The line of yyy on xxx predicts yyy from xxx. Do not use it to predict xxx from a given yyy. A different line is needed for that.

Exam tip

When you comment on a prediction, say whether it is interpolation or extrapolation, and refer to the strength of rrr.

Key terms · tap one for its definition

interpolation

Interpolation is using a regression line to predict yyy for a value of xxx inside the range of the data.

extrapolation

Extrapolation is using a regression line to predict yyy for a value of xxx outside the range of the data.

Note read

Check your recall[15 marks]

6 written questions. Answer each one in your head or on paper, then open the mark scheme.

  1. 1.Distinguish[3 marks]

    Distinguish between positive, negative and zero correlation.

    Show mark schemeHide mark scheme

    Model answer

    Positive correlation means yyy tends to increase as xxx increases, with r>0r>0r>0. Negative correlation means yyy tends to decrease as xxx increases, with r<0r<0r<0. Zero correlation means no linear pattern, with rrr near 0.

    • 1 mark for describing positive correlation as yyy increasing with xxx
    • 1 mark for describing negative correlation as yyy decreasing as xxx increases
    • 1 mark for describing zero correlation as no linear pattern
  2. 2.State[1 mark]

    State the range of possible values of the correlation coefficient rrr.

    Show mark schemeHide mark scheme

    Model answer

    −1≤r≤1-1\le r\le1−1≤r≤1.

    • 1 mark for stating −1≤r≤1-1\le r\le1−1≤r≤1
  3. 3.Explain[2 marks]

    Explain why a strong correlation between two variables does not prove that one causes the other.

    Show mark schemeHide mark scheme

    Model answer

    Correlation measures only association between the variables. A third factor may drive both, or the link may be a coincidence.

    • 1 mark for stating that correlation shows association and not cause
    • 1 mark for giving a reason such as a third factor affecting both variables
  4. 4.Determine[4 marks]

    Determine the equation of the regression line of yyy on xxx for the points (1, 3), (2, 5), (3, 6) and (4, 10).

    Show mark schemeHide mark scheme

    Model answer

    xˉ=2.5\bar{x}=2.5xˉ=2.5 and yˉ=6\bar{y}=6yˉ​=6. sxy=714−2.5×6=2.75s_{xy}=\frac{71}{4}-2.5\times6=2.75sxy​=471​−2.5×6=2.75 and sx2=304−2.52=1.25s_x^2=\frac{30}{4}-2.5^2=1.25sx2​=430​−2.52=1.25. The gradient is 2.751.25=2.2\frac{2.75}{1.25}=2.21.252.75​=2.2. Then y−6=2.2(x−2.5)y-6=2.2(x-2.5)y−6=2.2(x−2.5), so y=2.2x+0.5y=2.2x+0.5y=2.2x+0.5.

    • 1 mark for finding the means xˉ=2.5\bar{x}=2.5xˉ=2.5 and yˉ=6\bar{y}=6yˉ​=6
    • 1 mark for finding sxy=2.75s_{xy}=2.75sxy​=2.75
    • 1 mark for finding sx2=1.25s_x^2=1.25sx2​=1.25 and the gradient 2.2
    • 1 mark for writing the equation y=2.2x+0.5y=2.2x+0.5y=2.2x+0.5
  5. 5.Calculate[3 marks]

    Calculate the predicted test mark for x=6x=6x=6 hours of revision using the regression line y=1.5x+4y=1.5x+4y=1.5x+4, which was found from data with xxx from 2 to 10. Comment on using the line for x=30x=30x=30.

    Show mark schemeHide mark scheme

    Model answer

    For x=6x=6x=6, y=1.5×6+4=13y=1.5\times6+4=13y=1.5×6+4=13. The value x=30x=30x=30 lies outside the data range, so using it is extrapolation and the prediction is unreliable.

    • 1 mark for substituting x=6x=6x=6 to obtain 13
    • 1 mark for stating that x=30x=30x=30 is outside the range of the data
    • 1 mark for concluding that the extrapolated prediction is unreliable
  6. 6.Describe[2 marks]

    Describe what the gradient tells you about the regression line y=1.5x+4y=1.5x+4y=1.5x+4, where yyy is a test mark and xxx is revision time in hours.

    Show mark schemeHide mark scheme

    Model answer

    For each extra hour of revision, the predicted mark rises by 1.5 marks on average.

    • 1 mark for referring to one extra hour of revision
    • 1 mark for stating that the predicted mark increases by 1.5 on average

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.

3.

Easy·State[1 mark]

State the point through which the regression line of yyy on xxx always passes.
Show answer and explanation

Answer: A · Worked explanation

The regression line always passes through the mean point (xˉ,yˉ)(\bar{x},\bar{y})(xˉ,yˉ​). The origin is on the line only when the intercept is 0, which is not generally true. The line need not pass through any actual data point. Remember that the means are calculated from all the data, so they need not match any single point.
4.

Medium·Calculate[2 marks]

Calculate the gradient aaa of a regression line of yyy on xxx when sxy=6s_{xy}=6sxy​=6 and sx2=4s_x^2=4sx2​=4.
Show answer and explanation

Answer: A · Worked explanation

The gradient is a=sxysx2=64=1.5a=\frac{s_{xy}}{s_x^2}=\frac{6}{4}=1.5a=sx2​sxy​​=46​=1.5. The value 0.67 comes from inverting the fraction, giving 46\frac{4}{6}64​. The value 24 multiplies the two quantities instead of dividing. Remember that the gradient divides the covariance by the variance of xxx. Both values here are positive, so the gradient must be positive.
5.

Medium·Determine[2 marks]

A regression line of yyy on xxx has gradient 2.5. The means are xˉ=4\bar{x}=4xˉ=4 and yˉ=11\bar{y}=11yˉ​=11. Determine its equation.
Show answer and explanation

Answer: A · Worked explanation

Use y−yˉ=a(x−xˉ)y-\bar{y}=a(x-\bar{x})y−yˉ​=a(x−xˉ), so y−11=2.5(x−4)y-11=2.5(x-4)y−11=2.5(x−4). This gives y=2.5x−10+11=2.5x+1y=2.5x-10+11=2.5x+1y=2.5x−10+11=2.5x+1. The equation with intercept 11 uses yˉ\bar{y}yˉ​ as the intercept, which ignores the shift of 2.5×4=102.5\times4=102.5×4=10 caused by xˉ\bar{x}xˉ. Check the answer by substituting x=4x=4x=4: 2.5×4+1=112.5\times4+1=112.5×4+1=11, which equals yˉ\bar{y}yˉ​, as it must for any regression line.
6.

Medium·Calculate[2 marks]

A regression line is y=0.8x+1.8y=0.8x+1.8y=0.8x+1.8, found from data with xxx between 1 and 5. Calculate the predicted yyy when x=3.5x=3.5x=3.5.
Show answer and explanation

Answer: A · Worked explanation

Substituting gives 0.8×3.5+1.8=2.8+1.8=4.60.8\times3.5+1.8=2.8+1.8=4.60.8×3.5+1.8=2.8+1.8=4.6. This is interpolation, since 3.5 lies within the data range. The value 2.8 leaves out the intercept. The value 6.3 multiplies 3.5 by 1.8 instead. Substitute the given value of xxx into the equation, then check that the result is sensible for the data.
7.

Medium·Identify[2 marks]

A cafe finds the regression line y=−3.2x+80y=-3.2x+80y=−3.2x+80, where xxx is the outdoor temperature in ∘C^{\circ}\mathrm{C}∘C and yyy is the number of hot drinks sold. Identify the correct meaning of the gradient.
Show answer and explanation

Answer: A · Worked explanation

The gradient is the change in yyy for each one-unit increase in xxx, here -3.2 drinks per degree. The statement about 0 ∘C^{\circ}\mathrm{C}∘C confuses the gradient with the intercept, which predicts 80 drinks at that temperature. Always state the units of both variables when interpreting a gradient.
8.

Hard[2 marks]

The points (−2,4)(-2,4)(−2,4), (−1,1)(-1,1)(−1,1), (0,0)(0,0)(0,0), (1,1)(1,1)(1,1) and (2,4)(2,4)(2,4) give r=0r=0r=0. Which conclusion is justified?
Show answer and explanation

Answer: A · Worked explanation

These points follow y=x2y=x^2y=x2, a clear curve, yet r=0r=0r=0 because rrr measures only linear association. The justified conclusion is therefore limited to no linear association. Claiming no relationship at all ignores the exact curve that the points follow. A scatter diagram would reveal the curve at once.
9.

Hard·Determine[2 marks]

Data with n=5n=5n=5 have ∑x=20\sum x=20∑x=20, ∑y=30\sum y=30∑y=30, ∑x2=110\sum x^2=110∑x2=110 and ∑xy=150\sum xy=150∑xy=150. Determine the regression line of yyy on xxx.
Show answer and explanation

Answer: A · Worked explanation

The means are xˉ=4\bar{x}=4xˉ=4 and yˉ=6\bar{y}=6yˉ​=6. Then sxy=1505−4×6=6s_{xy}=\frac{150}{5}-4\times6=6sxy​=5150​−4×6=6 and sx2=1105−42=6s_x^2=\frac{110}{5}-4^2=6sx2​=5110​−42=6, so the gradient is 1. From y−6=1(x−4)y-6=1(x-4)y−6=1(x−4) we get y=x+2y=x+2y=x+2. The line with gradient 1.36 divides ∑xy\sum xy∑xy by ∑x2\sum x^2∑x2, which skips the means. Check the answer by substituting x=4x=4x=4 into y=x+2y=x+2y=x+2, which gives 6, the mean of the yyy-values.
10.

Hard[2 marks]

In a seaside town, monthly ice cream sales and the number of swimming accidents have r=0.9r=0.9r=0.9. Which interpretation is best?
Show answer and explanation

Answer: A · Worked explanation

A value of r=0.9r=0.9r=0.9 shows strong positive linear association only. A third factor, such as warm weather, may increase both. The claim that ninety per cent of accidents are caused by sales misreads rrr as a percentage and as proof of cause.

Keep going

Next topic4.5 Probability conceptsPrevious topic4.3 Measures of central tendency and spread

More in Topic 4 · Statistics and probability

  1. 4.1Sampling conceptsNotes · 10 questions
  2. 4.2Presenting dataNotes · 10 questions
  3. 4.3Measures of central tendency and spreadNotes · 10 questions
  4. 4.4Correlation and regressionNotes · 10 questions
  5. 4.5Probability conceptsNotes · 10 questions
  6. 4.6Combined events and diagramsNotes · 10 questions
  7. 4.7Discrete random variablesNotes · 10 questions
  8. 4.8Binomial distributionNotes · 10 questions
  9. 4.9Normal distributionNotes · 10 questions

All IB Mathematics: Analysis and Approaches topics →

Draft: written by Scribe and checked automatically, not yet by a subject reviewer.

Practice questions are original, written by Scribe and checked automatically for correctness.

Topic codes follow the official numbering. Not endorsed by IB Diploma Programme or any exam board.

On this page

0/5 read

  1. 1A scatter diagram shows how two variables relate
  2. 2Correlation describes the direction and strength of a linear link
  3. 3The regression line is the best-fitting straight line
  4. 4The mean point and gradient give the equation
  5. 5Predictions are reliable only within the range of the data
  6. Check your recall
  7. Practice: 10 questions
All coursesScribeHow it worksPricingPrivacyTerms

Notes and questions are written by Scribe in our own words. Topic codes follow the official course numbering so you can find your place. Not produced or endorsed by the IB, College Board, AQA, OCR, Pearson Edexcel or any exam board.

© 2026 Scribe

Regression line through five points

Test mark (marks)0123456702468Revision time (hours)
  • Regression line
  • Data points
  • Mean point