Open-NC / Are-We-Represented

Main repository for the Are We Represented? project
4 stars 1 forks source link

Obtain & prepare registered voter data #7

Open ejaxon opened 6 years ago

ejaxon commented 6 years ago

We can get the statewide dataset for $25 here, but may be able to get for free. See, e.g., this link that @copelco pointed out.

Deliverables for this task include the data and documentation on how it was obtained, ideally in the form of a Python or R script that does it.

ChrisTheDBA commented 6 years ago

Those links are slightly out of date

The entire voter reg database is at this link - https://s3.amazonaws.com/dl.ncsbe.gov/data/ncvoter_Statewide.zip

The voter history is at - https://s3.amazonaws.com/dl.ncsbe.gov/data/ncvhis_Statewide.zip

wandernat commented 6 years ago

I've created a simple CSV file of county registration statistics as of 5/26/18. I posted it here: https://github.com/wandernat/North-Carolina-Voter-Registration-Statistics/blob/master/NCVR_2018May26.csv

What I did was copy the JSON data from the source of this website https://vt.ncsbe.gov/RegStat/Results/?date=05%2F26%2F2018 and stored it in its own JSON file https://github.com/wandernat/North-Carolina-Voter-Registration-Statistics/blob/master/counties.json. Then I imported it into R and turned it into a CSV file. Now it's super easy to make visualizations using this data. No need to mess with the huge data files.

Please note that the variable "UnDisclosed Gender" is included in the JSON data but not on the table published to the website.

I could do the same for any date listed here: https://vt.ncsbe.gov/RegStat/

wandernat commented 6 years ago

I noticed that grabbing the data from the NCSBE webpage as I describe above left out certain demographics - namely Asians. So, I downloaded a fresh copy of the statewide voter registration database and used R to create a more complete demographic database. Josh helped me use GitHub and so I uploaded the database and my R code here: https://github.com/Open-NC/Are-We-Represented/tree/master/nc-voter-demographics