Skip to content

This project uses bootstrap sampling to analyze voting support rates for Republican and Democrat parties, using data from a sample of likely voters in the U.S. By resampling with replacement, it estimates average support rates and visualizes trends using a line plot.

Notifications You must be signed in to change notification settings

King7D/2024-US-Election-Prediction-OCT29

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

Bootstrap Analysis Project

Overview

This project involves analyzing voting support rates using a bootstrap simulation technique. The data is collected from a sample of likely voters in the United States, and the goal is to estimate the average support rates for the Republican and Democrat parties. We use a resampling method with replacement to approximate the variability in the original dataset and compute average support rates. image

Files Included

  • us_voters_with_votes_sample_data.csv: The dataset containing voter demographic information and their respective votes. The dataset is randomly generated from Atlas National Poll - United States Presidential Election 2024 with data from 10/25/2024 - 10/29/2024.
  • bootstrap_analysis.ipynb: The script that performs the bootstrap simulation, calculates the average support rates for the Republican and Democrat parties, and visualizes the results.

Methodology

  • Data Preparation: The dataset contains information about voting preferences and demographics. Voters are categorized by their party support (Republican, Democrat, Other, etc.), and the script maps each candidate to their respective party using a dictionary.

  • Bootstrap Simulation: The bootstrap method is used to create new samples from the original data by resampling with replacement. Each iteration of the bootstrap produces a sample from which party support rates are calculated. We repeat this process 1000 times to get a distribution of support rates.

  • Calculations and Visualization: After the bootstrap iterations, the average support rates for the Republican and Democrat parties are calculated. We also use a simple moving average (SMA) with a window size of 5 to smooth out the results, which are then visualized in a line plot.

About

This project uses bootstrap sampling to analyze voting support rates for Republican and Democrat parties, using data from a sample of likely voters in the U.S. By resampling with replacement, it estimates average support rates and visualizes trends using a line plot.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published