Analyzing Unemployment Rates in Barcelona with Interactive Visualizations

Overview of the impact of COVID-19 and social inequalities on unemployment rates in Barcelona.

Amanda Iglesias Moreno
Towards Data Science

--

Watercolor by Eduardo Iglesias (published here with the authorization from the author)

The financial crisis of 2008 had a significant impact on the Spanish economy, particularly in terms of unemployment. However, from 2012, Spain was undergoing a slow but continuous economic recovery. The coronavirus pandemic has ended with a growth that seemed unstoppable, increasing again unemployment levels across the whole country.

This article analyzes unemployment rates across all the neighborhoods of Barcelona in the last 8 years. The study aims to respond to multiple aspects related to the temporal and geographical distribution of unemployment rates. How much impact has the corona crisis had in terms of unemployment? Which neighborhoods have been most severely affected by the crisis? Where are the areas with higher levels of unemployment located? Is there gender equality in terms of unemployment? And many more questions… keep reading ❤️

Open Data Barcelona

All the data sets used in this article were obtained in Open Data Barcelona:

  • Weight of the registered unemployment in the population from 16 to 64 years of age of the city of Barcelona
  • Registered unemployment classified by duration of the city of Barcelona
  • Registered unemployment in the city of Barcelona
  • Average tax revenue per household of the city of Barcelona

Temporal evolution of unemployment rates by neighborhood

We start the article by analyzing the evolution of unemployment rates in the different districts across Barcelona. The interactive visualization below shows the evolution of unemployment rates from January 2012 to December 2020. Each line represents a neighborhood of Barcelona, 72 in total (sorted alphabetically). By default, no line is visible with the exception of Baró de Viver; however, we can easily activate/deactivate lines of the plot just by clicking on their respective names on the legend.

As we interact with the visualization, we will notice a couple of interesting insights. Since 2012 (we do not have previous data), we can observe an overall downward trend in unemployment rates across practically all neighborhoods. The city was still recovering from the financial crisis of 2008 when the crisis of coronavirus hit hard the economy of Barcelona once again. In many neighborhoods, we can notice a rapid growth in unemployment from February 2020 until June 2020. From that time on, we however observe a much slower increment.

Since 2012, we can observe a constant recovery in terms of unemployment rates across all neighborhoods in Barcelona. This recovery was broken in February 2020 with the corona crisis.

Another aspect that you might notice while interacting with the visualization above is the different evolution of unemployment rates across neighborhoods. Although the overall trend is practically the same in all neighborhoods, we can observe a greater seasonal variation in employment (mainly linked to tourism and the Christmas season) in districts with higher unemployment rates. The visualization below shows the evolution of unemployment rates in high-unemployment districts. As you can observe, there is generally a precipitous drop from April — May to July — August, followed by a considerably less pronounced decrease around New Year.

Evolution of unemployment in districts with higher unemployment rates

However, the situation is quite different in neighborhoods with lower unemployment rates. Those districts do not present seasonal variations. This is partly because the type of employment in these areas requires a higher educational background and is, therefore, more stable. But the abundance of skilled manpower is not the only reason why those districts have more stable employment. We do not have to forget that those are also the neighborhoods of Barcelona with a higher income per capita, as we will see later on.

Evolution of unemployment in districts with lower unemployment rates

We observe a greater seasonal variation in unemployment in districts with higher unemployment rates.

Spatial distribution of unemployment rates by neighborhood

When working with geospatial data, it’s often useful to visually inspect the data on a map. In this particular case, a choropleth map is the best choice. Choropleth maps provide an easy way to visualize how a variable changes across a region by using shaded areas. These areas are commonly administrative sections such as countries, cities, states, or as in this case neighborhoods.

The maps below represent the distribution of unemployment rates across Barcelona for each year (from 2012 to 2020 — one map per year). Before rendering the map, we have calculated yearly unemployment rates per neighborhood, as it does not make any sense to provide 108 choropleth maps (one per month). As we will see below, the distribution of unemployment rates has barely changed over the past few years so providing yearly data turns out more meaningful.

When designing a visualization, the use of color is one of the key elements we should always keep in mind. Colors have meanings associated with them, and therefore it is important to use them accordingly to avoid misunderstandings. On the map below, we have chosen to use a diverging color scheme. This scheme is designed for situations where low and high values in the data should be emphasized. In this particular case, the RdYlGr scheme (previously flipped) was applied to the choropleth maps to highlight the neighborhoods with lower (depicted in green) and higher (depicted in red) unemployment rates.

The regions with higher unemployment rates are located near the port and on the inner northside of the city.

As we interact with the visualization, we will notice a couple of interesting insights. The regions with higher unemployment rates are located near the port and on the inner northside of the city. Even though the jobless rate has fallen in those neighborhoods from 2012 until 2020, these districts have always had the highest unemployment rates in the city. Additionally, we can observe that unemployment rates are not geographically evenly distributed across Barcelona, as the most affected regions have around 4 times more unemployment than the neighborhoods with lower rates.

The unemployment rates are not evenly distributed across the city, as the most affected neighborhoods have around 4 times more unemployment than the ones with lower rates.

Impact of COVID-19 in unemployment rates

The coronavirus outbreak has seriously affected the global economy; particularly, Spain shed over half a million jobs in 2020. That makes sense, as the Spanish economy is mainly based on tourism without having a strong production sector as other European countries do. However, with the previous visualizations, it is impossible to figure out which districts have been hardest hit by the corona crisis in terms of unemployment. The visualization below is designed to address this problem. It illustrates the relative change of unemployment rates by neighborhood sorted in descending order (showing only the top 10). The relative change (in %) is calculated using the following formula.

Percent Change = ((Rate in December 2020 - Rate in December 2019) / Rate in December 2019) * 100

As expected, all neighborhoods in Barcelona faced a rise in unemployment last year, ranging from 17.11 (el Bon Pastor) to 65.5 (el Raval). There are in total 6 districts that have experienced a relative change in unemployment rates greater than 40% during the corona crisis: el Raval, el Poble-sec, la Font de la Guatlla, la Dreta de l’Eixample, la Barceloneta, and Sant Pere, Santa Caterina i la Ribera. However, as shown below, there is no relationship between unemployment rates just before starting the corona crisis and relative changes in unemployment a year later, meaning districts with higher unemployment rates did not suffer larger relative increases than neighborhoods with lower unemployment ratios.

All neighborhoods in Barcelona faced a rise in unemployment as a consequence of the corona crisis.

There is no relation between unemployment rates in December 2019 and the increment of unemployment as a result of the coronavirus pandemic (by neighborhoods).

El Raval is the neighborhood that has been most affected by the corona crisis in terms of unemployment, reaching even the unemployment ratio of 2012. The image below shows the relative change in unemployment rates during the corona crisis, this time using a choropleth map. As you can observe, the most affected areas are located near the port; however, as mentioned before, we can not observe a relationship between relative changes in unemployment from December 2019 to December 2020 and unemployment rates in December 2019 just before the corona crisis started (depicted above in a scatter plot as well).

The neighborhood el Raval has been most affected by the corona crisis in terms of unemployment

Number of unemployed (All neighborhoods) by duration

Open Data Barcelona provides also information about the number of unemployed by duration and district. The following plot shows the number of unemployed by duration for all neighborhoods (aggregated values) from January 2013 until December 2020. As can be observed, the number of unemployed (for the three groups of duration) decreases continuously over time till the outbreak of the corona crisis. From that moment on, the number of unemployed up to 6 months increases rapidly until May 2020, which shows that many workers were fired at the beginning of the crisis. From June on, we observe a precipitous drop in the number of unemployed up to 6 months, meaning that no additional employees were fired. However, the workers fired during the corona pandemic with great certainty did not find a job during the crisis, since the number of long-term unemployed (more than six months) has not stopped growing since the beginning of the crisis.

The workers fired during the corona pandemic with great certainty did not find a job during the crisis, since the number of long-term unemployed (more than six months) has not stopped growing since the beginning of the crisis.

Number of unemployed by gender

Gender equality must be a focal point in the agenda of any democratic country. And while it is true that the role of women has completely changed over the last decades in Spain, there is still work to do 💜.

The following plot shows the number of men and women unemployed in all neighborhoods (aggregate values). As you can observe, in December 2020, there were roughly 50k jobless women and 44k men in Barcelona. We observe that, for both genders, the number of unemployed has decreased steadily from 2013 till the beginning of the corona crisis; however, male unemployment has declined more rapidly. Men have benefited more than women from the economic growth in terms of employment.

If you are interested in a particular district, you can select it using the drop-down list located in the upper left corner. After interacting with the visualization for a while, you will notice that, in almost all neighborhoods, the number of unemployed women exceeds the number of men. As I said, there is still work to do 😉.

In almost all neighborhoods, the number of unemployed women exceeds the number of men.

To properly visualize the variation between districts, we will use a choropleth map. The following map shows the difference between the number of unemployed women and men by neighborhood in December 2020. The areas colored in pink represent the neighborhoods where the number of jobless women is larger than the number of men. As you can observe, there are many more districts where the number of unemployed women is higher, although in some of them the difference is not significant. El Raval is clearly an exception since the number of men exceeds the number of women in a meaningful way.

Unemployment vs income

Before wrapping up this article, we are going to analyze the relation between average income per household and unemployment rates in the various districts of the city of Barcelona. As shown previously, there are districts of the city of Barcelona with around 4 times more unemployment rates than others, and as you might expect, the same happens with income. As you can observe below, there is a strong negative relationship between income and unemployment, meaning the neighborhoods with high income per household also have low unemployment rates. In the following plot, the size of the bubbles represents the population between 16 and 64 and the animation (play and stop button) allows us to visualize the evolution of this relation between 2015 and 2018 (the only years we have information about income per household from Open Data Barcelona).

There is a strong negative relationship between income and unemployment, meaning the neighborhoods with high income per household also have low unemployment rates.

The plot above shows that social inequalities are present even in a city so prosperous and developed as Barcelona. In this sense, it is important that the administrations do everything they could to try to minimize those inequalities, ensuring that even those coming from low-income districts have equal opportunities in life, including of course the right to work.

Note: All the visualizations were created by the author

Thanks for reading 💜

Amanda Iglesias

--

--