Skip to content

ayush-verma07/ElectionModel-AP_Research

Repository files navigation

ElectionModel-AP_Research

Polling Simulation Analysis for Cruz vs. Allred This repository contains R code for simulating election outcomes based on polling data for the 2024 Texas Senate race between Ted Cruz and Colin Allred.

Overview: The simulation models the probability of victory for each candidate using polling data, logistic regression, and Monte Carlo simulations. It provides insights into win probabilities and average margins of victory.

Key Findings:

Cruz Win Probability: 71% of simulations.

Mean Margin of Victory (Cruz): 4.18 percentage points.

Files:

poll_simulation.R: Main R script with data loading, modeling, and simulation.

pollresult.csv: Example polling dataset (not included here, add separately).

CruzSimulatedWinRate_Results.png: Distribution of Cruz's simulated win rate

TexasSenateMarginofVictory_Results.png: Distribution of election predicted margin of victory

Requirements: R version 4.0 or higher

Libraries: caret, glmnet, ggplot2

About

Simulating election outcomes for 2024 Texas Senate election.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages