Showing posts with label Google. Show all posts
Showing posts with label Google. Show all posts

Friday, February 7, 2014

Sochi 2014


Monaco, a real Winter Olympics hotspot


I love the Olympics. I especially love the Opening Ceremonies and watching the similarities and contrasts among the delegations. As an American, of course, I can't help feeling a burst of pride at seeing a sea of U.S. athletes walking into a stadium, ready to take on the world. But the smaller delegations can be equally powerful — sometimes just one or two athletes representing their entire nation on a global stage.

The Winter Olympics are particularly full of contrasts. Without getting into the economic profile of the countries that compete in the winter games (today's Washington Post has some really cool visualizations on that), I was curious to see which countries have the most Olympians.

First, the obvious question: Which countries have the largest delegations?

Total Olympians by Country


OK, so we expect some of the largest delegations to come from countries with large populations. So let's control for population:

Olympians per 1 Million People


Of course these numbers are a little deceptive. Because of the way I've done the math here, countries with populations of less than 1 million suddenly gain athletes.

And which countries have the highest density of olympians by area?

Olympians per 1,000 Square Kilometers


At only 2 square kilometers, Monaco once again gets the benefit of the math on this one.

Note: The image at the top is from a partial heat map of the Olympians-per-square-kilometer data that, sadly, Google Fusion Tables won't allow me to publish. Trust me, it was cool.

Data Sources: Athlete numbers from Sochi2014.com; country population and area data from CIA World Factbook. Both accessed February 6, 2013.

Chart Tool: Google Tables

Monday, November 4, 2013

Virginia Votes 2013

Tuesday is Election Day, and in Virginia the races for governor and other state executives are making plenty of headlines. But in addition to these high-profile offices, Virginians will also be choosing new representatives for the state's House of Delegates.

Actually, that's not entirely accurate. Many of the delegates who are elected won't be new. And in close to half of the house races, voter's won't have much of a choice.

Eighty-seven of the 100 house races feature incumbent candidates, 42 of whom are running unopposed. Of all the races, 45 have only one candidate on the ballot.

Virginia House of Delegates 2013
Candidate Parties in District Races

* = Incumbent candidate



In 2010, Virginia redrew district lines for the House of Delegates. Like the congressional redistricting process at the national level, Virginia's redistricting was based on Census results and intended to divide the state into districts of roughly equal population.

How did redistricting affect the competitiveness of Delegates races?



In 2009, before redistricting, 54 of 100 races included candidates from both major parties, and nine of those also featured at least one third-party candidate. In 30 races, major party candidates ran unopposed.

In 2011, the first House of Delegates election after redistricting, the number of races with candidates from both major parties fell to 27 — half of what it was two years before. Forty-three races saw Republican candidates running unopposed, up from 21 in 2009. Democratic candidates ran unopposed in 20 races, up from nine in 2009.

This year's elections will be more competitive, on the whole, than in 2011, but there are still more one-sided races than before redistricting. Forty-three races have both Republican and Democratic candidates, and seven of those also include third-party candidates. Republicans are running unopposed in 29 races, and Democrats are unopposed in 16.

The 2010 redistricting process also redrew lines for the state Senate districts. State senate elections won't be held again until 2015, but so far redistricting has offered mixed results in terms of competitiveness in the Virginia Senate.



In the 40 senate districts, the number of races with candidates from both major parties increased from 16 in 2007 to 24 in 2011. At the same time, the number of unopposed Democratic candidates fell from nine to three, while the number of unopposed Republicans increased from eight to 11.

The Virginia Public Access Project has some great information on the 2010 redistricting process, including maps and lists of precincts that changed districts between the 2009 and 2011 elections.

Data Sources: Virginia State Board of Elections, Election Results

Chart Tools: Google, Adobe Illustrator

Monday, July 22, 2013

Bookstore Browsing



Recently I visited a large retail bookstore near my home and was struck by some of the oddly specific category labels above the bookcases. No need to go digging around a massive Computer section for a book on Photoshop — you can go straight to Digital Photography. Looking for the latest young adult vampire novel? There's a Teen Paranormal Romance section for that.

The bookstore employees must have thought I was strange or terribly indecisive as I wandered through the whole store with my iPhone taking note of the various genres and the number of bookcases devoted to each. I was curious — in a time when we get so much of our entertainment and information digitally, what do we buy in bookstores?

At first glance it looks like children's books, various fiction genres and cookbooks. But the real answer probably doesn't appear on this chart. If you've visited a chain retail bookstore lately, you know a significant amount of floorspace is devoted to CDs, movies, e-readers, board games, toys, gifts — things that aren't books at all. I've left most of those items out of the chart simply because the various racks, tables and shelves used to display them are difficult to compare to the standard bookcases. The massive "Bargain" section, which certainly includes some non-book items, is shown here.

I've used data from a bookstore in Fairfax, Va., a suburb of Washington, D.C., where the demographics include a lot of affluent, educated and professional families with children. I'm curious to see how the inventories of bookstores in other parts of the country stack up.

My first attempt with this data was a bar chart:


I spent a few days on this bar chart — one day on the admittedly unnecessary bookcase icon and the rest adjusting the bar size and trying to shoehorn in the category labels in a semi-legible manner. Success was mixed. My lesson here is that if one approach doesn't seem to be working, it's probably not the right approach. After about 30 minutes of reformatting my data spreadsheet to Google's liking, Google created the "tree map" at the top of the page in a few moments.

Data Source: Observations at Barnes and Noble, Fairfax, Va.

Chart Tools: Google, Adobe Illustrator

Thursday, June 13, 2013

Extra Credit: More Freedom!


Is there a relationship between wealth and freedom? What about government stability? The Bubble Chart of Freedom is here to find out.

Again, I'm using Freedom House's Freedom in the World index. Today's chart focuses on the top 50 largest countries by population, and the freedom ratings are from Freedom House's scores for 2012.

There's a significant amount of research suggesting a strong correlation between national wealth and democracy. Perhaps I'll post a bibliography on the topic sometime soon. In the meantime, the data here seem to support that correlation. The Free countries in the green shades are mostly floating at the top of the chart, where the values for GDP per capita are highest. Not all Free countries are among the wealthiest — India and Indonesia are pretty low on the GDP scale — but almost all the wealthiest countries are Free.

The x axis shows how long each country's constitution (or in the absence of a constitution, the legal document establishing the current form of government) has been in place. The question I wanted to answer here is whether countries with more stable governments are more likely to be Free, with constitution age acting as a proxy for regime stability. It's a tricky measure, since it really doesn't say anything about the content of the constitution or how the government applies it, but hopefully it does help separate countries in transition from more established governments.

Because so many countries have been through significant transitions and adopted new constitutions within the last 50 years, the x axis scale is logged to alleviate some of the crowding between the 10 and 50 year marks.

The relationship between constitution age and freedom is not as clear as the one between wealth and freedom. It is interesting to note that none of the countries that adopted new constitutions in the last 15 years is Free.

Again, only the 50 most populous countries are shown here. The full data set might show a different picture — perhaps on a future post.

Here's the data in table form. Countries with Freedom House scores of 1 to 2.5 are Free, 3 to 5 are Partly Free, and 5.5 to 7 are Not Free.



Data Sources: Freedom House Freedom in the World reports.
Population, GDP per capita and constitution data from the CIA World Factbook 2013.

Chart Tool: Google

Tuesday, May 21, 2013

Assignment 1: Show the Data — U.S. Federal Budget

There have been a lot of stories coming out of Washington lately, and the federal budget really hasn't been one of them. That will likely change soon. As of May 15 Congress can begin considering appropriations bills for the 2014 fiscal year, meaning between now and September we can expect to hear more about how much money federal agencies will have to spend in the coming year.

Despite its seemingly unlimited pockets, Congress is required to abide by specific spending limits each year. Who sets these limits? The President's Budget gets a lot of attention when it's released each February (or April as was the case this year), but these budget recommendations are just that — recommendations. Congress actually sets its own spending limits with an annual budget resolution, usually passed in April.

By law, once the president has released a recommended budget, both the Senate and the House of Representatives draw on that document and their own priorities to draft separate budget resolutions. Once each house approves its own resolution, they swap notes and hammer out their differences in a report that becomes a binding outline of next year's spending. The final budget resolution is the basis for appropriations bills that portion out money to specific agencies.

Of course nothing's straightforward in the Congress, and lawmakers have failed to agree on a final budget resolution for the last three fiscal years. A budget resolution for 2014 also appears to be dead in the water. 

So how much does Congress have to spend in 2014? Well, it depends where you look.

Fiscal Year 2014 Outlays by Category (in millions of dollars)
Technically, when Congress fails to pass a budget resolution the previous year's resolution remains in effect. The last successful budget resolution was Senate Concurrent Resolution 13 (S.Con.Res. 13 ENR). It was passed for the 2010 fiscal year but includes spending levels for 2011 through 2014. In years when no final budget resolution is passed, the House sometimes formally adopts its own resolution as binding for the purposes of making appropriations.

The charts above show spending levels for 2014 outlined in S.Con.Res. 13 alongside those proposed by the House and the Senate in separate resolutions this spring. None of these is a definitive guideline for next year's appropriations, but it's fun to compare them.

It's also fun to compare spending levels for each category over time.

Notice how Homeland Security got its own spending category in 2005. The Overseas Contingency Operations/Global War on Terror category was originally called Overseas Deployments and Other Activities when it showed up in the 2008 budget.

U.S. Federal Budget Outlays by Category, 2000-2012 (in millions of dollars)

Data Sources: 2014 - S.Con.Res. 13 ENR (111th Congress), H.Con.Res. 25 PCS, (113th Congress); S.Con.Res. 8 ES (113th Congress); 2012 - H.Con.Res. 34 (112th Congress); 2011 - H.Res. 1493 (111th Congress); 2010 - S.Con.Res. 13 ENR (111th Congress); 2009 - S.Con.Res. 70 ENR (110th Congress); 2008 - S.Con.Res. 21 ENR (110th Congress); 2007 - H.Con.Res. 376 EH (109th Congress); 2006 - H.Con.Res. 95 ENR (109th Congress); 2005 - S.Con.Res. 95 (108th Congress); 2004 - H.Con.Res. 95 ENR (108th Congress); 2003 - H.Con.Res. 353 EH (107th Congress); 2002 - H.Con.Res. 83 ENR (107th Congress); 2001 - H.Con.Res. 290 ENR (106th Congress); 2000 - H.Con.Res. 68 ENR (106th Congress).
Accessed through THOMAS between May 14, 2013, and May 20, 2013.

Chart Tool: Google Docs