Skip to content
Prev 2196 / 5636 Next

[R-meta] weight in rmv metafor

Dear Normand,

Did you read this?

http://www.metafor-project.org/doku.php/tips:weights_in_rma.mv_models

It answers 1) and 2). Let's take an even simpler example:

library(metafor)

dat <- data.frame(study = c(1,1,2,2,3,4),
                  id = 1:6,
                  yi = c(.1,.3,.2,.4,.6,.8),
                  vi = rep(.01,6))
dat

# studies 1 and 2 contribute 2 estimates each, studies 3 and 4 a single estimate

res <- rma.mv(yi, vi, random = ~ 1 | study/id, data=dat)
res

weights(res)

The output of this is:
1         2         3         4         5         6 
20.485124 20.485124 20.485124 20.485124  9.029753  9.029753

So maybe this is what you are observing - that the values along the diagonal of the weight matrix are larger for the studies with 2 estimates. But those weights are just based on the diagonal of the weight matrix. One really needs to take the whole weight matrix into consideration. As described on that page, the actual weights assigned to the estimates when computing the weight average of the estimates are the row sums of the weight matrix. You can get this with:

W <- weights(res, type="matrix")
rowSums(W) / sum(W) * 100

This yields:
1        2        3        4        5        6 
13.34116 13.34116 13.34116 13.34116 23.31768 23.31768

So actually, the weight assigned to the first and second estimate of the studies with 2 estimates is smaller than the weight assigned to the single estimate of the studies that contribute a single estimate.

Not sure what the problem is with 3) but I don't think your data are needed to clarify the issue.

Best,
Wolfgang