How we analyzed the data

In order to visualize the patterns of voting results from 2001 to 2012 at the local level across the city, we used the smallest geographic area possible. The NYC Board of Elections records local voting results by Election District. There are currently almost 5,300 election districts covering the city with an average population of 1,500 people. (In comparison, Census tracts are larger – there are 2,100 tracts with an average of 3,700 people – and Census blocks are much smaller – there are approximately 30,000 populated blocks with an average population of less than 300.)

But election district (ED) boundaries change each year, especially after redistricting. In 2010, for example, there were 6,300 EDs. By 2012 that number had dropped to less than 5,300. Therefore we could not directly compare the vote counts by ED from one year to the next. Also, election district boundaries are not coterminous with Census geography, making it difficult to directly compare vote results to demographic data reported by Census tract or block.

Allocating from EDs to Census blocks

Therefore, we decided to allocate ED-level vote counts to Census blocks. This provides an apples-to-apples spatial comparison of the local voting patterns from one year to the next, and also allows for easy analysis of voting patterns with Census data.

Allocating population data (in this case, voting population) from one type of geography to another can be accomplished using several methods. This is a common practice with redistricting, when voting data by precinct needs to be allocated to Census blocks, which are literally the building blocks of legislative districts.

The methodology we used was to determine the proportion of each ED's population that was located in each overlapping area between EDs and Census blocks. If an ED was wholly contained within a block, 100% of the votes from the ED were allocated to the block. If 50% of the ED overlapped a block, only half the votes were allocated to the block.

This effort was more involved than other attempts to allocate population from one geography to another. First, we wanted to allocate the voting results from at least eight years worth of election districts to the current (2010) Census blocks. We allocated the results from elections from 2001 to 2012 (with the exception of the few years when there were no citywide elections of significance). We included primary (and runoff) elections and general elections for Mayor, Comptroller, and Public Advocate at the city level, and Governor and President at the state and federal levels – we wanted to focus on executive offices (consistent with analyzing the race for mayor).

Two other factors adding to the complexity of the allocation process were the number of candidates and the population base that we used to determine the overlap between EDs and Census blocks. All told, we allocated voting results for more than 40 candidates. In 2009 alone there were 13 major-party candidates for the elections noted above.

Regarding the overlap between EDs and blocks, there are several approaches that are typically used. Our approach was to determine the number of voters registered in each year we examined, and use each ED's count of registered voters as the denominator and the number of active registered voters in each overlapping area between EDs and blocks as the numerator. If five voters were located in an overlapping area, and the ED's voting population was 25, twenty percent of the ED's votes in that year for each candidate were allocated to the overlapping block. The results of those calculations were then summed by block, for each candidate in each election in each year, to determine the block-level totals.

(As an aside, each year's ED boundaries from the Bytes of the Big Apple program had to be cleaned using ArcMap's "repair geometry" tool before comparing the ED geometry with Census blocks. Otherwise, the allocation results were bing confounded by stray, seemingly random and invisible ED boundaries. The Repair Geometry tool removed these phantom EDs and the subsequent results were internally consistent and sensible.)

The schematic outline below summarizes the allocation process using EDs and tracts:

Geocoding 18 million records

To determine the exact count of voters in each overlapping area, we geocoded each year's active registered voters from registration files provided by the NYC Board of Elections. Although there were duplicate records from year to year (people who remain registered at the same address from one year to the next), we needed a separate population base for each year's voting results. Therefore, we geocoded more than 18 million voter registration records over the period from 2001 to 2012. We successfully matched more than 99% of these records, due to the address quality in the Board of Election files and our geocoding system refined over several years of use with city data.

Mapping vote results and turnout

Maps of election district results tell only part of the story of electoral outcomes. Without also accounting for voter turnout, choropleth maps that just show voting results treat all outcomes as equal (in terms of color intensity), and ignore the importance of a candidate's ability to turn out his/her base of support.

After testing different color styles and cartographic techniques, CUR used the value-by-alpha approach that uses color to indicate value (in this case, a candidate's share of votes) and levels of transparency of those colors (the "alpha" component of a color scheme) to indicate intensity of that vote share as measured by turnout.

Calculating turnout.