Sign in to jmaths to print this page or save it as a PDF: jmaths-8ce638778fd6.herokuapp.com/maths/ai-sl/statistics/13-3-8/problems/b/

jmaths

IB Mathematics: Applications and Interpretation SL · 13.3: Statistics · 13.3.8

Spearman's rank correlation and comparison with Pearson's r Problem set B Worked solutions

Skills

  1. Calculate Spearman's rank correlation coefficient for the data. x: 6, 13, 3, 10, 15, 8, 1, 12 y: 40, 27, 45, 19, 31, 35, 48, 22

    • Ranks of x (smallest = 1): 3, 7, 2, 5, 8, 4, 1, 6
    • Ranks of y: 6, 3, 7, 1, 4, 5, 8, 2
    • From the calculator, correlation of the ranks: \(r_s = −0.762\)
  2. Calculate Spearman's rank correlation coefficient for the data. x: 0.8, 3.5, 1.9, 4.2, 2.7, 5.1, 3.1 y: 6.4, 9.9, 7.2, 13.5, 8.8, 12.6, 11.3

    • Ranks of x (smallest = 1): 1, 5, 2, 6, 3, 7, 4
    • Ranks of y: 1, 4, 2, 7, 3, 6, 5
    • From the calculator, correlation of the ranks: \(r_s = 0.929\)
  3. Calculate Spearman's rank correlation coefficient for the data. x: −12, 4, −5, 7, −9, 1, −2, 10 y: −20, 7, −8, 3, −15, −6, 12, −1

    • Ranks of x (smallest = 1): 1, 6, 3, 7, 2, 5, 4, 8
    • Ranks of y: 1, 7, 3, 6, 2, 4, 8, 5
    • From the calculator, correlation of the ranks: \(r_s = 0.667\)
  4. Calculate Spearman's rank correlation coefficient for the data. x: 11.2, 8.4, 9.7, 8.4, 12.6, 9.7, 8.4 y: 15, 22, 18, 25, 12, 20, 25

    • Ranks of x (smallest = 1): 6, 2, 4.5, 2, 7, 4.5, 2
    • Ranks of y: 2, 5, 3, 6.5, 1, 4, 6.5
    • From the calculator, correlation of the ranks: \(r_s = −0.963\)
  5. The scatter graph shows the data. Which pair of values fits the graph? A: r = −0.81, r_s = −1 B: r = −1, r_s = −1 C: r = −0.50, r_s = −0.70

    246810102030405060xy
    • The points always fall as x rises, so every increase in x goes with a decrease in y: \(r_s = -1\).
    • The points lie on a curve, not a straight line, so \(r\) is not \(\pm 1\).
    • From the calculator: \(r = −0.81\). The pair is A.

In context

  1. Eight students record the hours they spend gaming online each week and their mark (%) in an exam. x (hours): 4, 10, 7, 12, 7, 2, 9, 5 y (%): 58, 41, 64, 35, 48, 77, 45, 52

    Online (h)4107127295Mark (%)5841643548774552
    1. (a) Write down the ranks of the time online data.

      • The value 7 appears twice, so the two ranks are averaged.
      • Ranks: 2, 7, 4.5, 8, 4.5, 1, 6, 3
    2. (b) Calculate \(r_s\).

      • Ranks of exam mark: 6, 2, 7, 1, 4, 8, 3, 5
      • From the calculator, correlation of the ranks: \(r_s = −0.898\)
    3. (c) Describe the association in context.

      • \(r_s = −0.898\): a strong negative association. As time online increases, exam mark tends to decrease. This does not show that one causes the other.
  2. The value of a car is recorded each year. x is the age of the car in years and y its value in thousands of dollars. x: 1, 2, 3, 4, 5, 6, 7, 8 y: 24, 19.5, 16, 13, 11.2, 9.4, 8.1, 7

    1. (a) Sketch a scatter graph of y against x.

      • Plot the eight points: The points fall from left to right along a curve that flattens out.
    2. (b) Use your graph to explain why Spearman's rank correlation is more appropriate than Pearson's to measure the association.

      • The value always falls as age increases but the points lie on a curve, not near a straight line.
      • Pearson's r only measures how close the points are to a straight line.
    3. (c) Calculate \(r_s\) and Pearson's \(r\), and comment on them.

      • Ranks of x: 1, 2, 3, 4, 5, 6, 7, 8
      • Ranks of y: 8, 7, 6, 5, 4, 3, 2, 1
      • From the calculator: \(r_s = −1\)
      • From the calculator, raw data: \(r = −0.971\)
      • \(r_s\) shows a perfect monotonic relationship; \(r\) is weaker because the points are curved.
  3. A shop records the number of online adverts shown each week and its weekly sales (number of items). x: 3, 8, 5, 12, 7, 10, 2, 6 y: 210, 340, 260, 480, 275, 395, 190, 330

    Adverts3851271026Sales210340260480275395190330
    1. (a) Calculate Pearson's \(r\) and Spearman's \(r_s\).

      • From the calculator, raw data: \(r = 0.968\)
      • Ranks of x: 2, 6, 3, 8, 5, 7, 1, 4
      • Ranks of y: 2, 6, 3, 8, 4, 7, 1, 5
      • From the calculator, ranks: \(r_s = 0.976\)
    2. (b) Describe the correlation between number of adverts and sales.

      • \(r_s = 0.976\): a strong positive association. As number of adverts increases, sales tends to increase. This does not show that one causes the other.
      • \(r\) and \(r_s\) are close, so the relationship is close to linear.

Stretch

  1. A family records the hours of sunshine (x) and the energy bought from the grid (y kWh) on eight days. On the last pair of values a faulty heater ran all day. Their data: x: 2, 3, 5, 6, 8, 9, 11, 7 y: 41, 37, 33, 30, 24, 22, 17, 95

    1. (a) Calculate Pearson's \(r\) and Spearman's \(r_s\) for all eight pairs.

      • Ranks of x: 1, 2, 3, 4, 6, 7, 8, 5
      • Ranks of y: 7, 6, 5, 4, 3, 2, 1, 8
      • From the calculator: \(r = −0.242\), \(r_s = −0.762\)
    2. (b) The last pair is an outlier. Remove it and calculate \(r\) and \(r_s\) again for the remaining seven pairs.

      • Ranks of x: 1, 2, 3, 4, 5, 6, 7
      • Ranks of y: 7, 6, 5, 4, 3, 2, 1
      • From the calculator: \(r = −0.998\), \(r_s = −1\)
    3. (c) Which coefficient was affected more by the outlier? Explain why.

      • The change in r is 0.756; the change in \(r_s\) is 0.238.
      • Pearson's r uses the actual values, so one extreme value has a large effect. Spearman's uses only ranks.

jmaths.xyz · AI SL · 13.3.8 Spearman's rank correlation and comparison with Pearson's r