This is a short update on my previous post dealing with Google’s mobility reports on Austria during the Covid-19 crisis.
Author
Roland Schmidt
Published
8 Jun 2020
1 Context
This is a short update on my previous post dealing with Google’s mobility reports on Austria. Since the last post was published, the (at least preliminary) peak of the epidemic has passed, restrictions are lifted one after the other , and the country is gradually ‘re-booted’. Against this background, I thought it might be instructive to see how this is reflected in Google’s mobility reports.
To recap, Google’s mobility reports present data on the change of numbers of individuals staying at particular types of places (e.g. parks, groceries, transit stations etc) by using the pertaining data of Android’s location history (which users knowingly or unknowingly have activated). An exception is the location type ‘residential’ which captures the change of duration of people’s stays. Changes are calculated by contrasting each weekday’s value with the median value of the same weekdays from a pre-Covid19 baseline period. For details see Google’s pertaining info.
1.1 R Code and Shiny
Most of the relevant R code for this post is folded in chunks in the text. The repo including with the full code for this post is available at my github. This post is also my first use of RStudio’s powerful shiny package, which allows you to produce e.g. responsive graphs. Have a look at this, this and this tutorial to get going.
As always, if there’s any glaring error etc. pls don’t hesitate and let me know via Twitter dm.
# import csv --------------------------------------------------------------# file_link <- "https://www.gstatic.com/covid19/mobility/Global_Mobility_Report.csv"# df_AT_mobility <- readxl::read_xlsx(path=here::here("posts", "2020-06-08-update-on-mobility-patterns",# "Global_Mobility_Report_AT.xlsx")) %>% # filter(country_region_code=="AT")# # readr::write_csv2(df_AT_mobility, file=here::here("posts", "2020-06-08-update-on-mobility-patterns",# "AT_mobility_report.csv"))df_AT_mobility <- readr::read_csv2(file=here::here("posts", "2020-06-08-update-on-mobility-patterns", "AT_mobility_report.csv"))df_mobility_AT <- df_AT_mobility %>%mutate(sub_region_1=case_when(is.na(sub_region_1) ~"State level",TRUE~as.character(sub_region_1)))df_AT_long <- df_mobility_AT %>%pivot_longer(cols=contains("baseline"),names_to="type",values_to="value") %>%mutate(week.day=lubridate::wday(date, label=T), .after=date) %>%mutate(sub_region_1=forcats::as_factor(sub_region_1))df_AT_long <- df_AT_long %>%mutate(place.description=case_when(str_detect(type, "retail") ~"‘places like restaurants, cafes, shopping centers, theme parks, museums, libraries, and movie theaters.’",str_detect(type, "grocery") ~"’places like grocery markets, food warehouses, farmers markets, specialty food shops, drug stores, and pharmacies.’",str_detect(type, "park") ~"‘places like local parks, national parks, public beaches, marinas, dog parks, plazas, and public gardens.’",str_detect(type, "transit") ~"‘places like public transport hubs such as subway, bus, and train stations.’",str_detect(type, "work") ~"‘places of work’",str_detect(type, "residential") ~"‘places of residence’",TRUE~as.character("missing"))) %>%mutate(day.indicator=case_when(week.day %in%c("Sat", "Sun") ~"weekend", date %in% df_holidays$date ~"public holiday",TRUE~as.character("business day"))) %>%mutate(type=str_remove(type, "_percent.*$") %>%str_replace_all(., "_", " ") %>%str_to_title(.))
4 Regional differences
Below a shiny app which allows you to select the type of place and get the corresponding results displayed. Since this blogdown site is rendered with Hugo and hence a static website, shiny can’t be run ‘directly within’ the site. To overcome this, shiny apps are hosted externally and subsequently embedded via an iframe. the code for the app is available here.
Select the type of place in the dropdown and the graph should subsequently update.
Each dot represents a day. The location on the y-axis represent the % change relative to the median value for the same weekdays during the baseline period from 3 January to 6 February (= before Covid19 related restrictions were implemented). The color indicates whether it’s a business, weekend or holiday. The difference is insofar of relevance, since individuals’ mobility patterns are different during business, weekend and holidays and Covid19 restrictions hence have different consequences. The vertical lines indicated dates pertaining to the introduction and gradual withdrawal of the lockdown.
4.1 Interpretation
4.1.1 Grocery and Pharmacy
Groceries and pharmacies have experienced a strong recovery if compared to other types of places. With the exception of Tyrol and Salzburg (absence of tourists?), values have returned to or slightly exceed pre-Corona values now. After all, you somehow have to get your food and medicine. The reopening of all shops on 4 May seems to have triggered a particularly strong jump in the numbers.
4.1.2 Parks
Mobility patterns for parks are particularly strongly fluctuating. By Google’s own account, numbers for ‘visitors to parks are heavily influenced by the weather’. Acting on the maxim to never let a distraction go unused, let’s contrast temperature data with mobility patterns for parks.
To account for temperature, I draw on the rnoaapackage which facilitates access to the comprehensive dataset of the US National Oceanic and Atmospheric Administration (unfortuantely though, it doesn’t provide data for all nine Austrian states.1)
library(ggbeeswarm)plot_temp <- df_temp_mobility %>%ggplot()+labs(x="daily average temperature",y="% change to pre-Covid19 baseline period",title="Changes in presences in parks, Covid19 lockdown measures and weather",subtitle="Average temperature of state's captial used",caption=c("data: NOAA, Google Mobility Reports", "graph: Roland Schmidt | @zoowalk | www.werk.statt.codes"))+ ggbeeswarm::geom_quasirandom(aes(x=tavg,y=google.value,color=lockdown.indicator),size=.5,groupOnX = T)+scale_color_manual(values=c("pre-lockdown"="#008B00","lockdown"="#EE0000"),name=NULL)+scale_y_continuous(labels=scales::label_percent(accuracy =1,scale=1),limits=c(-100, 200),position="right")+scale_x_continuous(labels=scales::label_number(suffix="°",accuracy =1))+theme_post()+theme(axis.title.x =element_text(size =6,color="grey30",hjust=1),axis.title.y =element_text(size =6,color="grey30",hjust=1),legend.position="bottom",legend.direction ="horizontal",plot.background =element_rect(fill=plot_bg_color, color=plot_bg_color),strip.text.y =element_text(hjust=1))+ lemon::facet_rep_grid(day.indicator~sub_region_1,repeat.tick.labels = T,switch ="y")
Admittedly, this is an oversimplification, and I’ll only focus here on business days. But what the graph shows is that numbers in parks dropped following the lockdown as long as temperatures remained relatively low. However, once temperature started to rise, numbers increased and exceeded pre-Covid19 levels (base line period). The latter is not surprising, considering that the base line period runs 3 January to 6 February, hence much colder days.
4.1.3 Residential
A critical difference of the residential category is its unit of measurement. While the other categories measure changes in total visitors, the residential category shows a ‘change in duration’. According to Google’s documentation of its mobility report ‘because people already spend so much of the day at places of residence (even on workdays), the capacity for change isn’t so large.’ Even at the early stages of the lockdown, when individuals were most compliant and cautious, the pertaining values ‘only’ increased by roughly 25 %. Unsurprisingly, these changes were stronger for business days than for weekends. Gradually, even before any formal restrictions were lifted, the duration of presence has been declining. By the end of May, the pertaining values are between six and nine percent above pre-Covid19 levels.
This dynamic fits pretty well with my own, completely personal observations. While most people in our neighborhood initially left their home in very few instances, people got eventually more relaxed, spend time outside, or even returned to their workplace. The remaining gap at the end of May is likely to be also indicative for the increased use of home-office/remote work and the thousands of newly unemployed.
4.1.4 Workplace
The data for the workplace category is imho quite impressive since it shows in someway the scale of Covid19’s economic impact. Even by the end of May, at a point in time when many restrictions were already lifted, the number of persons at their workplaces is still around 30 % lower than during pre-Covid19 levels.
A detail what is striking is the East-West difference when it comes to the dynamic during weekends. In the eastern states, numbers of weekends started to increase relatively early and in clear contrast to business days. Or to put it differently, the difference of the number of persons at their workplace at weekends before COVID and during the lockdown was higher in the west than in the east. Again, I can only speculate, but I wouldn’t surprised if tourism plays a significant part in the explanations. In areas with particularly strong tourism during the base line period (=winter, particularly Tyrol and Salzburg), work during the weekend is far much common than in other areas of Austria. Shops can open also on Sundays; hotels etc obviously as well.
4.1.5 Retail and Recreation
Places related to retail and recreation experienced a remarkable sudden drop following the introduction of the lockdown on 14 March. Subsequently, and at a closer look, values increased almost ‘stepwise’, following the re-opening of small shops on 14 April, the opening of all other shops on 4 May and more recently the opening of restaurants and school on 18 May. What stands out is the particularly strong gap in Tyrol and Salzburg. I can only speculate, but I could imagine that this has something to do with both state’s strong tourism industry and the absence of tourists also after the removal of various restrictions.
4.1.6 Transit station
As with most other results, the data on transit stations also reveals a steady increase, starting with the end of March. However, despite this growth there is still a considerable gap to the pre-Covid19 lockdown level. As of end of May, values are still down, ranging between -45% (Tyrol) and -16% (Carinthia). As for Vienna (-32 %), the low number ties in well with recent news reporting on the city’s public transport system.
I am not sure why the numbers related to Burgenland are missing from mid-April onward. Burgenland would be a state which - as far as I can tell - features particularly strong numbers of commuters (to Vienna). According to Google, its reports can contain gaps when the data doesn’t meet the quality and privacy threshold (i.e. not enough data to ensure anonymity; see here). As for the latter, I would be surprised if the number of commuters dropped to such a low level that revealing the pertaining numbers would facilitate identifying individual Android users. Furthermore, the numbers only started to be missing from mid-April onward, hence from a point in time when the number of persons present on transit stations was likely to increase.
4.2 Recap
Overall, I find Google’s mobility reports quite informative about where people spend their time in the course of this epidemic and the interplay with various restrictions. While the data show that ‘normality’ has almost returned in some areas (grocery), it’s still impressive how fundamental the impact remains in others (workplace, transport).
Footnotes
As a proxy for the weather I used the weather data for each state’s captial.↩︎