Jerryx2020 / US_election_prediction

0 stars 0 forks source link

Predicting the 2024 U.S. Presidential Election

Overview

This repository offers forecasts for the 2024 U.S. presidential election using a "poll of polls" approach, aggregating data from multiple polling sources to enhance prediction accuracy. By integrating different polling datasets, this project aims to provide a comprehensive analysis of electoral trends and forecast potential outcomes.

The raw polling data was obtained from FiveThirtyEight, which aggregates national polling data for the 2024 presidential election. The original data is available here: FiveThirtyEight Poll Aggregation.

File Structure

The repository is organized as follows:

Statement on LLM Usage

The code in this repository was partially developed with the assistance of ChatGPT-4o. Specifically, the LLM was consulted during the data simulation process, for assistance with visualizations, and for refining some modeling approaches. Detailed transcripts of interactions with ChatGPT-4o are available in other/llm_usage. These records ensure transparency regarding the contributions of AI to this project.

Instructions

  1. Data Preparation: Begin by running the scripts in scripts/ to simulate, download, and clean the polling data. The sequence of scripts is numbered to guide the user through the data preparation steps.
  2. Analysis: Use the cleaned data in data/02-analysis_data for exploratory analysis and summary statistics. The exploratory data analysis script can be found in scripts/05-exploratory_data_analysis.R.
  3. Modeling: Execute the modeling scripts in scripts/ to build predictive models. The fitted models are saved in the models/ directory, and summary results are located in data/05-model_results.
  4. Paper Generation: To generate the final paper, use the Quarto document (paper.qmd) in the paper/ directory. The document can be rendered to PDF to produce a complete report of the analysis.

Citation

If you use this repository, please cite it accordingly. Additionally, cite FiveThirtyEight as the source for polling data, as well as any other sources referenced in references.bib.