Exercise

Spearman correlation

We're going to return to our Olympic dataset, where, as in previous exercises, we'll be looking at the correlation between Height and Weight amongst athletics competitors since 2000. This relationship is seen below for both men (athletesM DataFrame) and women (athletesF DataFrame).

Scatter plot of height vs weight of Olympians

Note that the trend seen in each panel, represented by the line, isn't perfectly linear, particularly for the female samples. How will this affect correlation test results? scipy.stats is loaded as stats.

Instructions 1/2

undefined XP
  • 1

    Perform and print both a Pearson and Spearman correlation test of Height and Weight for females.

  • 2

    Perform and print both a Pearson and Spearman correlation test of Height and Weight for males.