Using Social Media Data to Reveal Patterns of Policy Engagement in State Legislatures

This repository contains the replication code for the paper "Using Social Media Data to Reveal Patterns of Policy Engagement in State Legislatures", authored by Julia Payson, Andreu Casas, Jonathan Nagler, Richard Bonneau, and Joshua A. Tucker. Accepted for publication at State Politics and Policy Quarterly.

Abstract: State governments are tasked with making important policy decisions in the United States. How do state legislators use their public communications -particularly social media- to engage with policy debates? Due to previous data limitations, we lack systematic information about whether and how state legislators publicly discuss policy and how this behavior varies across contexts. Using Twitter data and state of the art topic modeling techniques, we introduce a method to study state legislator policy priorities and apply the method to fifteen U.S. states in 2018. We show that we are able to accurately capture the policy issues discussed by state legislators with substantially more accuracy than existing methods. We then present initial findings that validate the method and speak to debates in the literature. For example, state legislators in competitive districts are more likely to discuss policy than those in less competitive districts, and legislators from more professional legislatures discuss policy at similar rates to those in less professional legislatures. We conclude by discussing promising avenues for future state politics research using this new approach.

Data

The ./data/ directory contains the necessary data to replicate the analytical figures and tables of the paper. In the codebook.pdf we present a detailed description of each dataset and variables.

Code

The ./code/ directory contains separate scripts to replicate each analytical figure in the article. The ./figures/ directory contains a copy of each of the figures generated by these scripts.

  • 01-table02.R: To replicate Table 2 of the paper, describing the Twitter activity of state legislators from 15 states, by state and party.

  • 02-table05.R: To replicate Table 5 of the paper, describing the performance of the topic classifier by topic.

  • 03-table06.R: To replicate Table 6 of the paper, showing the top distinctive features of tweets predicted to be about each topic.

  • 04-figure02.R: To replicate Figure 2 of the paper, showing the results for three statistical models predicting Being on Twitter, Being Active, and iscussing Policy Issues.

  • 05-figure03.R: To replicate Figure 3 of the paper, showing the results OLS models predicting the proportion of tweets legislators dedicate to discussing each topic as a function of being on a committee on the topic

  • 06-figure04.R: To replicate Figure 4 of the paper, showing Proportion of attention that legislators from each state devoted to each issue area in 2018

  • 07-figure05.R: To replicate Figure 5 of the paper, Comparing attention by representatives in Congress and State Legislators