Data & Methodology

Data Sources

  • Google Trends - Monthly search term data for debt-related queries. The graphs made from this data are scaled so that the lowest value is 0 and the highest value is 100. Also, each term is independent of the others;
  • Reddit Data - Historical Reddit posts and comments from 2005-2024 for r/politics and r/economics, totaling 27 GB of data to parse through.

Data Processing Pipeline for Google Trends

  1. Fetch the monthly data from Google Trends for each term
  2. Normalize the data to a Z-score
  3. Run an OLS regression on inflation expectations to get the coefficients for each term
  4. Save the data to a csv file. Plot all data using matplotlib.

Data Processing Pipeline for Reddit Data

  1. Fetch the subreddit data from the academic torrents dataset (qBittorrent client).
  2. Parse through the data to find all the posts and comments containing "national debt" or "national deficit"
  3. Collect the data of all comments on posts containing "national debt" or "national deficit" and save it to a csv file.
  4. Use the Twitter Roberta model to get the sentiment of the comments.
  5. Save the data to a csv file. Plot all data using matplotlib.