This project examines politically polarizing speech on Twitter posted by US political leaders during the 2022 midterm election cycles. This repository contains the code necessary to replicate the analysis.
The study is forthcoming at the journal Socius. Once it is published, we will update this archive with a citation.
There are two files:
(1) An R script named "Replication.R" that contains the majority of the data management, model building, and post-processing.
(2) A Python script named "VADER_Minimal.py" that will calculate the VADER compound score that is used the analysis.
Both files have dependencies. For R, we relied on the tidyverse, e1071, glmmTMB, ggeffects, stringr, tidytext, and reticulate packages. The Python program depends on the pandas and vaderSentiment libraries.