2018 - 2019 Academic Year

The workshop will meet on Fridays 3:30-5:00pm in Room 707 International Affairs Building, except where otherwise noted below.

Date
(Schedule Change)
Topic Presenter
28 Sep 2018
(3:30pm, IAB 1201)
Formal Models and Lab Experiments Giovanna Invernizzi
05 Oct 2018 Intro to Python Jeff Jacobs
19 Oct 2018 Web Scraping in R Erin York
2 Nov 2018 Working with Interview Data Colleen Wood
9 Nov 2018 Introduction to GIS in R - Volume 1 Merlin Noël Heidemanns
30 Nov 2018
(3:30pm, IAB 1201)
RDDs: Theory and Practice Pablo Argonte
8 Feb 2019 Sentiment Analysis Jeff Jacobs
22 Feb 2019 Bayesian Process Tracing Theo Milonopoulos
1 Mar 2019 Regular Expressions Julian Gerez
8 Mar 2019 Conceptualizing Democracy Charles Battaglini
15 Mar 2019 The BIQQ Framework Simone Paci
5 Apr 2019 SurveyCTO Dylan Groves
24 Apr 2019 Introduction to GIS in R - Volume 2 Merlin Noël Heidemanns
3 May 2019 Design, Implementation and Analysis of Conjoint experiments Anja Kilibarda and Julia Rubio

Workshop Materials

Applied Social Network Analysis: Estimating Peer to Peer Interactions

Presenter: John Marshall

Plan

I’m going to be presenting results and intended analyses from a working paper, which uses shocks to second-degree connections to estimate the effect of information passed from peer to peer. I intend to go through the method and some of the data issues involved (including construction of networks), as well as present the results and some of the ways we are thinking about (and difficulties of) robustness checks.

Social Network Analysis

Presenter: Jeff Jacobs

Plan

Now that we have got our Python distribution installed, this week we will take a look at NetworkX, a Python library designed for easy creation, analysis, and visualization of network structures. Along the way we’ll learn more broadly useful Python “tricks” and data manipulation techniques, so hopefully you can get a lot out of it even if you never end up doing network analysis!

Setup Instructions

  1. Follow the setup instructions from last week, if you haven’t already
  2. Use the pip (or pip3 if you use python3) utility to install networkx (pip install networkx or pip3 install networkx, respectively) and matplotlib (pip install matplotlib or pip3 install matplotlib) from your terminal.
  3. Download Gephi from https://gephi.org/

All of the materials for this week are within this Dropbox folder. We will be going through NetworkX_Tutorial.pdf and examining/running/editing the code examples (basic_network.py and country_network.py) throughout.

How I Learned to Let Go and Love Python: An R Story

Presenter: Joe Sutherland

Link to the original post

Plan

It’s not always easy to let go, but in this case the reward far outweighs the risk! The purpose of this session is to introduce the ways in which Python supplants or supplements R in political science research. We will configure Python and Jupyter Notebook on your system, review package management, and collaborate to rewrite a commonly used R script in Python.

Setup Instructions

  1. Install Homebrew if you’re on a Mac, or Chocolatey if you’re on a PC by following the instructions at their homepages.
  2. Install the Python distribution. This will also install Python’s package manager, pip.
    • Mac: brew install python python3.
    • PC: choco install python python3 (run as administrator).
  3. Use pip to install jupyter notebook.
    • Mac: pip install jupyter.
    • PC: pip install jupyter (run as administrator).

Booting Jupyter notebook

To boot the notebook, simply: jupyter notebook (on PC it is sometimes jupyter notepad) from the command line.

  • Github Repository with Materials (to get the materials on your computer you either need to install git and then git clone https://github.com/jlsutherland/learn-to-love-python.git in your command line, or simply download .zip file directly from github using clone or download button).

Workflow

Presenter: Abhit Bhandari

Plan

We’ll be looking at, among other things, how to efficiently integrate our R code (and the figures, tables, etc. we generate) and LaTeX when writing papers. We’ll be using Sublime Text 2 as our LaTeX editor, and I’ll be demonstrating some neat things you can do with it. Here are some links to things that you should have downloaded on your system before Friday’s seminar if you don’t have them already. If you have any problems, Gosha and I will be circulating at the beginning of the workshop on Friday to help people get all set up.

  1. Sublime Text version 2.0.2
  2. If you’re on a Mac, Skim PDF viewer. If on Windows, Sumatra PDF viewer
  3. The LaTeXTools plugin for Sublime Text. The plugin’s GitHub page has some very useful documentation. To install LaTeXTools, we’ll first need Package Control. Code and instructions for Package Control’s installation can be found on this page. We’ll also go over this at the beginning of the session in case there’s any confusion. In general, though, try to go through your OS-specific instructions (at the top of the GitHub documentation) beforehand.

Intro to Machine Learning

Presenter: Grant Gordon

Install R Packages:

  • nnet, randomForest, e1071

Selected Background Papers:

  • Murphy, Kevin P. 2012. Machine Learning: A Probabilistic Perspective. Cambridge, MA: The MIT Press.
    • Read Chapter 1: Introduction
  • Brieman, Leo. 2001. “Statistical Modeling: The Two Cultures.” Statistical Science. 16(3): 199-231.
  • Hastie, Trevor and Robert Tibshirani and Jerome Friedman. 2008. “The Elements of Statistical Learning: Data Mining, Inference and Prediction.” New York, NY: Springer Series.
    • Read Chapter 7: Model Assessment and Selection
    • Read this
    • Note: When you have time, read the rest of this book!

Applied Papers

Note: These papers feature two applications of machine learning to political science.

  1. Predicting Conflict
    • Beck, Nathaniel, Gary King and Langsche Zeng. 2000. I”mproving Quantitative Studies of International Conflict: A conjecture.” The American Political Science Review. 94(1): 21-35.
    • Ward, Michael D and Brian Greenhill and Kristin Bakke. 2010. “The Perils of Policy by P-value: Predicting Civil Conflicts” Journal of Peace Research. 47(4):363-375.
  2. Heterogeneous Treatment Effects
    • Imai, Kosuke and Marc Ratkovic. 2013. “Estimating Treatment Effect Heterogeneity in Randomized Program Evaluation.” The Annals of Applied Statistics. 7(1): 443-470.
    • Green, Donald P. and Holger L. Kern. 2012. “Modeling Heterogeneous Treatment Effects in Survey Experiments with Bayesian Additive Regression Trees.” Public Opinion Quarterly. 76: 491-511

Other Resources.

Note: Many of the leading professors in machine learning post their course lectures, problem sets (and answers, and code online). A few worth visiting are: