Most measures of ideology rely on the roll calls of legislative votes, but presidential candidates are often not members of Congress and, as such, do not have a voting record. This project develops a method for estimating ideology of any candidate based on their speeches, statements, and debates. I use speeches by Congress as training data. Ideology is estimated using Multinomial Inverse Regression (MNIR) on cleaned text data, a method that accommodates the intrinsic multinomial structure of text; politicians do not iteratively (or independently) choose each phrase in a speech, but do so simultaneously. I apply this method to the 2012 Presidential campaign and show a shift to more centrist speech by Mitt Romney after he had secured the primary.
Jupyter is a popular open-source application for interactive coding in a web browser. It provides a similar experience to RStudio, but for Python (and other languages). In this guide I outline my personal coding environment, which involves running Python on a Jupyter notebook hosted on a remote server. The setup allows for both Python 2 and 3 code, straightforward package management, provides an easy way to manage SSH tunnels, and can be used on most servers (including shared servers).