Python for Political Scientists, Spring 2013 Recap

pythonThis spring Josh Cutler‘s Python course was back by popular demand. (This time it was known as “Computational Political Economy” but I like the less formal title.) I participated this time around as a teaching assistant rather than student, and it was a thoroughly enjoyable experience. The course syllabus and schedule is on Github.

Class participants were expected to have a basic familiarity with Python from going through Zed Shaw’s book over Christmas break outside of class. Each Tuesday Josh would walk them through a new computer science concept and explain how it could be used for social science research. These topics included databases, networks, web scraping, and linear programming. On Thursdays they would come to a lab session and work together in small groups to solve problems or answer questions based on some starter code that I supplied. I generally tried to make the examples relevant and fun but you would have to ask them whether I succeeded.

The class ended this past Saturday with final presentations, which were all great. The first project scraped data from the UN Millenium Development Goal reports and World Bank statistics to compare measures of maternal mortality in five African countries and show how they differed–within the same country! This reminded me of Morten Jerven’s book Poor Numbers on the inaccuracy of African development statistics (interview here).

In the second presentation, simulated students were treated with one of several education interventions to see how their abilities changed over time. These interventions could be applied uniformly to everyone or targeted at those in the bottom half of the distribution. Each child in the model had three abilities that interacted in different ways, and interventions could target just one of these abilities or several in combination. Combining these models with empirical data on programs like Head Start is an interesting research program.

The third presentation also used a computational model. Finding equilibrium networks of interstate alliances is incredibly difficult (if not impossible) to do analytically when the number of states is large. The model starts with pre-specified utility functions and runs until the network hits an equilibria. Changing starting values allows for the discovery of multiple equilibria. This model will also be combined with empirical data in the future.

For the fourth and final presentation, one participant collected data on campaign events in Germany for each of the political parties during the current election cycle. This reminded me of a Washington Post website (now taken down) detailing campaign visits in 2008 that I scraped last year and used in lab once this semester.

These examples show the wide variety of uses for programming in social science. From saving time in data collection to generating models that could not be done without the help of algorithms, a little bit of programming knowledge goes a long way. Hopefully courses like this will become more prominent in social science graduate (and undergraduate) programs over the coming years. Thanks to Josh and all the class participants for making it a great semester!

____________

Note: I am happy to give each of the presenters credit for their work, but did not want to reveal their names here due to privacy concerns. If you have questions about any of the presentations I can put you in touch with their authors via email.