Project 3: Data Correlation
MAT 259, 2014
Song Gao, Department of Geography

The Presidential Election is one of the most important political events in United States. The presidential debates present the party’s visions during the campaign. The major issues debated were the economy and jobs, the federal budget deficit, taxation and spending, the future of social security, medicare, healthcare reform, education, social issues, immigration, and foreign policy. The debates are very valuable during the public vote process. It is interesting to explore the temporal trends of check-outs behaviors related to "election" or "debate" in Seattle Public Library (SPL) and the articles about these topics in New York Times (NYT) during the election periods, as well as to identify whether there is a correlation pattern between the two pubic media.

Visual Design and Color
I will use the comparison-mode visual design for the correlation project which means every single visual element should contains the binary information between two media (SPL v.s. NYT), such as the bar charts, the frequency display and the relative weight. For the color design, I am going to use the Germany Flag color scheme of Red, Yellow and Black.

(1)Seattle Public Library monthly check-outs from "2008-01-01" to the date "2012-12-31"
SELECT year(cout), month(cout), count(*)
FROM inraw
WHERE (title like "%election%" or "%debate%") and date(cout)>"2008-01-01" AND date(cout)<"2012-12-31"
GROUP BY year(cout),month(cout)
ORDER BY year(cout),month(cout);
Processing Time: 57.409 seconds and 60 rows returned

(2)New York Times APIs

Make a query based on New York Times Article Search API v2 to get the monthly frequency of arcticles which contain the keywrods election or debate

These exported query data can be downloaded at:



It also supports the interaction by hovering the mouse on the bars and the half circles will show the changing values of monthly check-outs in Seattle Public Library and articles in New York Times containing the keywords: "%election%" or "%debate%".

Source Code