Thursday, 23 August 2012

Silvio, the NHS and Tasmania: what a combo!

When he was in power, in addition to a funky mood all over the country, sexy Silvio used to promise Italian voters less taxation across the board. Meno tasse per tutti ("less taxes for all") he used to say. Ça va sans dire that: i) it didn't really happen; and ii) whatever else went on, wasn't very fruitful for Italy, as the current situation testifies. 
[Digression 1: Truth be told, it's not just Silvio's fault, I think; those before and after him didn't help either. But, boy did he do his best to screw things up!]

I thought of this while I was reading of a new study that has just come out, which discusses health- and lifestyle-related habits in the UK population. Not surprisingly (I would think), the main conclusion is that people in the UK are overall improving their lifestyle, drinking and smoking less than they were previously. 

However, again not entirely surprisingly (just like the fact that Silvio's tax promises didn't come true), this applies effectively only to the middle and upper class, while people in more deprived conditions are still very much affected by very risky habits. This of course has clear repercussions on their health, making them at far higher risk (up to 5 times as much, according to the report) to develop cancer, cardiovascular diseases, etc $-$ all leading to much lower quality of life and higher cost for the NHS.

I suppose this begs the question (which, as far as I can tell, the report doesn't answer) of whether the massive investments to promote healthier lifestyle, by both Labour and Tory governments in the last 10 years at least, have been actually good value for money. That's of course a very tricky business; it's complicated to develop interventions that everybody can take up equally (or even better, incrementally according to the underlying need), and the class divide in this country is really striking.
[Digression 2I know: that's an extremely naïve point to make, but as someone who wasn't born but lives here, the realisation is quite a slap in the face! I may be subject to some bias in saying this, but to my recollection, this was not the case, when I was growing up in Italy. Sure: Silvio & friends (on either side of the political spectrum) were most definitely better off. But I seem to recall that most people would have considered themselves "middle class". Extreme poverty and deprivation did exist, especially in the South of the country, but I didn't think the class system was so damning, back then. I'm afraid things are changing for the worse now?]

Anyway, the evidence points to the direction of clear effectiveness (and presumably cost-effectiveness) in some groups, but no effectiveness (and most certainly no cost-effectiveness) in others. So I ask myself: are we good enough in applying these interventions? Should we work even more towards stratified interventions that apply differently to different sectors of society? 

Also: do we leave people too much freedom to actually take these interventions up? Should we do like the state of Tasmania (Australia) who is apparently thinking about issuing a complete ban on smoking for everybody born on or after the year 2000? No free will there: we know by now that smoking is bad and so nobody will. 

I've no solution here: on the one hand, isn't it wrong to know that something is really bad for the individuals (especially so for those who are worse off to start with) and society as a whole, and still allow it $-$ and even make some money out of it, at least in the (very) short run? 
[Digression 3: Just to be clear: I'm talking about smoking here, not voting sexy Silvio back in power. Surely that will never happen again? Or will it?] 
On the other hand, however, there's plenty of evidence (this is kind of related) to show that just because something becomes illegal, that doesn't mean people will stop doing it... 


Wednesday, 22 August 2012

Finding thetas in Europe

I love the name of this conference $-$ that's one of the geeky-est things I've ever heard! The organisers are social scientists and aim at building a scientific network of (European) Bayesian applied statisticians. I may even go...

The only thing I would complain about is the logo:



First of all, there's only one $\theta$ in it, so to find more than one is quite difficult. Also, with such a big $\theta$ covering most of Europe, it doesn't really take a scientist to find it, does it?

Saturday, 18 August 2012

How do we judge worse than the worst?

The Italian film industry are quite weird. In particular, they are curiously inventive when they translate the original title of foreign movies. Here are some of my favourite examples.

Tuesday, 14 August 2012

Sweet 16

The birthday paradox is very funny (well: geek-funny, at least). You may think that it's pretty unlikely that someone you know shares your birthday. In fact, if you know a large enough number of people, the probability of this circumstance goes to 1. 

And even if you only have 10 friends, there's still a probability of nearly 12% that one of them was born on the same day as you. Even more strikingly, if you have as little as 23 friends the probability that two of them share a birthday is 50%!

In my case (I turn 16-ish today), this is fully respected. I do have one friend (Russell) who has his birthday today as well. Moreover, my friend Lorenzo has his on the 15th (that's close enough, and actually at one point, when I was living in Boston, we celebrated both our birthdays at the same time $-$ it was already the 15th in Italy, but still the 14th in the US).

Other very close friends do share their birthday with me: among them, Guido Castelnuovo and Mila Kunis(OK: perhaps I don't seem them as much, Guido having lived in the 19th centrury and Mila being busy in Hollywood. But that doesn't make us less friendly...).

Wednesday, 8 August 2012

+18 medals, but plus or minus what?

This is my last post on the Olympics: promised! My friend Stefano posted this link to an article in (one of the very few) Italian respectable newspapers (more or less the same as this, which is in English).

I took the data resulting from Goldman Sachs' analysis (usual digression and probably cheap moaning: don't these people have something far more important to do, eg stop draining money, than wasting their time playing around with this?) and plotted this.



That's the comparison between the observed number of medals won in Beijing and their prediction for the number of medals won in London. Most of the countries seem to lie on the 45 degrees line, which means that they are expected to replicate last time performance. The outstanding countries are effectively Team GB and, only marginally, Italy. The US and China are predicted to do slightly worse than last time around (a difference of just 2 medals).

My comments to this are: 
  1. I think the results reported are a bit confusing. In fact, the data are only given for the countries that have won some medals in Beijing and are predicted to win some in London. But in this way it is not very clear who are losing out and how much so. In the data made available, only the US (-2), China (-2) and Jamaica (-1) are predicted to have fewer medals than in Beijing. I think it would have been better to report the complete list of medal winners from Beijing in the their table.
  2. I think the model gives a bit too much weight to the "home effect" (ie the increase in the number of medals due to the fact that a country is hosting the event). Team GB are doing extremely well and have already exceeded their remarkable performance of four years ago, but may be the estimation of an increase by 18 medals is a bit too optimistic. Also, it would have been interesting to see the prediction for China given all the data before Beijing to check how reasonable the "home effect" was.
  3. I'm not sure why Italy are predicted to do a bit better that previously $-$ presumably that's something to do with GDP (one of the variables included in the model)? As I've mentioned somewhere else, I think that GDP is only one side of the story as it doesn't necessarily reflects investment in sports. If you can read Italian, perhaps you can have a look at this $-$ I think I agree almost entirely. 
  4. More importantly, both from the statistical and substantial point of view, the exercise is all about prediction (or at least the headline is). But what they have spectacularly failed to do is to report any measure whatsoever of the variability associated with their estimation. Surely their prediction will be based on reasonably different extremes, to account for uncertainty?
All in all, I think it's funny how we (I mean myself included) get sometimes carried away with this insane need of putting our day-to-day job (and supposed expertise) to use for big events, like the Euros, or the Olympics.

I asked Lizzy to declare the Olympics close on the first Sunday, when we were ahead of the game (sadly she didn't). But perhaps now it's really time she does!

Monday, 6 August 2012

A bunch of R (and JAGS) scripts

I finally (nearly) got around to prepare the R code to replicate the examples in the book. I divided the examples by chapter and then linked to the R scripts and, for those involving Bayesian analysis, the associated JAGS models.

At the moment, the scripts basically cover 3 running examples (discussed in several parts of the book):
  1. MCMC.R. A Gibbs sampler for the very simple case of a semi-conjugated Normal model \begin{eqnarray*}y_i &\sim& \mbox{Normal}(\mu,\sigma^2)\\ \mu\mid\sigma^2 & \sim & \mbox{Normal}(\mu_0,\sigma^2_0) \\ \tau=1/\sigma^2 &\sim& \mbox{Gamma}(\alpha_0,\beta_0)\end{eqnarray*} to show the basics of the method. That's all written in R and I also provide some additional code to make some plots, showing convergence varying the number of iterations, something like this:
     


  2. normalModel.R. A linear regression model \begin{eqnarray*} y_i & \sim & \mbox{Normal}(\mu_i,\sigma^2) \\ \mu_i & = & \alpha + \beta x_i \\ \alpha,\beta & \sim & \mbox{Normal}(0,h^2) \\ \log(\sigma) & \sim & \mbox{Uniform}(-k,k) \end{eqnarray*} This has several slightly different specifications to show how things change when centring a covariate, or selecting a longer burn-in for the MCMC, or using thinning. There are actually two versions of this script and this modifies the original model to include blocking to improve convergence and estimate the predictive distribution. Both versions also include the JAGS code to run the different models.
  3. HEexample.R. This runs a (reasonably simple) health economic model whose aim is to estimate the cost-effectiveness of a new chemotherapy drug. This actually consists of two steps. The first one specifies the model in terms of a set of relevant parameters. These are estimated through MCMC (and the JAGS code is provided). Then, using BCEA, the actual cost-effectiveness analysis is run. The script provides the code to run the basic analysis, as well as more advanced ones (including the computation of the Expected Value of Partial Information, model average to account for uncertainty in model specification, decision-maker's risk aversion and the mixed analysis to consider non-optimal market configurations $-$ I've discussed this here).
Soon(-ish), I'll add the code for the examples in chapter 5, which are specific health economic evaluations. These are also a combination of R and JAGS codes that basically set up and run the Bayesian model via R2jags and then post-process the results to produce the health economic evaluation.

Curiosity killed the cat

While I was taking Marta to the station earlier today, I heard on the radio that NASA has successfully sent Curiosity, a mobile laboratory, to Mars. Apparently, this is a £1.6 billion 98-week mission (the length of one Martian year), whose aim is to explore a crater that billions of years ago may have been filled with water. 

I have to say I'm a bit torn on this one: on the one hand, I think it's an incredible achievement and there is the possibility of gathering evidence to substantiate the possibility of "compatibility with life" on the red planet. I can see the scientific importance of this question and I kind of understand the excitement of the space community (I know: put it this way, it sounds more like an after school activity, but you know what I mean...).

On the other hand, I wonder whether at this precise moment in human history, this is the best way of investing £1.6 billion of (sort of, or at least, partially) public money. But then again: is this the best time to invest (sort of, or at least, partially) public money to organise and run the Olympics? (By the way, I did have a lot of fun on Saturday watching the games in Hyde Park and then at Earl's Court).

I suppose you might argue that, from the very practical point of view, finding out right now whether we could actually migrate and live on Mars is a grand exercise in forward planning. So, when we'll have finally filled up planet Earth with too many replicas (or should I say replicae?) of us, we could branch out to Mars (which is only 9 months away $-$ and to think we bitch about our 1 hour commute into central London!).

Friday, 3 August 2012

Who are the best team in the Olympics?

Given that I'm a Leo (since I was born in August) and that 2012 is an Olympic year, I thought that this would be quite nice and appropriate as my next favicon. I wonder if I'd get sued? 

[By the way, as I'm writing, Andy Murray, one of the people in my team, has just got into the final of the tennis tournament. Well done Team Me!] 

Anyway. I was reading an article in the Guardian, which discusses an alternative way of ranking the Olympic teams with respect to the medals table, produced by a group of statisticians at Imperial College. 

The obvious way is to simply count the number of medals won. But of course there is some confounding going on $-$ for example, bigger countries have a larger "pool" of potential athletes from which to get their participants. Similarly, wealthier countries could (theoretically) invest more money in sport, thus making them more likely to win medals.


So they have produced a few alternative ranking systems, based on weighting the observed numbers and accounting for a few key variables (although it's not very clear what they've actually done to produce the weights). 


I think that's kind of reasonable, but it doesn't account for (at least) one important factor: the underlying assumption is that every medal is worth the same. But that's not true for all sports. Some countries, albeit small, may be powerhouses in a given sport. Thus, winning a medal is not quite so unlikely: North Korea winning gold in judo is not quite shocking, is it?

Nevertheless, I think it's interesting to see that if you plot the official ranking against that based on each nation's GDP (which by the way I think would have been a much better way to report the data, instead of the big table given by the Guardian) only North Korea (PRK) remains in the top 10. 



Moreover, I'm not sure that GDP is actually the best variable to consider here: yes, richer countries have theoretically more money to spend on training athletes. But take for example Italy. We are in the top 10 official ranking but move to only the top 30 when accounting for GDP. However, in fact the actual amount of money that the government allocates to sport is quite low with respect to the actual GDP (possibly excluding football, as my hooligan wife suggests).