Saturday, 29 September 2012

The nineties are not cost-effective

After a few errands, this afternoon I took Marta to the station (on her way to meeting some friends in London) and got back at home to prepare my presentation for next week talk at a conference in Turin (the last of the 4 to which I've been invited this year $-$ personal best, so far).

They asked me to talk about Bayesian methods in pharmacoeconomics, which of course is just up my street and so I said yes. I've got lots to draw from and to say, but the time is not much (I only have 30 minutes as the invited session is pretty packed; Andrea Manca will be there too, so I think it'll be good). 

I've summarised the main points and because probably the audience will be made mostly by clinicians and practitioners, I've tried to avoid formulae as much as possible. I've not finished yet, but so far I'm fairly happy with what I've got, especially on sensitivity analysis, for which I've prepared flashy graphs and animations that should make the two tables on the next slides less boring and more comprehensible.

On the negative side, it took me far too long (and certainly longer than expected), mostly because 10 minutes after starting I had the brilliant idea to put some music on YouTube; I don't know why, but the first song I searched was this:



Great tune! But of course, for some weird mechanism, that completely filled my mind with songs from the 90s/early 00s. And so, while still occasionally modifying the presentation and checking that the LaTeX formatting was OK, I spent a lot of time searching them (probably even more than actually listening to them!). 

But it gets worse, because as I opened a new video, YouTube kept suggesting others I might like, for example this:



and this 


which in turn made me think to even more I thought I completely forgot (some of which quite cheesy, I have to admit).

So, at the end of it, I can conclude with indisputable scientific evidence that the Nineties are indeed not cost-effective. Unless, of course, I used this example in the talk to introduce cost-effectiveness analysis... 

Making babies with Markov models

In the last couple of weeks we've been hard at work to extend the HPV model. In the original version, we were considering a cohort of 280 thousand 12 years old "virtual girls"; we simulated a follow up of 90 years, in which individuals could exit because of deaths or move around the clinical states.

Now we're trying to make the cohort dynamic, ie allow new entries, as well as exits. The way we're doing it is by allowing the original women to have babies; when they get old enough, the children will enter the model as well. Thus, effectively, we'll account for two generations.

But that's not easy at all. One big problem is that, by definition of the Markov model, once "individuals" coming from different states have been merged into a common one, it is basically impossible to discern where they were coming from.



One good solution is to use "tunnel" nodes (eg in the graph above patients may die from cancer at different points in time, but to account for the fact that their survival probability is different depending on how long they have been diagnosed with cancer, there are 3 different cancer states). For now, we still have it under control, but using this strategy the number of nodes in the model tends to become very large and thus it can be problematic to estimate the actual transitions.

This has got me thinking that it would be nice to build some form of "object-oriented Markov models"; something like a set of "modules" which in fact contains smaller Markov models. The main Markov model would then connect these modules and "individuals" would transition across them (and of course among the nodes that define the inner Markov models within each compartment). I once did something like that using Bayesian networks.

It's still a bit hazy in my head (and in fact, I've not even looked if somebody has already done this!), but it seems like a nice idea.

Tuesday, 25 September 2012

Twitter Economics

I think I've spent far too much time trying to find a suitable picture to go with this post (but I have to say I'm very happy with the final output!). Anyway: this is potentially quite interesting. 

The Academic Health Economists' Blog are launching the Health Economics Twitter Journal ClubThe idea is quite simple, ie to arrange a virtual meeting to discuss a relevant paper over a Twitter account. I suppose this should make comments and discussion quick, so that the conversation flows even if the participants are not physically in the same place.

As suggested at the webpage linked above, the inaugural meeting is this coming Monday (October 1st) and this time the discussion will be on this paper, which sounds quite interesting too.

The only two drawbacks (as far as I'm concerned) are that a) the meetings are at 8pm London (UK) time (which of course is done on purpose so that most people can participate, but still bothers me because it clashes with The Big Bang Theory); and b) so far I've made a point of not having a Twitter account, since in general I find it a bit pointless and by far the less interesting of the social media. 

Truthful to my Tuscan nature, I tend to strongly support something and then despise its competitor(s), eg Linux (good) vs Apple (evil). So, because I've already have a Facebook account, I really shouldn't have a Twitter one... But I might change my mind just for this one.

Sunday, 23 September 2012

Mixed treatment counterfactual Obama

While I was working on something completely unrelated to this, last Friday I came across a paper by Simon Jackman; I've known of his work for a few years (for example, I think his book is quite good) and I quite like the fact he's applying high level Bayesian stats to political science, something I'm interested too.

This paper (number 1 in the list here) is quite thought provoking, I thought, because it mixed a few topics I've been thinking about lately. In a nutshell, they are trying to estimate the "Obama effect" in the 2008 US election. The starting question is "Would the outcome of the 2008 U.S. presidential election have been different if Barack Obama had not been the Democratic nominee?Now, this obviously has a counterfactual flavour; of course, Obama was the democratic nominee and thus (if, like me, you're that kind of person) you may think that the question does not even make too much sense, in the first place. 

But this is slightly different than usual causal analysis (usually based on counterfactual arguments); first of all, the "Obama effect" (mainly defined in terms of the president's race and its impact on the US electorate) does matter both for Obama himself, in the next election, as well as for similar situations in other elections. In addition, the analysis is based on a standard hierarchical model (ie it does not use potential outcomes) and the authors are extremely clear and upfront about the assumptions and limitations in terms of their causal conclusions, which I think is really good.

The study is based on a mixture of external data and specific surveys in which the authors tried to assess the sample's preference for different, hypothetical head-to-head comparisons. For example, before the 2008 election, they repeatedly surveyed US voters asking who would they vote for if the next election involved different combinations of Democratic-Republican candidates (Bill and Hillary Clinton, Obama, Edwards and Gore vs Giuliani, Bush, Huckabee and Romney).

Effectively the design is based on mixed treatment comparisons, as not all the samples were given the choice among all the possible head-to-head pairs. This is quite interesting and is quite straightforward to deal with using Bayesian hierarchical models $-$ if some exchangeability assumptions hold, then different comparisons can inform each other, so that all the possible comparisons can be estimated (of course comparisons informed by less hard evidence will be associated with larger uncertainty, but that's entirely reasonable).

Wednesday, 19 September 2012

Twinned

As of yesterday, I think, this blog is officially "twinned" with R-bloggers (this shouldn't be too surprising, seeing that they have been in my blogroll for a while).

I like the concept of R-bloggers, which effectively acts as a repository of posts, tutorials or comments about R. Of course, because it sort of covers all the possible areas of interest in which R could be applied, there is lot of stuff that may not be directly relevant to all visitors. But given the very large number of contributors, chances are you can find useful tips and tricks.


Monday, 17 September 2012

INLA functions (yet again)

This links back to previous posts here and here. Earlier today, I had a quick chat with Michela (by email, actually) on this topic. In particular, she was trying to use the function I've written to compute summaries from the posterior distribution of the standard deviation (rather than the precision, given by INLA by default) on an SPDE (Stochastic Partial Differential Equations $-$ some description here) model.

As it turns out, together with the precision for the structured effects, in such a model the element $marginals.hyperpar contains also two other terms, which are specific to SPDE and, more importantly, can also be negative (or are always negative? I'm not quite sure about this). Thus, if you try to apply the function inla.contrib.sd to an SPDE model it basically starts yelling at you for asking to compute a square root of a negative number.

I have to say I'm no expert on SPDE (Marta, Michela and I discuss it too in our soon-to-come-out review paper on INLA, but Michela took care of this part); in fact, I hadn't even thought about it when writing the function, which I did to deal with my own more or less standard hierarchical model. However, I'll try to fix this and may be make inla.contrib.sd more general.  

Thursday, 13 September 2012

BCEA examples

I've prepared a document (which I've put on the website here, together with some scripts at this page) which I think is helpful, if you're trying to work out BCEA. I have never really thought of this, but I believe that when you write an academic software (or rather a library in this case) most of the times it grows out of a personal need. For example, I wrote BCEA while preparing a paper and as I went along I realised that it might be helpful in other circumstances too. But in doing so, you don't (or at least I didn't) realise immediately all the complications associated with making the software usable by other people. In this case what stroke me is that it's probably not enough to be a statistician to run BCEA. 

Well, of course it helps a lot (and because the functions are not that complicated, it wouldn't take you long to figure it out!). But because the content-matter is quite specific you have to know what all the different functions actually are for before you can make sense of them. I realised this when I started thinking about a possible journal to which submit a paper discussing how BCEA works and what it does: on the one hand, a stats journal is probably not interested, because the stats behind it is not ground-breaking. But on the other hand a health economics journal may not be interested because computer programs are not their main business... So we'll have to figure something clever out!

Anyway, for the moment what I've done is to write a mini-manual describing one example in details. Specifically, I have some description of the actual model behind the economic evaluation (which to some extent one might even skip, if only really interested in learning how to use the package) and then a thorough discussion of how you work with BCEA (and kind of assuming that you've done the hard part $-$ ie developing the Bayesian model). However, I've put on the website also the files with the JAGS code and the R scripts to run it, so that, in theory, one can actually do the whole process (including the final economic analysis).

Wednesday, 12 September 2012

League (kitchen) table

Yesterday we met our friend Paolo after work. We hadn't seen him for a while, so it was nice to catch up. We were in Soho and we ended up having a bite in this little place (I know: the website is not really helpful at the moment, but at least it gives the address...).

It is a very typical "vineria", the kind of place there are plenty of in Florence, which sell amazing (if slightly pricey) prosciutto, cheese and typical food from Tuscany, and of course all sorts of nice wines. The setting is also nice and very authentic, with "designer-ish wood tables", as TimeOut calls them.

Speaking of tables, Mark posted a link to the QS research producing a new ranking of world universities. [Of course, nobody really believes in these league tables, even though they are always widely reported in the media and institutional newsletters (to point out their flaws if you're coming out badly, or to unassumingly make the point if you're a winner)]. 

In this league table, UCL comes fourth (up from last year's seventh and second in Europe). Now, to go back to Florence and our proverbial campanilismo, the good news is that we are better than Imperial (personal rival, since Marta works there) and way better than King's (official rival), who are not even in the top 10. So I suppose this is the table to be taken seriously...