Skip to content
Prev 2577 / 5636 Next

[R-meta] compare multiple "bayesmeta" estimates

Dear Reza, dear Simon,

yes, indeed, you can also (possibly more easily) work out the solution
via Monte Carlo sampling:


dif <- bma1$rposterior(1e4, tau.sample=FALSE) -
bma2$rposterior(1e4, tau.sample=FALSE)

quantile(dif, probs=c(0.5, 0.025, 0.975))


Note that using "tau.sample=FALSE" accelerates sampling and only
returns the "mu" samples relevant here.

I also spotted an *ERROR* in my previously posted solution (Email from
2020-12-27). In the call to the "convolve()" function, you need to
explicitly specify the function arguments ("mu=..."), otherwise it will
by default pick the first one (which is "tau" here). With this fix, you
get matching results with the numerical convolution and Monte Carlo
approaches -- see the attached code. Sorry for the confusion!

Cheers,

Christian
On Tue, 2020-12-29 at 16:16 -0600, Reza Norouzian wrote:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ma-difference.R
Type: text/x-r-source
Size: 7189 bytes
Desc: ma-difference.R
URL: <https://stat.ethz.ch/pipermail/r-sig-meta-analysis/attachments/20210106/393c8026/attachment-0001.bin>
Message-ID: <89dfa2f8763a20050d674fa74cbc8c49367433fd.camel@med.uni-goettingen.de>
In-Reply-To: <CAKt3tzmN=cZPYBO+iTjazs1E94ncNHMo0xtcJKpBD82C1uX1fQ@mail.gmail.com>