Search code examples
rmetafor

R metafor - why are results different when using default weights vs. setting weights to 1/variance?


I'm using the metafor package to perform a meta-regression. My model/code is of the form:

rma.mv(yi = data_mean, V = data_variance, random = ~ 1 | study_id/arm_id, data=mydata, mods = ~ mod1 + mod2 + mod3)

I'm under the impression that the default weighting is by inverse variance. However, I noticed that if I add the argument "W = 1/data_variance" to the code above it yields different results (than not specifying W). Why is this?

While I'm here I'd also like to confirm that for V I should be using (standard error)^2 rather than (standard deviation)^2 -- is that correct? (It seems "variance" can refer to both, which is confusing!)


Solution

  • By default, rma.mv() (and rma.uni()) uses the inverse of the model implied variance-covariance matrix of the observed outcomes as the weight matrix. For a simple fixed- or random-effects model, the model implied variance-covariance matrix is diagonal with V or V + tau^2, respectively, along the diagonal. The inverse is hence also diagonal with 1/V or 1/(V + tau^2) along the diagonal.

    You are using a more complex model with random effects at the study level and at at the arm level. The model implied var-cov matrix of the outcomes is therefore not a diagonal matrix and hence its inverse is also not diagonal. Therefore, if you force the use of 1/V weights (which gets turned into a diagonal weight matrix with 1/V along the diagonal), you are using a completely different weight matrix than what is used by default.

    As for your second question: V corresponds to the squared standard errors of the estimates. Those are also called the 'sampling variances' of the estimates.