In our collaborative research on the democratic rhetoric of IOs, we are developing explanatory models that explain why IOs use democracy as a normative point of reference when they describe who they are and what they do in their annual reports. In one of our models, we check if the economic inequality of an IO’s membership helps to explain this phenomenon. In this blog post, I illustrate how we calculate economic inequality. This may be of interest to some of you because I

• first show how to download the COW-IO dataset and the Penn World Tables data in `R`.
• Second, I show how to merge the two data-sets.
• Third, I show how to calculate the Gini-Coefficient of inequality for the IOs.

## Importing IGO membership data

First, I import the COW data-set and subset it for our research project’s sample of 20 IOs and then bring it into shape for the next steps.

Data in the COW data-set is only available until 2005. We need data until 2011 for our analysis. Therefore, we need to add information for the missing years. As a simplifying assumption, we assume that no countries have left an IO since

1. So, first we copy the 2005 data for the 2006-2011 years.

Next, we need to add data for the states that have joined the IOs since 2005. We have created a separate file (download), containing the new member states that is now added to the existing data.

The data now includes complete membership data for the IOs from 1980-2011.

## Importing Penn World Tables

Next, I import the Penn World Tables data. It includes annual GDP data for most of the states that are in the COW-IGO data-set. For the analysis, we use the `rgdpna` measure, which is “RealGDP at constant 2005 national prices (in mil. 2005US\$).”

Next, we have to match both data sources. This can be achieved with the help of the `countrycodes` package.

## Calculate inequality measures

Finally, we can calculate measures of inequality. Here, I limit myself to the Gini-coefficient. Other measures of inequality (e.g. the spread of the data, variances, etc) can be calculated in a similar way.

## Calculate share of LDCs in IO membership

As an additional measure of inequality, we look at the share of LDCs in the IOs’ membership. LDC data is taken from the United Nations (and summarized by us here.

## Plot

As the plots show, there is some variation across IOs when it comes to inequality. The general trend over time shows that IOs have become more unequal over the years.

``````library(googleVis)

# plot IO summaries
plot.df <- data.complete %>% group_by(ioname) %>% summarise(n_members = n(), gini = ineq(rgdpna))
pl1 <-  gvisBarChart(plot.df, xvar = "ioname", yvar = "gini", options = list(height = 450, width = 650))
``````
``````# plot annual summary
plot.df <- data.complete %>% group_by(year) %>% summarise(n_members = n(), gini = ineq(rgdpna))
plot.df\$year <- as.Date(as.character(plot.df\$year), "%Y")
pl2 <- gvisLineChart(plot.df, xvar = "year", yvar = "gini", options = list(height = 450, width = 650))
``````

And here’s a plot for the annual share of LDCs in our IO population

``````# plot annual summary
plot.df <- LDC.shares %>% group_by(year) %>% summarise(LDC_share = mean(LDC_share))
plot.df\$year <- as.Date(as.character(plot.df\$year), "%Y")
pl3 <- gvisLineChart(plot.df, xvar = "year", yvar = "LDC_share", options = list(height = 450, width = 650))
``````
Image