Lecture 21 – Case Study

Data 6, Summer 2021

Note: We're not going to be able to work through this entire notebook in lecture; you should definitely review whatever we don't get a chance to finish.

World University Rankings 2020

Our dataset comes from Times Higher Education (THE)'s World University Rankings 2020. These are slightly outdated as there is a 2021 ranking now, but the data is still relevant.

It's always good to check how many schools we're dealing with:

Some columns ('Number_students', 'International_Students', 'Percentage_Female', 'Percentage_Male') have commas and percentage symbols, meaning they can't be stored as integers. Let's clean them.

Now we can sort by any numeric column we want.

It seems like the above schools didn't report their sex breakdown, since 0% is the listed percentage of female and male students.

Let's start asking questions.

Which universities have the most international students?

We have an 'International_Students' column, but that tells us the percentage of international students at each school. Let's update that label to be more clear – let's change the label 'International_Students' to be '% International'.

Then, to compute the number of international students at each school, we take the number of students at each school, multiply by the percentage of international students at each school, and divide by 100.

We should probably round the result, since we can't have fractional humans.

We can add this as a column to our table:

And we can sort by this column, while also selecting a subset of all columns just to focus on what's relevant:

This tells us that the University of Melbourne has the most international students, with 21,797. That's larger than many universities!

There are no US universities in the top 10 here. How can we find the universities in the US with the most international students?

Quick Check 1

Fill in the blanks so that the resulting table contains the 15 universities in the US with the most international students, sorted by number of international students in decreasing order.

If you do a quick Google search for "US universities with the most international students", you'll see NYU is usually #1. Cool!

How do the rankings actually work?

Times Higher Education's website tells us the methodology they use to rank universities:

This means they come up with a 'Teaching', 'Research', 'Citations', 'International_Outlook', and 'Industry_Income' score from 0 to 100 for each school, then compute a weighted average according to the above percentages to compute a school's 'Score_Result', which is how the schools are ranked.

Let's confirm this ourselves. First, let's get a subset of the columns since they won't all be relevant here.

The graphic tells us that the weights for each column are:

(Remember, to convert from percentage to proportion we divide by 100.)

Let's try and apply this to the school at the very top of the table, University of Oxford.

The result, 95.4175, matches what we see in the 'Score_Result' column for University of Oxford.

We can apply the above formula to all rows in our table as well.

To confirm that the results we got match the 'Score_Result' column in scores_only, we can add the above array to our table:

This shows we've successfully reverse-engineered how the rankings work!

What if we want to change the methodology?

Now that we know how to compute 'Score_Result's using THE's percentages, we can also pick our own percentages if we want to prioritize different components in our ranking.

For instance, we may feel like THE's methodology places too much emphasis on research – together, 'Research' and 'Citations' make up 60% of the overall score.

We could choose to use the following breakdown, which we'll call "Breakdown 1":

This gives us new overall scores for each school; we can add this column to our table and sort by it.

Note that when we choose this methodology, UC Berkeley is ranked much lower (24th instead of 13th). This is likely due to:

Maybe we want to place some emphasis on research, but not as much as was placed in the initial ranking. We could then make "Breakdown 2":

Quick Check 2

Assign breakdown_2 to an array of overall scores for schools calculated according to our Breakdown 2 above, and add it as a column to scores_only with the label 'Breakdown 2'. _Hint: Start by copying our code for breakdown_1, which was:_

breakdown_1 = 0.6 * scores_only.column('Teaching') \
            + 0.3 * scores_only.column('International_Outlook') \
            + 0.1 * scores_only.column('Industry_Income')

"Breakdown 2" is much closer to THE's actual breakdown and the ordering here reflects that.

What do you care about in a university? Try your own breakdown!

We should note though that we haven't really thought about how THE comes up with the scores for each of the five categories (or the fact that university rankings have inherent flaws).

Which countries have the most universities in the ranking?

Back to the full world table:

To determine the number of universities per country, we can group by 'Country':

It's a good idea to sort too:

How do we get the number of universities in each country with at least 25 universities on the list?

Run the cell below to see a bar graph of the number of universities in each country above.