IATI Import for Stata

Overall, I have been very impressed with the level of support of the foreign aid community globally for open data.  The International Aid Transparency Initiative in particular has championed this cause and now functions as a centralized clearinghouse for such data in the IATI standard.

As a sociologist who sometimes analyzes aid data for my research or to help in my teaching, I have been frustrated on occasion by the inaccessibility of some IATI data, especially if I had hoped to do any sort of analysis in Stata (my statistical program of choice).  A few years ago I spent too much time banging my head against the wall trying to convert Canada’s IATI data file from its original XML format via CSV into a workable Stata file.  More recently, with the implementation of the IATI Datastore API and its handy CSV query builder, accessing this data has never been easier.

To save myself from manually importing every CSV file downloaded from the IATI datasore into Stata for analysis individually, I set about writing a basic program for Stata which calls upon the IATI Datastore API, converts, cleans, and saves donor activity files in Stata format, ready to be analyzed.

It is my first effort at programming a Stata command, so I expect it will undergo frequent revision over the next while.  At present it is limited to importing the activity files of donors who publish to IATI and specifying the starting month of a fiscal year to account for different national practices.  I have tested the program with many of the major bilateral and multilateral donor agencies publishing to IATI (see the help file for the iati command), but it should in theory work with any IATI publisher.

If you decide to try out the program, please let me know if you encounter any bugs or have suggestions for improvement.  I hope a future version of the script will be able to include options for all of the functionalities of the IATI API, including downloading transaction and organization data files rather than only activities.  Furthermore, some additional cleaning of the imported data may be required with some donors’ files, as there seems to be significant variability between publishers.

Update: I have received a question about the fiscal year option in this module.  The iati command imports the original start and end dates of the aid activity, but also creates a starting and ending fiscal year variable for each activity.  By specifying a different start month for the fiscal year in various countries, you are able to control which fiscal year a given set of activities is assigned to for start and end dates.

Download/Install

Version 1.0 of this program is available here.  Files should be installed directly into your Stata ado folder.

iati is also available on the SSC Stata Program respository and can be installed within the Stata program by typing:

ssc install iati

 

Syntax

Use of the command is simple.  The syntax is as follows:

iati donorcode, fy(month)

For example, if I want to import all the existing IATI activity data for Global Affairs Canada with a fiscal year starting in April, the syntax is:

iati CA-3, fy(4)

For USAID, with a FY starting in October:

iati US-1, fy(10)

For the World Bank:

iati 44000

 

 

Global Aid Network redux

My last nwmovie test using the full 51 years of OECD aid network data I  collected for my SSHRC-funded project “The Institutionalization of the Global Foreign Aid Network 1960-2008”.  Nodes are sized by in- and outdegree centrality for donors (red) and recipients (blue) respectively, though on different scales.  The process of visualizing and rendering the animated GIF takes a couple of hours on my desktop machine.  I look forward to working through the other nwcommands tools over the next while to  make the most of its tools.

GlobalAid

Canada’s Bilateral Aid Network over Time

Following on my recent post on visualizing the global aid network using the nwcommands package in Stata, I thought I would try my luck at another animated visualization of Canada’s ‘ego network’ of aid ties from 1960 through 2010.  I managed to achieve the sizing of nodes by USD value of aid ties over time for recipient countries, which shows how concentrated Canadian aid was in given periods in just a few countries, though we maintained nominal ties with many others.  The animation of a single ego-network seems less smooth than my earlier attempt at the global network, and I was unable to resolve that issue despite several attempts.  In any case, another interesting illustration of the evolution of Canada’s aid network over time as it becomes increasing dense over the course of the five decades shown.

CanadaEgoNet

 

Global Aid Network Visualization: nwmovie in Stata

I’ve been exploring Thomas Grund‘s excellent nwcommands package for Stata with the 50 years of aid network data collected from the OECD DAC. It appears to have many functionalities that appeal to the existing Stata user who wants to do SNA and also seems to incorporate some good tools to deal with longitudinal networks.  One interesting function is its nwmovie command which will animate sociogram visualizations of networks over time.  I tested this with an excerpt from my longitudinal aid network data and arrived at the GIF below as a result.

movie

Because it seems to only function with networks of identical size, I limited the sample to the period from 2002-2010, where each year in of my network data has 216 nodes including bilateral donors, major multilateral donors, and recipients.  I labelled each node and tried to differentiate nodes based on degree centrality (node size), and donor/recipient status (colour/symbol).  I am pretty sure the final result is only showing the degree centrality for 2010, and although the colour reflects the mode status of my 2-mode network, the symbol does not.  I will need to play with the syntax further to refine future versions.

As an analytic tool, the network density combined with the size/speed of the image makes it tricky to examine the evolving network in detail, but it is interesting to see countries/multilateral donor agencies move in and out of the ‘isolates’ in the bottom right hand corner.  The creation of the Global Fund and GAVI are two notable movements you can see here, as well as the integration of several ‘new’ bilateral donors like Thailand.  Overall, an interesting tool. It is not going to show up on the pages of a printed journal article anytime soon, but very interesting to see the potential for visualizing the global aid network in this way.  I look forward to exploring this tool and the rest of the nwcommands package over the course of the next few months.

 

Update: I have posted another test of this script looking at Canada’s evolving aid ego-network.

Update 2: I have posted an updated version of the global network that encompasses 1960-2010.