Bayesian NMA in Stata
Forums › Software and coding › Bayesian NMA in Stata

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 randomeffects models as commoneffect 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 https://onlinelibrary.wiley.com/doi/10.1002/sim.8360. 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
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.
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 nondeclarative line of code.
(Stata, for those unfamiliar, is not a functional or objectoriented language but an imperative scripting language. Underneath, there is a somewhatlowerlevel 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 shortlived.
 This reply was modified 2 years, 4 months ago by Robert Grant.
You must be logged in to reply to this topic.