Skip to content
Prev 978 / 5632 Next

[R-meta] specified weights in rma

Antonia,

The code looks correct to me, and it looks like it is producing the
weighted average just as you specified:

    mean_effect <- weighted.mean(effect, w = weight)
    all.equal(mean_effect, as.numeric(meta$b), check.attributes = FALSE)

Also, note that the output of weights() is re-scaled to sum to 100, which
is why it does not agree with the inputted weights:

    (rma_wt <- weights(meta))
    sum(rma_wt)
    100 * weight / sum(weight)
    all.equal(rma_wt, 100 * weight / sum(weight), check.attributes = FALSE)

Cheers,
James



On Fri, Aug 3, 2018 at 7:10 AM Antonia Sudkaemper <a.sudkaemper at gmail.com>
wrote: