Evolution of welfare policies in the OECD: An interactive web-based mapping exercise using R and Plotly

PUBLISHED ON JUN 5, 2020 — R, CODE

Introduction

JobSeeker and JobKeeper benefits have been at the forefront of the national debate on government assistance in the post-Covid Australian economic landscape. Yet even before the global pandemic hit, welfare benefits were a controversial and often polarizing issue in Australia. Often missing from the national debate though is a discussion around how welfare benefits paid by the Australian government compare with those from other “welfare states” like Norway, France, and the UK. Which countries offer the most generous unemployment and sickness benefits to their citizens? Let’s make a few visualizations and see.

Data and libraries

The data for this exercise come from the Comparative Welfare Entitlements Dataset (CWED2), which can be found here. We will use the plotly and tidyverse libraries in R to make the plots below. One of the key functionalities of plotly is its web-based interactivity. As you work through the code, be sure to move your cursor on the timelines and circle markers to get a feel for the interactive nature of the plots. You should also use the menu options on the top right corner of the plots to isolate individual data points or get grouped statistics as you interact with the plots. To learn more about plotly and its many implementations (including in Python), check out the official documentation page.

## install required packages if you haven't already
## install.packages(c("plotly", "tidyverse"), dependencies = TRUE)

## call required libraries 
library(plotly)
library(tidyverse)

## save dataset in your working directory, import, and check
welfare_gen <- read_csv("cwed_subset.csv")
glimpse(welfare_gen)
## Rows: 1,344
## Columns: 33
## $ COUNTRY          <chr> "Australia", "Australia", "Australia", "Australia", …
## $ `COUNTRY ABBREV` <chr> "AUS", "AUS", "AUS", "AUS", "AUS", "AUS", "AUS", "AU…
## $ CCODE            <dbl> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1…
## $ YEAR             <dbl> 1970, 1971, 1972, 1973, 1974, 1975, 1976, 1977, 1978…
## $ ISOCODE          <dbl> 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, …
## $ TOTGEN           <dbl> NA, 18.4, 19.1, 20.5, 20.2, 20.2, 21.0, 21.2, 21.2, …
## $ UEGEN            <dbl> NA, 6.3, 6.7, 7.4, 7.2, 7.2, 7.5, 7.6, 7.6, 7.5, 7.2…
## $ SKGEN            <dbl> NA, 5.7, 6.0, 6.5, 6.4, 6.3, 6.6, 6.7, 6.6, 6.6, 6.4…
## $ PGEN             <dbl> NA, 6.4, 6.4, 6.7, 6.6, 6.7, 6.8, 6.9, 7.1, 7.1, 6.9…
## $ APWWage          <dbl> 4244, 4632, 5257, 6550, 7907, 9071, 10062, 10773, 11…
## $ US100            <dbl> NA, 0.149, 0.233, 0.268, 0.266, 0.261, 0.289, 0.309,…
## $ UC1000           <dbl> NA, 0.255, 0.336, 0.575, 0.518, 0.505, 0.627, 0.642,…
## $ SS100            <dbl> NA, 0.149, 0.233, 0.268, 0.266, 0.261, 0.289, 0.309,…
## $ SC1000           <dbl> NA, 0.255, 0.336, 0.575, 0.518, 0.505, 0.627, 0.642,…
## $ MPS100           <dbl> NA, 0.239, 0.237, 0.268, 0.266, NA, 0.289, 0.285, 0.…
## $ MPC1000          <dbl> NA, 0.392, 0.387, 0.434, 0.405, NA, 0.428, 0.423, 0.…
## $ SPS100           <dbl> NA, 0.239, 0.237, 0.268, 0.266, 0.261, 0.289, 0.285,…
## $ SPC1000          <dbl> NA, 0.392, 0.387, 0.434, 0.405, 0.381, 0.428, 0.423,…
## $ UEQUAL           <dbl> NA, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ UEDUR            <dbl> NA, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999…
## $ UEWAIT           <dbl> NA, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, …
## $ UECOV            <dbl> NA, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, …
## $ SICKQUAL         <dbl> NA, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ SICKDUR          <dbl> NA, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999…
## $ SICKWAIT         <dbl> NA, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, …
## $ SICKCOV          <dbl> NA, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, …
## $ PQUAL            <dbl> NA, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ PFUND            <dbl> NA, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ AVGPER           <dbl> NA, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ PENCOV           <dbl> NA, 0.624, 0.627, 0.685, 0.735, 0.767, 0.790, 0.808,…
## $ MRET             <dbl> NA, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, …
## $ FRET             <dbl> NA, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, …
## $ LEXP65           <dbl> 13.75, 14.30, 14.50, 14.60, 14.55, 15.05, 14.95, 15.…

First, let’s see how unemployment benefit generosity has changed in the period spanning 1970 to 2011 in Australia; one of the model welfare nations in the world. The variable UEGEN is the generosity index for unemployment benefits paid out by the Department of Social Security, and after 1997, Centrelink.

## filter by Australia 
welfare_gen_oz <- welfare_gen %>%
  filter(COUNTRY == "Australia")

## plot UEGEN over time
plot_ly(welfare_gen_oz, x = ~YEAR, y = ~UEGEN, type = "scatter", mode = "lines", color = I("brown")) %>%
  layout(title = "Unemployment Benefit Generosity in Australia, 1970-2011",
         xaxis = list(title = "Year"),
         yaxis = list(title = "Benefit Generosity"))

Next, let’s see how Australia compares to Norway, France, US and our neighbors New Zealand.

## subset dataset by countries of interest
welfare_gen_nor <- welfare_gen %>%
  filter(COUNTRY == "Australia" |
           COUNTRY == "Norway" |
           COUNTRY == "New Zealand" |
           COUNTRY == "France" |
           COUNTRY == "United States") 

## plot 
plot_ly(welfare_gen_nor, x = ~YEAR, y = ~UEGEN, type = "scatter", mode = "lines", color = ~COUNTRY) %>%
  layout(title = "Unemployment Benefit Generosity in the OECD, 1970-2011",
         xaxis = list(title = "Year"),
         yaxis = list(title = "Benefit Generosity"))

Australia (and New Zealand) lags appallingly behind countries like Norway France and the United States when it comes to unemployment welfare generosity. That said, unlike in most OECD countries, job seekers can remain on welfare indefinitely in Australia. There are also a number of other factors to consider such as rental assistance and other services that may be offered to make up for the differences that exist between welfare and unemployment insurance schemes.

Now, let’s look at how sickness insurance has changed in Australia over the last four decades.

welfare_gen_oz <- welfare_gen %>%
  filter(COUNTRY == "Australia")

plot_ly(welfare_gen_oz, x = ~YEAR, y = ~SKGEN, type = "scatter", mode = "lines", color = I("brown")) %>%
  layout(title = "Sickness Generosity in Australia, 1970-2011",
         xaxis = list(title = "Year"),
         yaxis = list(title = "Sickness Generosity"))

And compare it to the Norway, New Zealand, and France.

welfare_gen_nor <- welfare_gen %>%
  filter(COUNTRY == "Australia" |
           COUNTRY == "Norway" |
           COUNTRY == "New Zealand" |
           COUNTRY == "France")

plot_ly(welfare_gen_nor, x = ~YEAR, y = ~SKGEN, type = "scatter", mode = "lines", linetype = ~COUNTRY) %>%
  layout(title = "Sickness Generosity in the OECD, 1970-2011",
         xaxis = list(title = "Year"),
         yaxis = list(title = "Sickness Generosity"))

Finally, let’s see how it all comes together in the OECD for the year 2010, by plotting the total generosity score for each country (TOTGEN) as a function of sickness and unemployment generosity mapped onto the y- and x-axis respectively.

## subset dataset by year of interest 
welfare_gen_2010 <- welfare_gen %>%
  filter(YEAR == 2010)

plot_ly(welfare_gen_2010, x = ~UEGEN, y = ~SKGEN, text = ~COUNTRY, type = "scatter", mode = "markers",
        color = ~TOTGEN, marker = list(size = ~TOTGEN * 1.2, opacity = 0.5)) %>%
  layout(title = "Welfare Generosity in the OECD, 2011",
         xaxis = list(title = "Unemployment Generosity",
                    gridcolor = "rgb(255, 255, 255)",
                    gridwidth = 2),
         yaxis = list(title = "Sickness Generosity",
                   gridcolor = "rgb(255, 255, 255)",
                   gridwidth = 2),
         paper_bgcolor = "rgb(243, 243, 243)",
         plot_bgcolor = "rgb(243, 243, 243)",
         showlegend = FALSE)

Welfare benefit schemes are extremely complex and depend on a number of economic and country-specific factors. Therefore there is great variation in welfare policy even among countries that are well-known for their strong safety nets. Norway though has by far the most generous unemployment and sickness insurance in the OECD as of 2010.

Works Cited:

  • Scruggs, Lyle, Detlef Jahn and Kati Kuitto. 2014. “Comparative Welfare Entitlements Data Set 2, Version 2014‐03.”
TAGS: R, RSTATS, TUTORIAL