Jay Ghosh
modelthumbnail.gif

Colorado Election Modeling

Modeling the 2018 Colorado Gubernatorial Election

 

I wanted to see if Colorado would follow the same national racial voting patterns as the 2016 Presidential election, in its 2018 Gubernatorial election between Jared Polis (D) and Walker Stapleton (R). I am essentially trying to determine if race is the most important factor in Colorado elections.

 

To do this, I downloaded election data from the Colorado government about how each precinct in Colorado voted based on the candidates and ballot initiatives. In my opinion, this data was horribly structured with each row being its own issue/candidate for every precinct and I needed to code in Python to clean it up to a usable state.

dataexample1.png

I then condensed 170,146 rows of the above data, into 64 rows succinctly formatted for my use.

I also downloaded demographic data from the Colorado government about the racial makeup of each county in Colorado. Like the previous data-set, this data was horribly structured with each row representing a different racial category for each and every county, with a not very clearly defined Hispanic or mixed race category.

So I used Python again to clean up 513 rows of data into 64 usable rows.

Now the last bit of data I needed was the national racial voting patterns from the 2016 presidential election. To do this, I used Python to scrape a table from https://ropercenter.cornell.edu/how-groups-voted-2016 and grabbed the racial demographics information.

I then imported these 3 data-sets into a Google Sheet where I began to craft my model. Essentially what I did to create my model is I would multiply the percentage of African Americans who voted for Clinton by the number of African Americans in a particular county and I called that column African American Democrat Projections. I did the same for the percentage of African Americans who voted for Trump. I repeated this calculation for every racial category in every single county in Colorado. I then summed my total Democratic projections and summed my total Republican projections and divided each sum by the total of all of the people in all of the counties. I then took those percentages and subtracted the Republican percent by the Democrat percent and got a differential of 0.4482250924%, which indicates that in my race-based model, Stapleton (R) would have won by less than half a percentage point. In reality, Polis (D) won by 10.6%, which indicated that the Colorado gubernatorial race did not follow the same racial voting pattern as occurred nationally in the 2016 presidential election.. 

 

I visualized this election model below:

 

 

This analysis was done using publicly available data. If you want to view my data and/or my code, please take a look at my Github here.