Posts filed under Graphics (394)

August 4, 2012

Pie charts: threat or menace?

Stuff has a story based on a real and useful poll, but summarised with a dreadful graph.  You will have heard statisticians ranting about pie charts and may have wondered whether their medications need to be adjusted.  Here’s why we rant.

Notice that the pie isn’t round; it’s an ellipse.  Presumably we’re supposed to imagine it being tilted away at some angle (in contrast to the table, the headline, and the legend, which are aligned with the page.   Also notice that the wedges have numbers on them — that’s often a sign that the graph can’t be interpreted by itself.  The red wedge looks a lot smaller than the blue wedge.

(more…)

July 29, 2012

Not quite, but thanks for playing

An interesting attempt at data visualization for Olympic medal counts, from US progressive magazine Mother Jones.  Dave Gilson looks to have used Google’s Motion Chart tools, which give the look of the GapMinder animations to your own data.  Unfortunately, it doesn’t quite work.

 

The first problem (as the article goes on to admit) is that the Olympics happen only every four years, but the animation is continuous — the snapshot above shows the medal counts for 1967, when the Olympics would have been held 3/4 of the way from Tokyo to Mexico City.

There’s also data problems: the vertical line of blue points should correspond to countries that do well on medals per capita, and poorly on medals per $GDP — ie, infinitely rich countries.  They are actually Eastern Bloc countries whose GDP was not available.  The article actually says a GDP of zero was used, but that’s not what the graph shows.

The whole idea of standardizing to total GDP and total population doesn’t really make sense here: GDP and population are roughly proportional for large sets of countries, so you’d expect a strong diagonal tendency in the graph even if wealth wasn’t all that important.   To spread the points out a bit and help disentangle GDP from population, it would be better to use population on one axis and per capita GDP on the other.  Han Rosling, in the original GapMinder animation, uses per capita GDP.

Incidentally, GapMinder also has much more complete data on GDP, which could have improved the medal graph.

 

July 21, 2012

One of these countries is different

You will have heard about the terrible shootings in Colorado.

From a post by Kieran Healy, at Crooked Timber, responding to the tragedy: death rates from assault, per 100,000 population per year, for the US and 19 other OECD countries.  New Zealand is roughly in the middle (his post gives separate plots for each country).  Dots are the data for individual years, the curves are smoothed trends with margin of error.

The much higher rate in the US is obvious, but so is the decline.

 

Part of the decline is attributable to better medical treatment, so that assault victims are less likely to die, but far from all of it.  The rate of reports of aggravated assault is also down over the same time period.  Similarly, simple explanations like gun availability probably contribute but can’t explain the whole pattern.

The decline in violent deaths is so large that it shows up in life expectancy comparisons.  New York, and especially Manhattan, used to have noticeably worse life expectancy than Boston, but the falling rate of violent deaths and the improvements in HIV treatment now put Manhattan, and the rest of New York City, at the top of US life expectancy

July 18, 2012

Global Innovation Barchart

So.  The 2012 Global Innovation Index is out and NZ looks quite good.  Our only Prime Minister has a graph on his Facebook page that looks basically like this.

 

The graph shows that NZ was at rank 28 in 2007 and is now at rank 13.

A bar chart for two data points is a bit weird, though not nearly as bad as the Romney campaign’s efforts at Venn diagrams in the US.

The scaling is also a bit strange.  The y-axis runs from 1 to 30, but there’s nothing special about rank 30 on this index. If we run the y-axis all the way down to 141 (Sudan), we get the second graph on the right, which shows that New Zealand, compared to countries across the world, has always been doing pretty well.

 

Now, there are some years missing on the plot, and the Global Innovation Index was reported for most of them.  Using the complete data, we get a graph like

So, in fact, NZ was doing even better on this index in 2010, and we get some idea of the year-to-year fluctuations.   Now, a barchart is an inefficient way to display data with just one short time series like this: a table would be better.

More important, though, what is this index measuring.  Mr Key’s Facebook page doesn’t say. Some of the commenters do say, but incorrectly (for example, one says that it’s based on current government policies).  In fact, the  exact things that go into the index change every year.  For example, the 2012 index includes Wikipedia edits and Youtube uploads,  in early years internet access and telephone access were included.  There are also changes in definitions: in early years, values were measured in US$, now they are in purchasing-power parity adjusted dollars.

Some of the items (such as internet and telephone access) are definitely good, others (such as number of researchers and research expenditure) are good all things being equal, and for others (eg, cost of redundancy dismissal in weeks of pay, liberalised foreign investment laws) it’s definitely a matter of opinion.Some of the items are under the immediate control of the government (eg public education expenditure per pupil, tariffs), some can be influenced directly by government (eg, gross R&D funding, quality of trade and transport infrastructure), and some are really hard for governments to improve  in the short term (rule of law, GMAT mean test score, high-tech exports, Gini index).

Since the content and weighting varies each year, it’s hard to make good comparisons. On the plus side, the weighting clearly isn’t rigged to make National look good — the people who come up with the index couldn’t care less about New Zealand — but the same irrelevance will also tend to make the results for New Zealand more variable.   Some of the items in the index will have been affected by the global financial crisis and the Eurozone problems. New Zealand will look relatively better on these items, for reasons that are not primarily the responsibility of the current governments even in those countries, let alone here.

I’d hoped to track down why New Zealand had moved up in the rankings, to see if it was on indicators that the current administration could reasonably take credit for, but the variability in definitions makes it very hard to compare.

July 9, 2012

Earthquake maps

Stuff is linking to a map of earthquakes by John Nelson of IDV Solutions.  Long-term readers may recall my earthquake map, which uses just the earthquakes since 1973, where the data is more complete.   John Nelson’s map is certainly prettier, but I think mine is clearer.

July 5, 2012

The genome is big. Really big.

And to prove it, Yonder Biology is streaming the genome over the course of a year.  As you may remember from earlier posts, there are about 30 million seconds in a year, and 3 billion bases in the genome, so that comes to 100 bases per second for the entire year. (via)

May 23, 2012

New Hans Rosling video: Religions and babies

Hans Rosling had a question: Do some religions have a higher birth rate than others — and how does this affect global population growth? Speaking at the TEDxSummit in Doha, Qatar, he graphs data over time and across religions. With his trademark humor and sharp insight, Hans reaches a surprising conclusion on world fertility rates.

May 2, 2012

Behind-the-scenes look at NY Times graphs and infographics

Thanks to Kottke‘s excellent blog, I’ve just discovered chartsnthings – a reasonably new blog which details the thinking and work behind some of the New York Times graphs and infographics.

Nice to see they use R (originally developed here at the Department of Statistics at The University of Auckland) to create their graphs.

March 30, 2012

Traffic congestion and data science

Recently, I mentioned the possibility of using bus timing data to probe congestion on Auckland roads.  This idea has been bypassed by Google, who now provide real-time congestion maps of New Zealand using smartphone location data.

If you run Google Maps or Google Navigation, you have the option of sending anonymous GPS-based location data to Google, so they know the locations of lots of phones.  By tracking the speed of phones that are moving along roads, they can work out the traffic speed, and measure congestion.   This is harder than it sounds — GPS accuracy on its own is not enough to distinguish phones in cars from phones carried by pedestrians — but using combined location and speed data they can even give separate congestion information in each direction on many roads.

For example, if you were coming to our public lecture on Tuesday, you might look on Google Maps and click on the “Traffic” label, and see that Symonds St is totally clogged, and decide to come up Grafton Rd instead.

March 29, 2012

Data visualisations

A flowing wind map of the USA, from hint.fm, who also have other beautiful infographics. Click for the live version