Category Archives: JavaScript

My talk for Calculating and Communicating Uncertainty 2015 – and an experimental D3 page

Tomorrow and Wednesday I’ll be at the CCU2015 conference in Westminster. I’m talking in a workshop session on Wednesday on interactive graphics – and in particular, how they can be used to communicate uncertainty- so I thought I would make an experimental page showing a couple of different ways of trying this. You can read my slides here and the experiment is here. While I’m sitting in the conference, I’ll probably tidy up a couple of rough edges, and in due course, I’ll make some more experiments. Please let me know what you think, and watch out for tweets with #ccu2015, although it means different things to different folks.


Leave a comment

Filed under animation, JavaScript, Visualization

Best dataviz of 2014

I expect everyone in the dataviz world would tell you this year was better than ever. It certainly seemed that way to me. I’m going to separate excellent visualisation for the purpose of communicating data from that for communicating methods.

In the first category, the minute I saw “How the Recession Reshaped the Economy, in 255 Charts“, it was so clearly head and shoulders above everything else that I could have started writing this post right then. It’s beautiful, intriguing and profoundly rich in information. And! quite unlike anything I’d seen in D3 before, or that’s to say it brings together a few hot trends, like scrolling to go through a deck, in exemplary style.


Next, the use of JavaScript as a powerful programming language to do all manner of clever things in your web browser. Last year I was impressed by Rasmus Bååth’s MCMC in JavaScript, allowing me to do Bayesian analyses on my cellphone. This year I went off to ICOTS in Flagstaff AZ and learnt about StatKey, a pedagogical collection of simulation / randomisation / bootstrap methods, but you can put your own data in so why not use them in earnest? It is entirely written in JavaScript, and you know what that means – it’s open source, so take it and adapt it, making sure to acknowledge the work of this remarkable stats dynasty!


So, happy holidays. If the good Lord spares me, I expect to enjoy even more amazing viz in 2015.

Leave a comment

Filed under JavaScript, Visualization

A triumph of D3: see that uncertainty for yourself

This page is just out from the New York Times, showing trends in the USA jobs report and how they could easily be an artefact of sampling error. It’s a magnificent piece of data reporting: clear, punchy and helpfully demystifying. Sampling error is just what happens when you don’t have all the data, just a slice of it. You might be unlucky and get a wild over- or under-estimate. If you hear someone say that statistics is a tool to help you make decisions under conditions of uncertainty, or that statistics is a missing data problem, this is typically what they are getting at. Sampling error is not the only type of uncertainty, but it’s the one most amenable to mathematical probing, and often is the biggest one too.



As a keen D3 hanger-on, I have seen didactic examples about which randomise data like this, but it never occurred to me that it could actually be used to show uncertainty by simulation of the data (rather than some general fuzzy wobbling). I am very impressed with the clarity of the writing too.

Leave a comment

Filed under JavaScript, Visualization

Selfie City

I don’t really know what to say about this magnum opus in image processing, interactive graphics, geotagging, face recognition &c &c. It certainly is impressive, though after messing about with the controls I’m not sure I was any wiser about different cultural norms for expression and the semiotics of the selfie. But I was totally creeped out by all these people looking at me. Except for the guys aged around 40, with whom I felt a natural affinity. In this group, a global bond of regressing to teenage goofing around, pretending to be a gangsta, and most universally of all, failing to use the camera properly, emerges.

That looks familiar

That looks familiar

Looks to me from a quick squizz through the source code that it’s entirely built in D3. Impressive.

Thank you to Information Aesthetics for spotting it.

Leave a comment

Filed under JavaScript, Visualization

Dataviz: good and bad

I’ve made a promise to myself not to blog anything until I get some more data processing tips written up on my website. But ‘ll break it just for a quick couple of links. One rocks, the other sucks.

First, an amazing visualization of current wind and weather conditions over the whole world, by Cameron Beccario. Source code here. This brings together a few different trendy tools: the data is automatically scraped, animated in a nice way with a planet that you can click and roll around. Very neat JavaScript, but also valuable as communication of quantitative information. Why is it better than just the old synoptic chart? Because it’s engaging, it gets people interested, and because you can see the whole story at a glance; you’re not limited to national boundaries. I think it’s potentially really useful for geography teachers everywhere. Arise, Sir Cameron. The next step would be to have it play the last week’s data as a video. I spotted it at Freakonometrics. The GIF below doesn’t really do it justice, by the way, go click on it.


Second, a graph spotted at Atlantic Cities which worried them because it looked like the whole world wants smaller households fast, and that’s going to cause environmental havoc. It worried me, on the other hand, because it just looked implausible. It’s amazing how complacent analysts* become as soon as they can switch on their stats software and do some fancy stuff. The common sense part of the brain powers down. Mmmm, breakpoints regression. Ooooh, bootstrapped starting values. Here’s a graph! What does it mean? Never mind that, let’s just publish the damn thing!

If you look at the slopes, the developed countries’ breakpoint is about 1893, which makes sense with industrialisation. The devloping countries have 1987, which doesn’t make so much sense. It’s not clear from the paper, but it looks like the breakpoint regression was done at country level, without weighting them by population. I’m happy to be corrected on that, but that’s what it looks like. That gives China and Swaziland exactly the same weight in pushing and pulling the line. And, most importantly, look over at the far right of the developing countries – there’s not many there with data since 1990 (they acknowledge this in the paper), and the ones who are there have smaller household sizes. Is it a trend or is it information bias? Smaller household <– healthier economy –> regular official statistics. This is not rocket science, it’s common sense. Think about what your data might mean! Aaargh.



* – by “analysts”, I mean the authors of the paper, not Emily Badger whose writing and keen eye for interesting stats I have admired for some time


Filed under animation, JavaScript, Visualization