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, June 11, 2013

Assignment 2: Substance over Methodology — Freedom in the World

"Graphical displays should … induce the viewer to think about substance rather than about methodology, graphic design, the technology of graphic production, or something else"
— Edward Tufte, The Visual Display of Quantitative Information


I'm using one of my favorite data sets today to explore a particular challenge: How do you clearly illustrate meaning in data that don't have intrinsic meaning? Put another way, how do you explain the methodology behind data without distracting from what the data have to say?

The data in this case come from an index — Freedom House's annual Freedom in the World index, which scores every country in the world based on civil liberties and political rights. It's a very popular and useful tool for foreign policy writers and researchers who want to compare different governments to each other or look at governance trends over time.

Like any scoring system, though, it uses a manufactured scale to rank qualities that are not easily quantifiable. In order to understand what the scores say about freedom, first you have to understand how the scores are created.

I've seen (and tried) several different approaches to graphing Freedom House scores, and every approach has pros and cons. Trend lines are most common for charting scores over time, although the Washington Post recently opted for columns to show scores for Iraq and Afghanistan. One drawback is that we're used to associating upward-sloping trend lines with positive changes, and in Freedom House's index higher scores actually mean less freedom. If you keep an ascending scale on the y axis, it might take readers a moment to realize a downward dip in scores is really a good thing.

When I was in graduate school I made a lot of these:



I liked this approach because the inverted y-axis values give gains in freedom an upward-sloping line. The colored regions show clearly whether a country is classified as "Free," "Partly Free" or "Not Free" without leaving the reader to interpret the scores. If I were making this chart today, I might leave the scores off the y axis entirely since they draw attention to Freedom House's methodology when the real take-away is the trend line. But, if you're really interested in how Freedom House rated Ukraine each year, the scores are there to see.

Back to the chart at the top of the post. Like everything on this blog, it's an experiment. Instead of an up-and-down trend line (does freedom go up and down? I guess it does when you assign scores to it), I wanted to try showing different levels of freedom by color only. The red-yellow-green scheme is widely recognized and familiar — green is good, red is not good, yellow is somewhere in the middle.

It's still hard to graph Freedom House's index without some explanation of the scoring methodology. See all the notes I added to the top chart just to feel like I was being thorough? And they don't even go into all the changes Freedom House has made to its methodology over the years.

One thing I might have done differently: The green, yellow and red areas on this chart don't correspond exactly to Freedom House's "Free," "Partly Free" and "Not Free" classifications. Freedom House's "Partly Free" rating encompasses scores of 3.0 to 5.0. On my chart, 3.0 is still pretty green and the true yellow doesn't show up until 4.0. Looking at it now, I feel it might be more important to show the three broad classifications more clearly than to show a continuous and symmetrical color gradient.

Data Source: Freedom House Freedom in the World data, 1972-2012.

Chart Tools: Adobe Illustrator (top chart), Microsoft Excel and Word.

Wednesday, May 29, 2013

For Fun: Half Marathon

View larger

On Sunday I ran my first half marathon at the Alexandria Running Festival. It was a beautiful, cool, sunny morning, and I managed a time of 2:04:18. I've never been a running superstar, so I was really pleased. A big thanks to all of the event organizers and volunteers for putting on a great race and keeping the energy up on the course.

As race day approached, I was struck by just how small a component of running a half marathon the actual race is. Don't get me wrong — running 13.1 miles is daunting, particularly for someone who hasn't raced in a few years. But the vast majority of the hard work, stress, anticipation and strategy come weeks and months earlier.

The chart above shows the full half marathon: the 13.1 miles I ran on Sunday plus the 12 weeks of training that made the final 13.1 possible. I liked the idea of arranging the data in a circle rather than a linear time-series chart, mostly because training process is very cyclical. Each week has a pattern of long, short and mid-distance runs, and once the final race is finished it's time to start gearing up for the next challenge (for me, it's the Marine Corps Marathon's Run Amuck on June 8). Plus, I thought the circle would look cool.

To create this chart in Illustrator, I first made two standard column charts using the Chart feature, one each for the distance and pace-per-mile data. Then I copied the individual columns onto a grid of circular "spokes" that I drew manually (if there's a way to have Illustrator generate a grid like this, I'd love to learn it!). The concentric rings showing the mile scale for the distance data and the minute scale for the time data were drawn to fit the columns, rather than the other way around. Overlapping the distance and time columns meant I overlapped the scales as well. It's a little crowded there at the center of the chart, but I hope it works.

Data Source: Personal records
Chart Tool: Adobe Illustrator

Saturday, May 25, 2013

Extra Credit — Budget Variations

View larger

I'm a fan of Google's interactive charts and tables, and I think the ones in the last post turned out pretty well. The ability to scroll over a line or column segment to see more data is especially handy for packing in the details while keeping the chart clean.

Even with that great feature, some of the budget data were still hard to display — particularly in the smaller spending categories that are hard to find when you're mousing over. So I tossed the data in Adobe Illustrator so I could have a little more flexibility with the design. It's still hard to read in spots, but it's nice to have control over the labels and segment colors.

Illustrator also lets me add a few design flourishes, like these paths highlighting the redistribution of budget outlays among spending categories:

View larger

Data Sources:2014 - H.Con.Res. 25 PCS, (113th Congress); 2012 - H.Con.Res. 34 (112th Congress); 2000 - H.Con.Res. 68 ENR (106th Congress). Accessed through THOMAS between May 14, 2013, and May 20, 2013.

Chart Tool: Adobe Illustrator