Bayesian NMA in Stata

Forums Software and coding Bayesian NMA in Stata

  • 2022-01-20 at 12:09 pm

    Hello new forum, this isn’t a spam posting, I’m just looking for input on whether anyone has managed to do Bayesian MA or NMA in Stata. I’m talking about random-effects models as common-effect is easy.

    A while back I explored using the official -bayesmh-, and convergence was very poor, I didn’t find results acceptable even after very long run times.

    I also wrote some code in my -network- suite to go with the paper -network bayes- writes winbugs code (for a variety of possible models) then calls winbugs to run it. It works.

    I’d value views on what more we need?

    Thanks Ian

    2022-01-20 at 12:14 pm

    Thanks Ian for kicking discussions off. I haven’t tried Bayesian MA in Stata’s bayesmh but, in general, it seems to raise the need for a collection of benchmark datasets and models, to compare different software. Maybe we can collect that together here.

    2022-01-20 at 12:29 pm

    and in reply to the general architecture of bayesmh:

    I think there is this persistent problem that users cannot just allocate combinations of data, matrices and parameters to whatever they want. Stata has introduced the idea of “substitutable expressions” a while back, which takes macro substitution and extends it to having an expression inside an otherwise non-declarative line of code.

    (Stata, for those unfamiliar, is not a functional or object-oriented language but an imperative scripting language. Underneath, there is a somewhat-lower-level OOP language called Mata.)

    But substitutable expressions can’t do everything. Notably, we can’t have a missing value in one datum and allocate a substitutable expression to it (allowing for missing data models). StataCorp’s conception of a Bayesian model is that it is one of the existing models (likelihoods), plus priors. I think this will keep tripping up serious Bayesian model builders, who often want to go beyond that concept.

    I gave a talk at the London users’ group in 2021 about Bayesian software and Stata’s strengths and weaknesses, and to solve this problem, I suggested that Stata would need to develop its own probabilistic programming language like BUGS/JAGS or Stan. From breakout room discussion including StataCorp personnel, I got the impression that this was already on their radar. That doesn’t mean it will happen, but it is being thought about.

    So, for BMA in Stata, we can probably make workarounds but there will still have to be a big reconfiguration of the Bayesian provision. Personally, I would rather wait for a future flexible Bayesian system within Stata than invest in workarounds that might be short-lived.

    • This reply was modified 2 years, 4 months ago by Robert Grant.