free range statistics

I write about applications of data and analytical techniques like statistical modelling and simulation to real-world situations. I show how to access and use data, and provide examples of analytical products and the code that produced them.

Recent posts

Fifteen New Zealand government Shiny web apps

13 May 2018

I had a brief look around New Zealand government agency websites and found 15 high quality web apps written in the Shiny platform.

Survey books, courses and tools

05 May 2018

Books, online courses and tools on surveys I've recently visited and liked.

Weighted survey data with Power BI compared to dplyr, SQL or survey

11 April 2018

I show a workaround to make it (relatively) easy to work with weighted survey data in Power BI, and ruminate on how this compares to other approaches of working with weighted data.

Deaths per firearm violence event

01 April 2018

A negative binomial model isn't adequate for modelling the number of people killed per firearm incident in the USA; the real data has more events of one death, and also more extreme values, than the model. But estimating the model was an interesting exercise in fitting a single negative binomial model to two truncated subsets of data.

Truncated Poisson distributions in R and Stan

20 March 2018

Two ways of fitting a model to truncated data.

Do tweeps with more followers follow tweeps with more followers?

24 February 2018

I investigate a question about the Twitter network, and find that generally (until reaching a level of fame few of us aspire to), having more followers oneself is associated with following people who have less followers, not more.

Books I liked in 2017

17 February 2018

I outline the stats- and data-related books I most enjoyed reading in 2017.

Visualising an ethnicity statistical classification

10 February 2018

An interactive network graph is a great way to understand a statistical classification standard.

Average spend, activities and length of visit in the NZ International Visitor Survey

03 February 2018

Resolving an apparent conundrum where the mean spend and other value variables seems to be higher for nearly everywhere... an adventure in double counting (individuals contributing to multiple groups' averages).

How to recruit data analysts for the public sector

23 January 2018

Reflections on recruiting data scientists for the public sector, which could maybe be used as practical guidance for someone.