Apple/Mozilla Mobility Mash

What happened at St Patrick’s Day?

Peter Rabinovitch
Mac O’Clock
3 min readMay 4, 2020

--

Introduction

Since the advent of the ‘sickness’, many organizations are releasing their data, leading to data scientists plotting all sorts of data in all sorts of ways. Herein I add to the noise by plotting a mashup of two data sets provided by Mozilla and Apple.

The data

Mozilla describes its data in their blog.

The data we focus on here is their metric desktop_dau, which is the number of active daily users of Firefox. Actually, we look at the relative increase over the forecasted users, where the forecast was performed with FaceBook’s excellent Prophet package. In summary, a larger value means more desktop users than what was predicted.

The Apple data is described here and is the relative volume of directions requests per country/region compared to a baseline volume on January 13th, 2020. Here a smaller value means fewer directions requests. This data was already the subject of this post.

The code

First, we load our needed libraries.

We get the Mozilla data first and clean it up a bit.

Next, we get two-letter country codes to join and use the terrific janitor package to clean the field names.

Then we join the two-letter codes data back to the Mozilla data

Now, get the Apple data, make it long, and parse the date out.

Now we have the one ugly part of this code, matching different ways to spell a country’s name. I did not find a source all ready, so, we brute force it.

We tack these codes on to the Apple data

and now we can build our final data frame

A quick plot shows something interesting…the data seems to be in two pieces.

Colouring the points according to whether they were before or after St. Patrick’s day provides insight

After the shutdowns, more Firefox desktop usage is associated with decreased direction requests. Of course, this as a good illustration of ‘correlation is not causation’.

--

--

Peter Rabinovitch
Mac O’Clock

Data scientist at Ario and part time professor at University of Ottawa. LinkedIn: www.linkedin.com/in/peter-rabinovitch-701a2b1 Twitter: @prabinov42