Friday, November 30, 2012

Measure S - Berkeley, CA

While I was relieved, on the day after election day, to shunt the burden of thinking any more about the absurdities of our electoral system and the partisanship across the Red State - Blue State divide, I have a tiny confession to make: I miss the analytics, Nate Silver, and all those maps.

But actually when it comes to the actual voting part of the electoral process, I find local races much more compelling. Especially ballot measures. In Berkeley, California, where I live, two measures were particularly close and contested: Measure S, which would have banned sitting or lying on the sidewalk in commercial districts between 7 am and 10 pm, and Measure T, which would have changed the zoning rules in West Berkeley near the freeway to facilitate more intensive commercial development.

I wanted to see some electoral maps of results in our local races, but I couldn't find much. Thus over the Thanksgiving holiday weekend this past week I set out to parse and map the Berkeley election results. Scroll all the way down the page for the technical details on how I parsed the official election results into a usable form. I'm ready to start the maps! The first is Measure S. Next up, Measure T, sometime in the next few days or week. I have a few more ideas after that, but I'll also take requests.

Measure S was a nail-biter, but in the end it failed to pass by 2,458 votes, a margin of 4.6%.
Interesting to note that the cleft in Berkeley politics on this measure fell down socio-demographic lines, splitting the precincts in Northeastern and Southeastern Berkeley from the rest. In physical space, this cleft manifests as a separation by elevation, with the hills voting for Measure S, and the flats voting against it. You can see that the precincts adjoining the commercial areas along Telegraph Ave and Shattuck Ave were not significantly more in favor of Measure S than anywhere else on the alluvial plane. You can also see that the UC Berkeley Campus voters were least in favor of Measure S, but if you click around on the precincts you will also see that these voters were the least likely to vote, and also the most likely to skip Measure S on the ballot if they did vote.

I created the map in TileMill, then uploaded it to MapBox in order to embed it here.

In case you are curious what I went through in order to parse these results: I started with a 748 page PDF listing mail-in ballots and poll results for each race by precinct, plus totals by district an municipality. This I ran through a pdf to Excel converter. Then I wrote a couple of Python scripts to convert the Excel workbook tables to a simple tabular format that listed the vote totals by precinct. I now have results for 88 races.... everything on our four page ballot.

It took a little digging to find the most current precinct boundaries, since there are older versions floating around out there that pop up in search results. With perseverance I found them through the Alameda County Data Sharing Initiative. Before I could join the election results to the precinct boundaries, I had to identify which precincts had been consolidated for this election. This I did manually, and only for Berkeley, by looking at which shapes failed to join to a row in the results table and looking those precincts up on the the Registrar's interactive map. Additionally, a few of the precincts had a '9' appended to the front of the ID number, which indicates that the vote tallies were very low or that only mail-in ballots came from this precinct. For my purposes, I removed the '9's.

Contact me if you want to know even more.
Template developed by Confluent Forms LLC