Posts written by Thomas Lumley (2007)


Thomas Lumley (@tslumley) is Professor of Biostatistics at the University of Auckland. His research interests include semiparametric models, survey sampling, statistical computing, foundations of statistics, and whatever methodological problems his medical collaborators come up with. He also blogs at Biased and Inefficient

June 5, 2017


  • Possibly a record false positive rate:  “a substantial number of takedown requests submitted to Google are for URLs that have never been in our search index, and therefore could never have appeared in our search results… Nor is this problem limited to one submitter: in total, 99.95% of all URLs processed from our Trusted Copyright Removal Program in January 2017 were not in our index” (Google submission to Register of Copyrights(PDF), via Techdirt)
  • Problem with rental costs in Canada’s historical CPI “the clerks who recorded the data were under an instruction that, since the CPI was to represent prices paid by better off working class families, to edit out any rental figures what were above a designated threshold. By the end of the 1950s they were throwing out more than half of the reported rents.” (Worthwhile Canadian Initiative). Data doesn’t just happen: it’s choices by people.
  • I’ve mentioned the University of Washington course “Calling Bullshit on Big Data” before. Now the New Yorker has a story about it.
  • What different sorts of things can go wrong with a statistical prediction rule? A taxonomy, from Ed Felten.
  • Explore NZ mortality rates divided up by ethnicity, income, and age
  • “What we learned from three years of interviews with data journalists, web developers and interactive editors at leading digital newsrooms” Storybench, via Alberto Cairo
  • A couple of examples from the fine UK election tradition of disinformation graphics: Scotland, London
June 2, 2017

Time for stakeholder participation?

Q: Did you see `young blood’ cuts cancer and Alzheimer’s risk?

A: That’s the headline, yes.

Q: This is the Silicon Valley startup that’s transfusing young people’s blood into older people?

A: Well, Monterey rather than Silicon Valley, but yes.

Q: Isn’t it a pity we used up all the vampire jokes on Theranos?

A: I’m sure they aren’t really dead, just sleeping. (more…)

May 29, 2017

The past is a foreign country

As you might have read in an English class (at least if you’re old) “The past is a foreign country: they do things differently there.” In particular, they buy things differently.

We often want to compare prices between the present and the past. To compare prices between here and actual foreign countries, we use the exchange rate and find, for example, that the US cost (from Amazon) of Sennheiser CX 3.0 earphones, US$29.99 is equivalent to about NZ$40, or about NZ$46 with tax.  We can then straightforwardly say that Harvey Norman is charging 60% more  than Amazon for the same item, and force them to make unconvincing excuses.  Comparing foreign prices can get complicated if you’re interested in affordability relative to income, or if you’re looking at a country with very restrictive border controls but the existence of two-way trade with many foreign countries means there is a single, well-defined exchange rate.

The equivalent conversion for past prices is an inflation adjustment. If you’re comparing past and current prices without an inflation adjustment you’re not even trying to get the numbers right (with a few very limited exceptions such as bracket creep).  There should be an automatic presumption of dodginess for any `nominal’, unadjusted comparison of amounts of money at different times — especially as this is something that’s really easy to get (approximately) right.  So, go and fix it now.

I said “approximately right”, and those of you still with me will note that we don’t have extensive two-way trade with the past. Inflation isn’t as simple as an exchange rate.You can’t buy Sennheiser CX 3.0 earphones with 1997 dollars, and even if you could, Amazon would have difficulty shipping them to 1997.  Inflation adjustments are more like the Economist‘s Big Mac purchasing-power index.  The magazine decrees that Big Macs have the same true value everywhere in the world, and so can estimate the relative value of different currencies.  That’s not ideal when comparing countries, and it’s even harder when comparing with the past.

Economists and official statistics agencies make up ‘baskets’ of items and decree these to have the same value over time, carefully making sure that the items are defined narrowly enough for ‘the same value’ to be reasonable, and broadly enough that you can still find ‘the same item’ a year later.  They also make complicated adjustments for changes in quality of the ‘same item’ (math is hard even if you go shopping).  That’s really the only way you can do it, and it works ok for many purposes, but there isn’t just one inflation rate the way there is one exchange rate.

Macroeconomists use this thing called ‘core inflation’, which leaves out items that vary a lot in price and which they say predicts macroeconomic things better.  There are indexes based on baskets of items bought by NZ producers, or sold by NZ producers.  There are indexes based on baskets of items relevant to different sorts of households: Graeme Edgeler has a nice post pointing out that there is an inflation index targeted to beneficiaries, and that it would make sense to use this to index benefits (he also drafted a bill).

The other tricky part of the basket approach to comparing past and current prices is the huge differences between items.  The prices of computers, washing machines, t-shirts, and old-enough medications are increasing more slowly than the average inflation rate; they are getting systematically less expensive ‘in real terms’. By simple arithmetic, that means the prices of other things must be rising faster than the average inflation rate; they must be getting more expensive ‘in real terms’.

It sounds odd to say that primary schools or health care are getting more expensive to run `in real terms’ because computers and t-shirts are cheaper — but it’s partly true. Some sort of currency conversion is always necessary when comparing different currencies — the 2001 dollar and the 2017 dollar — but it’s not always sufficient.


May 26, 2017

Big fat lies?

This is a graph from the OECD, of obesity prevalence:

The basic numbers aren’t novel. What’s interesting (as @cjsnowdon pointed out on Twitter) is the colour separation. The countries using self-reported height and weight data report lower rates of obesity than those using actual measurements.  It wouldn’t be surprising that people’s self-reported weight, over the telephone, tends to be a bit lower than what you’d actually measure if they were standing in front of you; this is a familiar problem with survey data, and usually we have no real way to tell how big the bias is.

In this example there’s something we can do.  The United States data come from the National Health And Nutrition Examination Surveys (NHANES), which involve physical and medical exams of about 5,000 people per year. The US also runs the Behavioral Risk Factor Surveillance System (BRFSS), which is a telephone interview of half a million people each year. BRFSS is designed to get reliable estimates for states or even individual counties, but we can still look at the aggregate data.

Doing the comparisons would take a bit of effort, except that one of my students, Daniel Choe, has already done it. He was looking at ways to combine the two surveys to get more accurate data than you’d get from either one separately.  One of his graphs shows a comparison of the obesity rate over a 16-year period using five different statistical models. The top right one, labelled ‘Saturated’, is the raw data.

In the US in that year the prevalence of obesity based on self-reported height and weight was under 30%.  The prevalence based on measured height and weight was about 36% — there’s a bias of about 8 percentage points. That’s nowhere near enough to explain the difference between, say, the US and France, but it is enough that it could distort the rankings noticeably.

As you’d expect, the bias isn’t constant: for example, other research has found the relationship between higher education and lower obesity to be weaker when using real measurements than when using telephone data.  This sort of thing is one reason doctors and medical researchers are interested in cellphone apps and gadgets such as Fitbit — to get accurate answers even from the other end of a telephone or internet connection.

In memoriam Alastair Scott

AlastairScott4-560x373(Alastair didn’t contribute directly to StatsChat, but he was a major contributor to this being a department that would take it seriously.)

In memoriam: Alastair Scott, Emeritus Professor of Statistics (1939-2017).

Alastair Scott, one of the finest statisticians New Zealand has produced, died in Auckland, New Zealand on Thursday, May 25. He served the University of Auckland with distinction from 1972 to 2005.

His research was characterised by deep insight and he made pioneering contributions across a wide range of statistical fields. Alastair was acknowledged, in particular, as a world leader in survey sampling theory and the development of methods to efficiently obtain and analyse data from medical studies. His methods are applied in a wide range of areas, notably in public health. Beyond research, he contributed prolifically to the statistical profession in academia, government, and society.

Alastair was a Fellow of the Royal Society of New Zealand, the American Statistical Association, the Institute of Mathematical Statistics, the Royal Statistical Society, and an honorary life member of the New Zealand Statistical Association. In November last year, Alastair was awarded the Royal Society of New Zealand’s Jones Medal, which recognised his lifetime contribution to the mathematical sciences.

Alastair gained his first degrees at the University of Auckland: BSc in Mathematics in 1961 and MSc in Mathematics in 1962. After a period at the New Zealand Department of Scientific and Industrial Research, he pursued a PhD in Statistics at the University of Chicago, graduating in 1965. He then worked at the London School of Economics from 1965-1972.

Alastair returned to New Zealand in 1972 to a post in what was then the Department of Mathematics and Statistics at the University of Auckland; he and wife Margaret had decided that they wanted to raise their children, Andrew and Julie, in New Zealand. Throughout his career, Alastair was regularly offered posts at prestigious universities overseas, but turned them down. However, he held visiting positions at Bell Labs, the universities of North Carolina, Wisconsin, and UC Berkeley in the US, and at the University of Southampton in the UK.

In 1994, the University’s statistics staff, led by Professor George Seber, had a very amicable divorce from the Department of Mathematics and Statistics, and Alastair became the head of the new Department of Statistics. He helped set the tone for the department that still exists – hard-working, but welcoming, and social. The Department of Statistics is now the largest such school in Australasia.

In 2005, Alastair officially retired. A conference in Auckland that year in his honour attracted the largest concentration of first-rank international statisticians in New Zealand in one place at one time. Alastair kept an office in the department and continued writing and advising, coming into work almost every day.

Alastair Scott was an influential teacher and generous mentor to several generations of statisticians who valued his sage advice coupled with his trademark affability. Alastair had a full life professionally and personally. He was a wonderful teacher, mentor, colleague, and friend. We will all miss him greatly and we extend our sincere condolences to Margaret, Andrew and Julie, and his family, friends, and colleagues all over the world.


May 22, 2017

How rich do you feel

From Scott Macleod, in a Stat of the Week nomination

The NZ Herald claims that a person earning the median NZ salary of USD $33,500 (equivalent) is the 55 millionth richest person in the world by income.

However, this must be wrong.

There are 300 million people in the USA alone, and their median income is higher than ours. This means that the average New Zealander wouldn’t even be the 55 millionth richest person in the USA, let alone the world.

Basically, yes, but it’s not quite as simple as that.  That median NZ salary looks like what you get if you multiply the NZ median “weekly personal income from salary and wages among those receiving salary and wages” (eg here) by 52, which would be appropriate for people receiving salary or wage income 52 weeks per year. The median personal income for NZ will be quite a lot lower, and the median personal income for the US is also lower: about USD30,240.

Even so, there are about 250 million adults (by the definition used) in the US, and nearly half of them have higher personal income than USD33500, so that still comes to over 100 million people. And that’s without counting Germany or the UK — or cities such as  Beijing and Shanghai that have more people with incomes that high than New Zealand does.  And that’s also assuming the web page doesn’t do currency conversions — which it looks from the code as if it’s trying to.

The CARE calculator must indeed be wrong, or using an unusual definition of income, or something. Unfortunately, the code for how it does the calculation is hidden; they say “After calculating the distribution of income, we then use a statistical model to estimate your rank.” 

As a cross-check, Pew Global also has a web page based on World Bank data.  It doesn’t let you put in your own cutpoints, but it says 7% of the world’s population had more than $50/day to live on in 2011.  The CARE web page thinks it’s more like 4.7% now.  The agreement does seem to be better at lower incomes, too — the estimates will be more accurate for people who aren’t going to use the calculator than for people who are.



May 20, 2017

Bright sunshiny day

Q: Isn’t Study suggests we need this first-thing in the morning a perfect example of click-bait?

A: Impressive. And what is this?

Q: This is daylight.

A: Makes sense.  And fits with the picture of someone stretching after getting out of bed.

Q: Does it fit the research?

A: Um.  Not so much. (link)

Q: Not people?

A: No, it was people. It’s just it was light exposure in office buildings.

Q: And these buildings weren’t where people slept?

A: No, that would be potentially inappropriate. It was where they worked.

Q: But giving people more light helped with sleep and depression?

A: “the study did not include a lighting intervention”

Q: So they compared people who had offices with windows and natural light to everyone else?

A: Basically.

Q: And there was a difference in how much sleep they got?

A: No.

Q: In whether they woke up a lot?

A: Not really. The ‘sleep efficiency’ was pretty much the same.

Q: In what, then?

A: In how long they took to fall asleep.

Q: And the depression and stress?

A: Well, the differences were statistically detectable, but they weren’t all that big.

Q: But wouldn’t you expect people with windows in their offices to be happier?

A: Yes. It’s a bit surprising how small the differences were in this study.

Q: So the headline is a bit exaggerated?

A: It’s worse than that. The headline says the research is about what you should have been doing, but it’s actually about what your employer should be doing.

May 17, 2017


  • From the NY Times: In a survey of geographical knowledge and attitudes to North Korea, Americans who can tell their arse from their elbow are more likely to favour diplomacy.  This is different from the Agrabah question, because survey participants aren’t being lied to.
  • Perceptions of bias — more precisely, claims about perceptions of bias — are very different between Democrats and Republicans in the US, according to analysis at 538.  Democrats are likely to say they think whites and Christians don’t get discriminated against much but blacks, Muslims, immigrants, gays & lesbians do. For all the groups, about a third of Republicans say they think there’s a lot of discrimination.
  • Difficulties with doing randomised experiments on social issues, from the Brookings Institution.  One of the big problems is that there isn’t good theory to allow the results of an experiment to be generalised, in contrast to drug trials where we have a pretty reasonable idea of what it means when a drug does well in a randomised trial population.  A lot of the difficulties do generalise to public health interventions, though. On a related note, economist Noah Smith talks about the role of theory and experiment in economics and in science.
  • I wrote last year about judges interrupting each other in the US Supreme Court and whether it depended on gender — the analysis in the media had ignored how much each judge talked.  There’s now an analysis with more variables (and now the right link), and the gender difference looks stronger.
May 14, 2017

There’s nothing like a good joke

You’ve probably seen the 2016 US election results plotted by county, as in this via Brilliant Maps

It’s not ideal, because large, relatively empty counties take up a lot of space but represent relatively few people.  It’s still informative: you can see, for example, that urban voters tended to support Clinton even in Texas.  There are also interesting blue patches in rural areas that you might need an atlas to understand.

For most purposes, it’s better to try to show the votes, such as this from the New York Times, where the circle area is proportional to the lead in votes

You might want something that shows the Electoral College votes, since those are what actually determines the results, like this by Tom Pearson for the Financial Times

Or, you might like pie charts, such as this one from Lisa Charlotte Rost


These all try to improve on the simple county map by showing votes — people — rather than land. The NYT one is more complex than the straightforward map; the other two are simpler but still informative.


Or, you could simplify the county map in another way. You could remove all the spatial information from within states — collecting the ‘blue’ land into one wedge and the ‘red’ land into another — and not add anything. You might do this as a joke, to comment on the President’s use of the simple county map

The problem with the Internet, though, is that people might take it seriously.  It’s not completely clear whether Chris Cillizza was just trolling, but a lot of people sure seem to take his reposting of it seriously.

May 10, 2017

Bombs away

Q: Did you see the Jagerbombs ‘as bad as taking cocaine’ headline in the Herald?

A: Doesn’t sound all that plausible. What’s a Jagerbomb? Is it like a Molotov cocktail?

Q: Apparently it’s Red Bull with Jägermeister.

A: Well, I don’t think I’m in any danger of drinking that.  How did you get the little dotty things over the ‘a’, by the way?

Q: If you hold down the ‘a’ key they pop up as an option (on a Mac). Like the Māori long vowels. But we nearly digress. Is a Jagerbomb really that dangerous?

A: Well, the story goes on to quote the researcher saying “I wondered if they were having a similar impact but to a lesser degree”

Q: And are they?

A: For suitable definitions of ‘same’ and ‘lesser’. And ‘were’.

Q: ಠ_ಠ

A: The research (no link given) looked at whether combining alcohol and energy drinks led to people getting injured more.

Q: That’s not the first thing you think of as a risk of taking cocaine. And how did they do the comparison? Recruit undergraduates with poor taste and give them Jagerbombs?

A: No

Q: You’re not going to say ‘mice’, are you?

A: No, what they did was go to the library and find all the previous studies of alcohol and energy drinks and injury, to review and summarise them.

Q: Is that useful?

A: It can be very useful. You can’t keep all that information in your head even if you’re a qualified Jagerbombologist.  Systematic reviews are a great innovation in modern medical research.

Q: So, how does the risk of injury compare to the risk with cocaine?

A: They didn’t look at that.

Q: Oh. Ok. So how big is the risk?

A: They didn’t come up with anything quantitative, because the previous research studies hadn’t been done in a similar enough way

Q: Did they come up with anything?

A: Yes, the results “suggest support for a relationship between increased risk of injury and [alcohol with energy drink] use”

Q: That’s not all that strong.

A: No.

Q: Was there a stronger relationship than just with alcohol on its own?

A: They say “some studies did not differentiate between injuries occurring in alcohol-only sessions relative to AmED sessions, making a comparison of the risk of injury between alcohol and AmED use impossible.

Q: Even if there is a difference, couldn’t it be that the sort of people who drink Jagerbombs or rum and Coke are different from people who drink beer, or cosmopolitans, or Sauv Blanc?

A: “Although the results remain mixed in terms of whether impulsivity or risk taking may moderate the relationship between AmED use and injury risk, there is enough evidence to warrant further exploration.”

Q: That all seems very reasonable.

A: The actual story isn’t too bad, either. Just the web-front-page headline.

Q: Wait, doesn’t the headline punctuation imply ‘as bad as taking cocaine’ is a quote? When it totally isn’t?

A: Yes. Yes, it does.