Get startedGet started for free

Comparing medians

Parametric tests tend to compare means, while non-parametric tests tend to compare medians. This is because if your data is skewed, the mean may not be a good measure of central tendency, and you should work with the median instead.

Each of the university ranking organizations you just looked at also included a "total score" for each university. You'll start by determining if the scores are approximately normal by using a histogram. If they are not, you will perform a Mood's median test to compare their medians. In this exercise you'll work with the CW and ARW university rankings.

Again, while there are multiple ways to create histograms, you'll practice using the .hist() method as before.

A DataFrame with three different these three sets of rankings in rankings_df. The packages pandas as pd, NumPy as np, Matplotlib.pyplot as plt, and the stats package from SciPy have all been loaded for you.

This exercise is part of the course

Foundations of Inference in Python

View Course

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

# Plot a histogram of the CW total score
rankings_df['cw_score'].____
plt.show()
Edit and Run Code