Correlation and regression AI SL

Correlation tells you how closely two sets of paired data follow a pattern, and regression turns a straight-line pattern into an equation you can use for prediction. On this course the calculator finds every coefficient and every line, so the marks are for entering the pairs correctly, describing the strength and direction in words, and judging whether a prediction can be trusted. Start with correlation, then Spearman's rank, then the regression line.

Formulas at a glance

The booklet gives the form of the regression line, y=ax+by=ax+b, and the range −1≤r≤1-1\le r\le1, but the values of aa, bb and rr come from the calculator. Spearman's formula is not in the booklet, because the examination expects the calculator to find the rank coefficient.

Regression line of yy on xx

y=ax+by=ax+b

In the booklet

Range of Pearson's correlation coefficient

−1≤r≤1-1\le r\le 1

In the booklet

Check on a computed regression line

Line passes through (x¯,y¯)(\bar x,\bar y)

Not in the booklet

Which method to use

Decide first whether the question is about how two variables are related, about ranks, or about predicting a value. The calculator does the arithmetic in every case, so the skill is choosing the right output and saying what it means.

The question hasUseNotes
Pairs of data, and asks how strongly two variables are related in a straight lineEnter the pairs in two lists and run linear regression with diagnostics on. Read rrPearson's rr is only meaningful when the relationship is roughly linear
A value of rr or rsr_s, and asks you to describe the correlationStrength from |r||r|: 0 to 0.5 weak, 0.5 to 0.8 moderate, 0.8 to 1 strong. Direction from the signAlways give both strength and direction, and refer to the context
Ranks, scores from judges, or a curved relationship that always rises or always fallsSpearman's rank: rank each variable, using the mean rank for ties, then find rr of the ranks with the calculatorSpearman's rsr_s is less affected by outliers than Pearson's rr
A prediction of yy from a given xxFind the regression line y=ax+by=ax+b with the calculator, then substitute xxUse the unrounded values of aa and bb from the calculator
A prediction at an xx-value outside the range of the dataIt is extrapolation. Make the prediction if asked, then comment that it may not be reliableThe pattern may not continue outside the data
A prediction of xx from a given yyDo not rearrange the line of yy on xx to predict xx. Say that the prediction may not be reliableThe line of yy on xx is built for predicting yy
The mean point, or a regression line with one value missingThe regression line passes through (x¯,y¯)(\bar x,\bar y). Substitute the mean point into y=ax+by=ax+bThis gives bb from aa, or y¯\bar y from x¯\bar x
A question about whether one variable causes the otherCorrelation does not imply causation. Suggest a third variable that could affect bothA strong rr shows association only

Section 1 of 3 SL4.4

Correlation

Pearson's product-moment correlation coefficient rr measures how closely bivariate data follow a straight line, and it always satisfies −1≤r≤1-1\le r\le1. The sign gives the direction of the correlation and the size of rr gives its strength, with rr found using technology. The topic covers describing correlation in words and why correlation does not prove cause.

Reading the coefficient

Positive correlation

As xx increases, yy tends to increase too - points trend upward left to right, giving a positive gradient and r>0r>0.

Negative correlation

As xx increases, yy tends to decrease - points trend downward left to right, giving a negative gradient and r<0r<0.

No correlation

The points show no clear upward or downward trend - rr is close to zero, and fitting a line wouldn't be meaningful.

Range of Pearson's correlation coefficient: −1≤r≤1-1\le r\le 1 (in the booklet). The value of rr itself comes from the calculator.

Key terms

What is bivariate data?

Bivariate data are pairs of values recorded for each item in the study, one for each of two variables. Plotting the pairs on a scatter diagram shows whether the variables are related.

e.g. The height and shoe size of each of 12 students gives 12 pairs of values (x,y)(x,y).

What do positive and negative correlation mean?

With positive correlation yy tends to increase as xx increases, and r>0r>0. With negative correlation yy tends to decrease as xx increases, and r<0r<0.

e.g. Hours of revision and test mark would probably show positive correlation, while the age of a car and its value would probably show negative correlation.

How do you describe the strength of a correlation?

The closer |r||r| is to 11, the more closely the points lie on a straight line and the stronger the correlation. A value of rr close to 00 means weak or no linear correlation.

e.g. r=−0.9r=-0.9 is a strong negative correlation, while r=0.1r=0.1 is a very weak positive correlation.

What does a correlation coefficient of zero tell you?

It tells you there is no linear correlation, but the variables can still be related in a non-linear way. A scatter diagram helps to check for this.

e.g. For the points with x=−3,−2,…,3x=-3,-2,\dots,3 and y=x2y=x^2, r=0r=0 even though yy is completely determined by xx.

Worked example, step by step

The question Calculator needed [5 marks]

A sports scientist records the weekly training time, xx hours, and the time, yy minutes, taken to ride a 20 km route for eight club cyclists.

xx: 4, 6, 7, 9, 10, 12, 13, 15
yy: 58, 52, 55, 50, 53, 45, 47, 41

(a) Find the value of Pearson's product-moment correlation coefficient, rr.

(b) Describe the correlation between xx and yy.

(c) The scientist concludes that more training causes faster ride times. Comment on this conclusion.

Worked solution: worked example

Answer: (a) r=−0.923r=-0.923 (b) strong negative correlation (c) correlation does not imply causation, so the data do not show that training causes faster times: another variable such as experience could affect both.

Step 1 - Enter the pairs.

Enter the xx-values in one list and the yy-values in a second list, in the same order. Both lists must have eight values. Check that the calculator will show rr (on some models, switch diagnostics on first).

Why? Each xx-value must be matched with its own yy-value. A swapped or missing value changes every output.

Step 2 - Run linear regression and read r.

Run the linear regression on the two lists. The calculator gives r=−0.923r=-0.923, to 3 significant figures. A1 - Calculator value of rr (unrounded) A1 - r=−0.923r=-0.923 to 3 significant figures

Why? The correlation coefficient comes with the regression output, because both come from the same pairs. Use the value written rr, not r2r^2.

Step 3 - Describe the correlation.

The value of |r||r| is 0.9230.923, which is between 0.8 and 1, so the correlation is strong. The sign is negative, so as xx increases, yy decreases. There is a strong negative correlation between training time and ride time. A1 - Strong A1 - Negative

Why? Strength comes from |r||r|: 0 to 0.5 weak, 0.5 to 0.8 moderate, 0.8 to 1 strong. Direction comes from the sign. A full description gives both.

Step 4 - Comment on the conclusion.

Correlation does not imply causation. The data show that cyclists who train more tend to ride faster, but there could be another cause. For example, more experienced cyclists might both train more and ride faster, so the training time may not be what makes them quicker. R1 - Correlation does not imply causation, with another possible cause named

Why? A strong rr only shows association. To earn the reasoning mark, say that correlation is not causation and name another variable that could explain the pattern.

Step 5 - Check that a straight line is sensible.

A scatter diagram of these data shows the points falling steadily from the upper left to the lower right, close to a straight line, so Pearson's rr is a sensible measure here.

Why? Pearson's rr measures only a linear relationship. For a curved pattern a value of rr near 0 would not mean there is no relationship.

Marks (5):
A1 Calculator value of rr (unrounded)
A1 r=−0.923r=-0.923 to 3 significant figures
A1 Strong
A1 Negative
R1 Correlation does not imply causation, with another possible cause named

Now you try: enter your answers to be marked

These are real practice questions. Type your answer in each box and press Mark it. The worked solution and mark scheme appear straight away, and your first attempt is the one that counts. Use the keyboard for powers, roots and trig, and the working box for your notes.

1
Easy
Calculator
[2 marks]
A data set has r=−0.45.r=-0.45. Use the convention that |r|<0.5|r|<0.5 is weak, 0.5≤|r|<0.80.5\le|r|<0.8 is moderate and |r|≥0.8|r|\ge0.8 is strong.
(a) State the strength of the correlation described.
[1]
(b) State the direction of the correlation described.
[1]
Fractions & powers
Other

Worked solution: practice question 1

2
Medium
Calculator
[4 marks]
xx12345
yy35478
.
(a) Find Pearson's rr.
[2]
(b) Describe the correlation.
[2]
Fractions & powers
Other

Worked solution: practice question 2

3
Medium
Calculator
[1 mark]
A regression line has a negative gradient.

State the sign of rr.
[1]
Fractions & powers
Other

Worked solution: practice question 3

Your score so far: 0 out of 7 marks

Common mistakes

  • Claiming causation from correlation. A strong rr shows association, not cause and effect - always consider whether a confounding factor could explain the relationship instead.
  • Confusing rr with r2r^2. Some GDC output screens display both - always quote the value the question actually asks for, since r2r^2 is always positive and reads differently.
  • Ignoring outlier effects. A single extreme point can pull rr noticeably toward zero even when the rest of the data is tightly linear - don't describe the correlation from rr alone without a glance at the scatter diagram.

Try some questions on correlation

Section 2 of 3 SL4.10

Spearman's rank

Spearman's rank correlation coefficient rsr_s measures how well the ranks of two variables agree, on a scale from −1-1 to 11. Replace each value with its rank, then find rsr_s on a GDC. Use it instead of Pearson's rr when the relationship is consistently increasing or decreasing but not linear, or when outliers are present.

The formula

Spearman's rank coefficient

rs=1−6∑d2n(n2−1)r_s = 1 - \dfrac{6\sum d^2}{n(n^2-1)}

Not in the booklet. The examination expects the calculator, which finds rsr_s from the two lists of ranks. To check by hand, rank both variables, find the difference dd between each pair of ranks, then apply the formula.

Reading the value

−1≤rs≤1-1\le r_s\le 1

Interpreted exactly like Pearson's rr: close to +1+1 is a strong positive monotonic relationship, close to −1-1 strong negative, near 00 little or no monotonic relationship.

Key terms

What is a rank?

A rank is a position in order, where the smallest value gets rank 11. Both variables must be ranked in the same direction.

e.g. The values 12,7,20,912, 7, 20, 9 have ranks 3,1,4,23, 1, 4, 2 when ranked from smallest to largest.

How do you rank tied values?

Tied values each get the mean of the ranks they would have taken. This keeps the total of the ranks correct.

e.g. In 4,6,6,94, 6, 6, 9, the two sixes would take ranks 22 and 33, so each gets rank 2.52.5, giving ranks 1,2.5,2.5,41, 2.5, 2.5, 4.

What do the sign and size of rsr_s tell you?

A positive value means that high ranks in one variable go with high ranks in the other, and a negative value means they go with low ranks. The closer to −1-1 or 11, the stronger the agreement, and a value near 00 means little agreement.

e.g. A value of rs=−0.9r_s=-0.9 shows strong negative agreement, so the highest ranks of one variable go with the lowest ranks of the other.

What is a monotonic relationship?

A monotonic relationship is one where one variable consistently increases, or consistently decreases, as the other increases. It does not have to be a straight line.

e.g. The pairs (1,1),(2,4),(3,9),(4,16)(1,1), (2,4), (3,9), (4,16) always increase but lie on a curve, so the ranks agree perfectly and rs=1r_s=1, while Pearson's rr is less than 11.

Worked example, step by step

The question Calculator needed [6 marks]

Two critics each score eight short films out of 100.

Critic A: 72, 65, 88, 65, 90, 54, 79, 83
Critic B: 70, 64, 85, 60, 92, 66, 75, 80

(a) Write down the rank of each film for each critic, giving rank 1 to the lowest score.

(b) Find Spearman's rank correlation coefficient, rsr_s.

(c) Describe the relationship between the critics' scores.

Worked solution: worked example

Answer: (a) critic A: 4, 2.5, 7, 2.5, 8, 1, 5, 6 and critic B: 4, 2, 7, 1, 8, 3, 5, 6 (b) rs=0.922r_s=0.922 (c) a strong positive relationship.

Step 1 - Rank critic A, sharing tied ranks.

Put the scores in order: 54, 65, 65, 72, 79, 83, 88, 90. The two scores of 65 would take ranks 2 and 3, so each gets the mean rank 2.52.5. The ranks for critic A, in the order of the films, are 4, 2.5, 7, 2.5, 8, 1, 5, 6.4,\ 2.5,\ 7,\ 2.5,\ 8,\ 1,\ 5,\ 6. A1 - Ranks for critic A, with the tied ranks both 2.52.5

Why? Tied scores each get the mean of the ranks they would have taken. Keep the ranks in the original order of the films, so that each film's two ranks can be paired.

Step 2 - Rank critic B.

In order: 60, 64, 66, 70, 75, 80, 85, 92. There are no ties, so the ranks for critic B, in the order of the films, are 4, 2, 7, 1, 8, 3, 5, 6.4,\ 2,\ 7,\ 1,\ 8,\ 3,\ 5,\ 6. A1 - Ranks for critic B

Why? Rank both variables in the same direction, smallest to largest. A mixed direction would turn a positive relationship into a negative one.

Step 3 - Find the correlation of the ranks.

Enter the ranks of critic A in one list and the ranks of critic B in a second list. Run the linear regression on these two lists and read rr. It is rs=0.922r_s=0.922, to 3 significant figures. A1 - Calculator value of rsr_s from the lists of ranks (unrounded) A1 - rs=0.922r_s=0.922 to 3 significant figures

Why? Spearman's rsr_s is the ordinary correlation coefficient of the ranks. The calculator has no separate Spearman key, and the syllabus says to find it using technology. Use the lists of ranks, not the lists of scores.

Step 4 - Describe the relationship.

The value rs=0.922r_s=0.922 is between 0.8 and 1, so the relationship is strong, and it is positive. The critics' scores have a strong positive relationship: a film that one critic ranks highly tends to be ranked highly by the other. A1 - Strong A1 - Positive

Why? Strength and direction are read from rsr_s in the same way as for Pearson's rr, and a complete answer gives both.

Step 5 - Compare with the raw scores.

Pearson's rr calculated from the original scores is 0.9020.902, which is a different number. It measures how close the scores are to a straight line, while rsr_s measures whether the order agrees.

Why? Spearman's coefficient works for any relationship that consistently rises or consistently falls, and it is less sensitive to outliers than Pearson's rr.

Marks (6):
A1 Ranks for critic A, with the tied ranks both 2.52.5
A1 Ranks for critic B
A1 Calculator value of rsr_s from the lists of ranks (unrounded)
A1 rs=0.922r_s=0.922 to 3 significant figures
A1 Strong
A1 Positive

Now you try: enter your answers to be marked

1
Easy
Calculator
[3 marks]
Six students recorded the hours they revised, xx, and their test mark, yy.

xx492758
yy557449786470
(a) State the rank of the second student's test mark, where rank 1 is the lowest mark.
[1]
(b) Find Spearman's rank correlation coefficient rs.r_s.
[2]
Fractions & powers
Other

Worked solution: practice question 1

2
Medium
Calculator
[3 marks]
The number of bacteria, yy (in thousands), is recorded each hour, xx, for 8 hours.

xx12345678
yy2359173365129
(a) Find Pearson's correlation coefficient r.r.
[1]
(b) Find Spearman's rank correlation coefficient rs.r_s.
[1]
(c) Which of rr and rsr_s describes this relationship better?
[1]
Fractions & powers
Other

Worked solution: practice question 2

3
Hard
Calculator
[5 marks]
Ten towns are compared on the number of cafes, xx, and the number of bookshops, yy.

xxyy
534
829
841
1141
1447
1455
1750
2062
2362
2670
(a) State the rank given to each of the towns with x=14x=14, where rank 1 is the lowest value.
[1]
(b) State the rank given to each of the towns with y=62y=62.
[1]
(c) Find Spearman's rank correlation coefficient rs.r_s.
[2]
(d) Which word describes the strength of the association? Use the convention that |rs|<0.5|r_s|<0.5 is weak, 0.5≤|rs|<0.80.5\le|r_s|<0.8 is moderate and |rs|≥0.8|r_s|\ge0.8 is strong.
[1]
Fractions & powers
Other

Worked solution: practice question 3

Your score so far: 0 out of 11 marks

Common mistakes

  • Ranking the wrong direction. Rank 1 can be the largest or the smallest value, as long as both variables use the same direction - a mixed convention reverses the sign of rsr_s.
  • Forgetting to average tied ranks. When two data items are equal, both should get the mean of the ranks they'd otherwise occupy, not two different whole-number ranks.
  • Treating rsr_s and Pearson's rr as interchangeable. rsr_s detects any monotonic trend (including curved ones), while rr only detects a linear one - quoting the wrong coefficient for what the question describes loses marks.

Try some questions on Spearman's rank

Section 3 of 3 SL4.4

Regression line

The regression line of yy on xx, written y=ax+by=ax+b, is the line that best fits the scatter of bivariate data, and it passes through the mean point (x¯,y¯)(\bar x,\bar y). Use it to predict yy for a given xx, and interpret the gradient and intercept in context. Your GDC finds the equation, so the skill lies in using and interpreting it.

Key terms

What does the gradient of a regression line mean?

The gradient aa is the predicted change in yy for each increase of 11 in xx. Always describe it using the units and context of the data.

e.g. If y=2.4x+10y=2.4x+10 predicts a test score from hours of study, each extra hour of study is linked with 2.42.4 more marks.

What does the intercept of a regression line mean?

The intercept bb is the predicted value of yy when x=0x=0. It is only meaningful when x=0x=0 makes sense in the context.

e.g. For y=2.4x+10y=2.4x+10, the intercept predicts a score of 1010 marks for someone who did no study.

What is the mean point?

The mean point is (x¯,y¯)(\bar x,\bar y), made from the mean of the xx-values and the mean of the yy-values. The regression line always passes through it.

e.g. If the regression line is y=2x+1y=2x+1 and x¯=5\bar x=5, then y¯=2×5+1=11\bar y=2\times5+1=11.

What is the difference between interpolation and extrapolation?

Interpolation predicts yy for an xx-value inside the range of the data, and extrapolation predicts outside that range. Extrapolation is less reliable and should come with a comment.

e.g. For data with xx from 22 to 1212, a prediction at x=8x=8 is interpolation, but a prediction at x=30x=30 is extrapolation.

Worked example, step by step

The question Calculator needed [7 marks]

A letting agent records the distance, xx km, of each of nine flats from the city centre and its monthly rent, yy dollars.

xx: 1, 2, 3, 4, 6, 8, 9, 11, 12
yy: 1450, 1395, 1310, 1290, 1170, 1110, 990, 945, 880

(a) Find the equation of the regression line of yy on xx.

(b) Interpret the gradient of the line in this context.

(c) Estimate the monthly rent of a flat 7 km from the city centre. Say whether the estimate is likely to be reliable.

Worked solution: worked example

Answer: (a) y=−50.9x+1490y=-50.9x+1490 (b) the rent falls by about $50.9 for each extra kilometre from the centre (c) about $1130 per month, which is likely to be reliable because 7 km is inside the range of the data and the correlation is strong.

Step 1 - Enter the data and run the regression.

Enter the distances in one list and the rents in another, then run linear regression to find the line y=ax+by=ax+b of yy on xx. The calculator gives a=−50.858…a=-50.858\ldots and b=1487.56…b=1487.56\ldots, and also r=−0.994r=-0.994.

Why? The rent yy depends on the distance xx, so this is the regression of yy on xx. Keep the full values from the calculator for later calculations.

Step 2 - Write the equation.

y=−50.9x+1490y=-50.9x+1490 with both values to 3 significant figures. A1 - a=−50.9a=-50.9 A1 - b=1490b=1490

Why? The equation is y=ax+by=ax+b, with aa the gradient and bb the yy-intercept. The calculator returns aa and bb, so there is nothing to work out by hand.

Step 3 - Interpret the gradient.

The gradient is −50.9-50.9. For each extra kilometre from the city centre, the monthly rent is predicted to fall by about $50.9. A1 - The rent falls by about $50.9 for each extra kilometre

Why? Say what the gradient means in the units and context of the data: change in yy for each increase of 1 in xx. The sign tells you the direction.

Step 4 - Estimate the rent at 7 km.

Substitute x=7x=7 into the line: y=−50.858×7+1487.56=1131.6…y=-50.858\times7+1487.56=1131.6\ldots. The estimated rent is about $1130 per month, to 3 significant figures. M1 - Substitute x=7x=7 into their equation A1 - About $1130

Why? Using the unrounded aa and bb from the calculator gives the most accurate answer. The rounded line gives 11341134, which agrees with 11301130 to 3 significant figures.

Step 5 - Judge the reliability.

The distances in the data run from 1 km to 12 km, so 7 km is inside the range. This is interpolation, and r=−0.994r=-0.994 shows a very strong correlation, so the estimate is likely to be reliable. A flat 30 km away would be extrapolation: the line would give y=−38y=-38, a negative rent, which cannot be right. R1 - 7 km is inside the range of the data (interpolation) and r=−0.994r=-0.994 is strong A1 - So the estimate is reliable

Why? Predictions inside the range of the data are more reliable than those outside it. Outside the range the pattern may not continue, so extrapolation should always come with a comment.

Marks (7):
A1 a=−50.9a=-50.9
A1 b=1490b=1490
A1 The rent falls by about $50.9 for each extra kilometre
M1 Substitute x=7x=7 into their equation
A1 About $1130
R1 7 km is inside the range of the data (interpolation) and r=−0.994r=-0.994 is strong
A1 So the estimate is reliable

Now you try: enter your answers to be marked

1
Easy
Calculator
[2 marks]
The regression line of yy on xx is y=2.5x+10.y=2.5x+10. Predict yy when x=8.x=8.
[2]
Fractions & powers
Other

Worked solution: practice question 1

2
Medium
Calculator
[3 marks]
The table shows study hours xx and test score yy for 8 students.

xx12345678
yy4248555865707484
(a)  Find the equation of the regression line of yy on xx in the form y=ax+by = ax + b, using technology.
[2]
(b)  Use the line to estimate the score of a student who studied for 6.5 hours.
[1]
Fractions & powers
Other

Worked solution: practice question 2

3
Medium
Calculator
[4 marks]
A least-squares line has gradient 4 and passes through the mean point (x¯,y¯)=(3,18).(\bar x,\bar y)=(3,18).
(a) Find the equation of the regression line.
[2]
(b) Predict yy when x=6.x=6.
[2]
Fractions & powers
Other

Worked solution: practice question 3

Your score so far: 0 out of 9 marks

Common mistakes

  • Extrapolating without comment. Using the regression line to predict far outside the data range and treating the answer as equally reliable as an interpolated one - always flag extrapolation as less trustworthy.
  • Predicting xx from yy using the yy on xx line. The yy on xx regression line is built to predict yy. Rearranging it to predict xx gives a prediction that may not be reliable.
  • Forgetting the mean-point property. When a question gives x¯\bar x or y¯\bar y alongside a partial equation, missing that the line must pass through (x¯,y¯)(\bar x,\bar y) loses an easy substitution mark.

Try some questions on regression line

Using your GDC

The exact key presses for the TI-84 Plus CE, Casio fx-CG50, Casio fx-CG100 and TI-Nspire CX, with what the screen shows. Pick your calculator.

Make a scatter diagram

Used in: Correlation

How to make a scatter diagram on a TI-84 Plus CE

Scatter plot from two lists (STAT PLOT)

If L1 and L2 already hold data, press stat, choose 4:ClrList, then press 2nd 1 (L1) , 2nd 2 (L2) and enter to empty them.

ClrList L1,L2

Press stat, choose 1:Edit and press enter. Type the x-values into L1, pressing enter after each: 2, 3, 5, 6, 8, 9, 11, 12. Press ▶ to move to L2 and type the y-values in the same order: 31, 38, 40, 52, 55, 63, 60, 74. The two lists must have the same number of values.

L1    L2    L3
2     31    ---
3     38    ---
5     40    ---
6     52    ---
8     55    ---
9     63    ---
11    60    ---

Press 2nd Y= (STAT PLOT), choose 1:Plot1 and press enter. Highlight On and press enter. Check that Type is the first icon (scatter plot), Xlist is L1 and Ylist is L2. If not, move to the item, press enter to choose the icon, or type the list name with 2nd 1 (L1) or 2nd 2 (L2).

Plot1
On  Off
Type: scatter (first icon)
Xlist:L1
Ylist:L2

Press zoom and choose 9:ZoomStat. The calculator sets the window to fit the data and draws the scatter plot. Press trace and ◀ ▶ to move from point to point and read each pair of values.

The points rise from the lower left to the upper right: as x increases, y increases.

When you have finished, press 2nd Y= (STAT PLOT) and choose 4:PlotsOff. A plot left on makes the next function graph fail with an error.

The full guide: Make a scatter diagram

Linear regression (line of best fit) and r

Used in: Correlation, Regression line

How to find a line of best fit and r on a TI-84 Plus CE

Turn on r (once)

Press mode, use ▼ to reach STAT DIAGNOSTICS, move to ON with ▶ and press enter. Then press 2nd mode (QUIT). With diagnostics off, the correlation coefficient rr is not shown. This setting stays on until you reset the calculator.

Enter the data and run LinReg(ax+b)

Press stat and choose 1:Edit. Clear any old values: move up to the L1 heading, press clear then enter, and do the same for L2.

Type the xx-values into L1, pressing enter after each: 3, 5, 6, 8, 9, 11, 12, 14. Press ▶ to move to L2 and type the yy-values, pressing enter after each: 41, 48, 47, 58, 60, 69, 66, 77. Both lists must have the same number of values.

L1 = 3, 5, 6, 8, 9, 11, 12, 14
L2 = 41, 48, 47, 58, 60, 69, 66, 77

Press stat, move to CALC with ▶, and choose 4:LinReg(ax+b). With the Stat Wizards on, a screen asks for Xlist and Ylist: set Xlist to L1 and Ylist to L2 (press 2nd 1 for L1 and 2nd 2 for L2), then move to Calculate and press enter. If the Stat Wizards are off, type LinReg(ax+b) L1,L2 and press enter.

LinReg(ax+b)
y=ax+b
a=3.2346939
b=30.7551020
r²=0.9678131
r=0.9837749

Read a (the gradient), b (the yy-intercept) and r.

y=3.23x+30.8y = 3.23x + 30.8 and r=0.984r = 0.984, both to 3 significant figures.

Predict a value from the line

Before you run LinReg, move to Store RegEQ on the wizard screen, press vars, then ▶ to Y-VARS and choose 1:Function then 1:Y1. The full-accuracy equation is then saved in Y1. On the home screen type Y1(10) and press enter.

y=63.1y = 63.1 when x=10x = 10, to 3 significant figures.

Y1(10)
63.1020408

If r does not appear, diagnostics are off: turn STAT DIAGNOSTICS on in the mode screen and run LinReg again. Use the full values of a and b, not rounded ones, when you predict.

The full guide: Linear regression (line of best fit) and r

Spearman's rank correlation coefficient

Used in: Spearman's rank

How to find Spearman's rank correlation coefficient on a TI-84 Plus CE

Rank the data, then linear regression on the ranks

Rank each variable by hand first, as in Spearman's rank. Then press stat and choose 1:Edit.... Type the xx values in L1 and the yy values in L2, pressing enter after each. Type the rank of each xx value in L3 and the rank of each yy value in L4, in the same order as the data.

L1    L2    L3    L4
 12   64    7    5
  5   50    2    2
  9   71    5    7
 15   80    8    8
  7   58    3    3
 11   62    6    4
  3   41    1    1
  8   66    4    6

The correlation coefficient is only shown when diagnostics are on. Press mode, use ▼ to move to STAT DIAGNOSTICS, press ▶ to highlight ON and press enter. Press 2nd mode (QUIT) to leave the screen.

STAT DIAGNOSTICS:
OFF  [ON]

Press stat, press ▶ to reach CALC and choose 4:LinReg(ax+b). With the Stat Wizards on, a screen asks for each value: set Xlist to L3 (2nd 3) and Ylist to L4 (2nd 4), leave FreqList and Store RegEQ empty, and choose Calculate. If the wizards are off, type LinReg(ax+b) L3,L4 and press enter.

LinReg(ax+b)
Xlist:L3
Ylist:L4
FreqList:
Store RegEQ:
Calculate

The result shows a, b, r² and r. Because the two lists hold ranks, r is Spearman's coefficient.

rs=0.810r_s = 0.810 to 3 significant figures.

LinReg
y=ax+b
a=0.8095238
b=0.8571429
r²=0.6553288
r=0.8095238

Read r from the rank lists, not from L1 and L2. The same command on the raw data gives Pearson's r, which is a different number.

The full guide: Spearman's rank correlation coefficient

See the full list of GDC guides for every calculator task.

Syllabus content covered

CodeSyllabus content
SL4.4Linear correlation of bivariate data. Pearson's product-moment correlation coefficient, rr, found using technology. Scatter diagrams; lines of best fit, by eye, passing through the mean point. Equation of the regression line of yy on xx, found using technology, and its use for prediction. Interpret the meaning of the parameters, aa and bb, in a linear regression y=ax+by=ax+b. Awareness of the dangers of extrapolation, and that correlation does not imply causation.
SL4.10Spearman's rank correlation coefficient, rsr_s, found using technology; if data items are equal, ranks should be averaged. Awareness of the appropriateness and limitations of Pearson's product-moment correlation coefficient and Spearman's rank correlation coefficient, and the effect of outliers on each.

Official IB source: Mathematics: applications and interpretation subject brief (PDF, ibo.org).

Quick questions

What does Pearson's correlation coefficient r measure?

rr measures the strength and direction of a linear relationship between two variables. It ranges from −1-1 (perfect negative) to +1+1 (perfect positive), with values near 00 showing little or no linear relationship. It is calculated using technology, not by hand.

What is the formula for Spearman's rank correlation coefficient?

rs=1−6∑d2n(n2−1)r_s = 1 - \dfrac{6\sum d^2}{n(n^2-1)}, where dd is the difference between the ranks of each pair and nn is the number of pairs. In examinations it is normally found using technology instead.

What does the regression line of y on x predict?

y=ax+by=ax+b, found by technology, predicts yy from a given xx value. It should not be rearranged to predict xx from yy, because a prediction of xx made this way may not be reliable.

Does a strong correlation mean one variable causes the other?

No. A strong rr shows association, not cause and effect. A confounding factor could explain the relationship instead, so correlation alone never proves causation.

How is Spearman's rank different from Pearson's r?

Pearson's rr measures the strength of a linear relationship in the raw data. Spearman's rank works on the ranks of the data instead, so it measures any monotonic relationship (consistently increasing or decreasing, not necessarily in a straight line) and is less affected by outliers.

Why is extrapolation unreliable?

The regression line is only fitted to the range of xx-values in the data. Outside that range the linear pattern may not continue, so predictions there (extrapolation) are far less trustworthy than predictions inside the range (interpolation).

Can the correlation coefficient be greater than 1?

No. The value of rr always lies between −1-1 and 11 inclusive, so a result outside this interval means an error has been made.

What does rs=1r_s=1 mean?

The ranks of the two variables agree perfectly, so the order of one variable is exactly the order of the other. It does not mean the points lie on a straight line.

How do I get the regression line from my GDC?

Enter the xx-values and yy-values as two lists, then choose linear regression in the statistics menu. The GDC gives the values of aa and bb in y=ax+by=ax+b.

How do I describe a correlation in an exam answer?

Give both the direction and the strength, and refer to the context of the variables. For example, "there is a strong positive linear correlation between hours of revision and test mark".

Ready to practise properly?

Practice questions on every section, marked instantly like the real exam.