Menu
Sign up Sign in

AI HL · 13.3

Statistics

13.3.6

Scatter diagrams and correlation

13.3.6

Scatter diagrams and correlation

Target: I can draw a scatter diagram, find the mean point with the calculator and draw a line of best fit through it by eye. (+6 more)

By the end of this section

Key points

Scatter diagrams and the mean point

  • Plot the variable that may explain the other on the x-axis. Label both axes with units.
  • The mean point \((\bar{x},\bar{y})\) lies on the line of best fit. Find it with the calculator and draw the line through it.
  • Draw the line by eye with about as many points above it as below it.
  • Positive correlation: y tends to increase as x increases. Negative correlation: y tends to decrease. No correlation: no pattern.
  • To find the equation of a line drawn by eye, take the mean point and one other point on the line. Gradient \(=\frac{y_2-y_1}{x_2-x_1}\), then \(y-\bar{y}=m(x-\bar{x})\). This line is not the regression line, so its numbers differ a little from the calculator's.

Pearson's correlation coefficient r

  • r is always between −1 and 1. The sign gives the direction. The size gives the strength: near 1 or −1 is strong, near 0 is weak.
  • A rough guide: \(|r|\) from 0.75 to 1 is strong, from 0.5 to 0.75 moderate, below 0.5 weak. Say "linear" correlation.
  • r measures only straight-line correlation. A perfect curve can have r close to 0.
  • Critical value: compare |r| with the value given for n points. If \(|r|\) is bigger, the correlation is significant. The table value is positive, but it is used for negative r too.
  • The fewer the points, the larger |r| must be to count as significant.

Correlation is not causation

  • Correlation shows that two variables go together. It does not show that one causes the other.
  • A lurking variable can affect both. Hot weather raises ice-cream sales and sunburn: the weather explains both.
  • Two quantities that both rise over the years correlate even with no link at all. This is a spurious correlation.
  • In an answer say: "Correlation does not imply causation" and name a lurking variable in the context.

A number can hide the data

  • Plot the data before you trust r or a mean. Data sets with the same r and the same means can look completely different: a line, a curve, a line with one stray point.
  • Simpson's paradox: groups that each show a positive trend can show a negative trend when joined. Ask whether the data hide two or more groups.
  • Mixing groups can reverse the sign of r. Check the data for groups before you interpret r.

On the calculator

The mean point

  • Enter the x values in one list and the y values in another.
  • Run one-variable statistics on each list and read the mean of each.
  • The mean point is (mean of x, mean of y).

Screenshot and video to come

A scatter diagram

  • Open a data and statistics page and choose the x list for the horizontal axis and the y list for the vertical axis.
  • Check the axes show every point, and label them in your answer.

Screenshot and video to come

Pearson's r

  • Run linear regression (mx+b) with the x list and the y list.
  • Read r from the output. Do not give r² instead.
  • Compare |r| with the critical value if the question gives one.

Screenshot and video to come

Explore: correlation and the regression line

Drag the black points and watch r and the line. Drag the orange point along the x-axis to predict y from x.

Mean point (x̄, ȳ)
Pearson's r
Correlation
Total of the squared residuals

Drag a point.

  1. Drag one point a long way from the others. What happens to r? What happens to the line?
  2. Does the regression line always pass through the mean point? Try three different patterns.
  3. Tick "Show the residuals" and drag a point. The line always moves to make the total of the squared residuals as small as it can. Why can no other straight line have a smaller total?
  4. Press "A curve". The points follow a clear pattern, but r is close to 0. What does r measure, and what does it not measure?
  5. Drag the orange point outside the range of the data. Why is the prediction less reliable there?

Worked examples

Problems like the ones in class. Pick one, try it, then open the working.
Scatter diagram and mean point

A café owner records the midday temperature x (°C) and the number of iced drinks sold, y, on 8 days. x: 14, 17, 19, 22, 24, 26, 29, 33 y: 38, 52, 47, 66, 60, 72, 70, 91 (a) Find the mean point. (b) Draw a scatter diagram, mark the mean point and draw a line of best fit by eye.

101214161820222426283032343630405060708090100x (°C)y (drinks)mean point
Working
  1. Enter the data

    List x: 14, 17, 19, 22, 24, 26, 29, 33; list y: 38, 52, 47, 66, 60, 72, 70, 91

    The temperature is the variable that may explain the sales, so it goes on the x-axis.

  2. Mean point

    From the calculator: \(\bar{x}=23\), \(\bar{y}=62\)

    One-variable statistics on each list. The mean point is (23, 62).

  3. Scatter diagram

    Plot the 8 points. Mark (23, 62) in a different colour.

    Label both axes with the variable and its units.

  4. Line by eye

    Draw a straight line through (23, 62) with about as many points on each side.

    The mean point always lies on the line of best fit. The points rise from left to right: positive correlation.

Video walkthrough coming
The equation of a line drawn by eye

A nursery measures the age x (weeks) and the height y (cm) of 8 saplings. x: 1, 2, 4, 7, 8, 11, 15, 16 y: 5, 9, 11, 30, 31, 42, 56, 64 A line of best fit is drawn by eye through the mean point and the point (14, 55). (a) Find the mean point. (b) Find the equation of the line. (c) Use the line to estimate the height of a sapling aged 12 weeks.

2468101214161810203040506070x (weeks)y (cm)mean point(14, 55)
Working
  1. Mean point

    From the calculator: \(\bar{x}=8\), \(\bar{y}=31\)

    One-variable statistics on each list. The mean point is (8, 31).

  2. Gradient

    \(m=\frac{55-31}{14-8}=\frac{24}{6}=4\)

    Change in y over change in x, using the two points on the line.

  3. Equation

    \(y-31=4(x-8)\), so \(y=4x-1\)

    Use the mean point in \(y-\bar{y}=m(x-\bar{x})\) and tidy it.

  4. Estimate

    \(x=12:\ y=4(12)-1=47\) cm

    12 weeks is inside the range of the data, so this is an interpolation.

Video walkthrough coming
Pearson's r and what it says

At 9 weather stations in the Alps, the altitude x (km) and the mean midday temperature in July y (°C) are: x: 1.2, 1.6, 2.1, 2.5, 3, 3.4, 3.9, 4.3, 4.8 y: 14.1, 10.7, 7.4, 6.2, 1.9, −0.4, −3.5, −6.6, −8.2 (a) Find Pearson's product-moment correlation coefficient r. (b) Describe the correlation between x and y.

123456−10−8−6−4−2246810121416x (km)y (°C)
Working
  1. Linear regression

    From the calculator: \(r=-0.9972\ldots\)

    Run linear regression (mx+b) on the two lists and read r. Give r to 3 significant figures.

  2. Direction

    r is negative

    As altitude increases, temperature decreases.

  3. Strength

    \(|r|=0.997\), close to 1

    The points lie very close to a straight line.

  4. State

    \(r=-0.997\): strong negative linear correlation

    Name both the strength and the direction.

Video walkthrough coming
Is the correlation significant?

Ten students record the hours they spend gaming each week, x, and their score y (out of 50) in a maths test. x: 3, 5, 6, 9, 10, 12, 14, 15, 17, 19 y: 48, 30, 41, 26, 45, 22, 31, 35, 18, 28 (a) Find r. (b) For n = 10 the critical value of r is 0.632. Is there significant evidence of correlation?

Working
  1. Find r

    From the calculator: \(r=-0.592\)

    Linear regression on the two lists.

  2. Size without the sign

    \(|r|=0.592\)

    The table gives a positive critical value. It applies to positive and negative r, so compare |r|.

  3. Compare

    \(0.592<0.632\)

    |r| is smaller than the critical value.

  4. Conclude

    Weak negative correlation, not significant

    With only 10 points, a correlation this size could easily happen by chance. There is not significant evidence of correlation.

Video walkthrough coming
Matching r to a scatter diagram

The scatter diagram shows 12 points. Which of these values is closest to r: 0.95, 0.6, −0.6 or −0.1?

123456789101112131415246810121416xy
Working
  1. Direction

    The trend rises: r > 0

    This removes −0.6 and −0.1.

  2. Strength

    The points are spread widely about any line

    This removes 0.95. A value near 1 needs a tight band.

  3. Choose

    r ≈ 0.6

    A moderate positive correlation.

  4. Check

    From the calculator: \(r=0.662\)

    Close to 0.6. Remember that r measures only straight-line correlation.

Video walkthrough coming
Correlation is not causation

For 10 children aged 6 to 15, the shoe size x (EU size) and the score y in a reading test are: x: 27, 29, 32, 33, 35, 37, 40, 41, 43, 45 y: 22, 28, 31, 39, 41, 48, 52, 55, 63, 66 (a) Find r. (b) A newspaper writes: "Bigger feet make children better readers." Explain why the data do not show this.

Working
  1. Find r

    From the calculator: \(r=0.993\)

    Strong positive linear correlation.

  2. Association only

    Larger shoe size goes with higher scores

    That is all that the number says. It does not say that one variable causes the other.

  3. Lurking variable

    Age affects both variables

    Older children have bigger feet and have had more years of reading practice. Age explains both.

  4. Conclusion

    Correlation does not imply causation

    Two variables can also correlate by coincidence: any two quantities that both rise year after year will correlate, with no link at all.

Video walkthrough coming
Simpson's paradox

Ten students from two sets record their weekly revision time x (hours) and their test mark y (%). The first five students are in Set 1 and the last five are in Set 2. x: 2, 3, 4, 5, 6, 8, 9, 10, 11, 12 y: 78, 80, 84, 85, 89, 52, 55, 58, 62, 64 (a) Find r for all ten students. (b) Find r for each set on its own. (c) What does this show?

2468101214405060708090100x (hours)y (%)
Working
  1. All ten students

    From the calculator: \(r=-0.726\)

    Negative: it seems that more revision goes with lower marks.

  2. Set 1

    \(r=0.987\)

    Within Set 1, more revision goes with a higher mark.

  3. Set 2

    \(r=0.996\)

    Within Set 2, the same.

  4. Explain

    The sets hide a lurking variable

    Set 1 students started with higher marks and revised less. Joining the groups reverses the trend. Always ask whether the data hide groups.

Video walkthrough coming
Same r, different data

Two data sets P and Q use the same x values. x: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 P: 4.8, 5.4, 8.3, 6.5, 7.6, 9.1, 6.8, 10.4, 7.3, 10 Q: 3.4, 5.6, 7, 8, 8.7, 9.1, 9.2, 9, 8.5, 7.7 (a) Find r and the mean of y for each set. (b) Plot both sets. What does r fail to show?

Working
  1. 123456789101124681012xP
    Set P

    \(r=0.722\), \(\bar{y}=7.62\)

    From the calculator: linear regression on x and P. The points scatter about a rising line.

  2. 123456789101124681012xQ
    Set Q

    \(r=0.722\), \(\bar{y}=7.62\)

    The same r and the same mean, from different data. These points rise, level off and fall.

  3. What r misses

    Q follows a curve, not a line

    A straight line is a fair model for P and a poor one for Q. r measures only how closely points follow a line. Always plot the data.

Video walkthrough coming