coding in Google docs
I’m doing a bit of data exploration for work based on our people. I don’t know any statistical software (or really any stats!1), so rather than learning R or SPSS I thought I’d have a go at doing it in Google docs. I will probably need a stats library once we get into trying to find unexpected numbers, but for simple queries it does just fine. This stage is just about making some interesting graphs to give people an idea of what they can do with the data they have at their disposal.
Javascript now does array comprehensions, so you can chain Boolean expressions to filter for just the rows that you want.
var maleGlassesWearers = [p for each (p in people) if ((p.gender == 'm') && (p.glassesInRealLife == 'y'))];
They aren’t the prettiest of statements, but they get the job done in very little code.
Dan’s been on at me to get my head around more functional language concepts, so this is probably a good place to start.
The spreadsheet is confidential, but there is noting special about the code, so it’s included here. I’ve done the filters using a for loop and using a comprehension so that you can see the difference.
-
But I am going to do the coursera statistics course starting next week. ↩