Skip to content

[R-meta] equivalence of weighted regression and MA in the context of complex models

5 messages · Yefeng Yang, James Pustejovsky, Wolfgang Viechtbauer

#
Hi all,

I am working on one paper, in which I want to show the equivalence of weighted regression and random-effects meta-analysis in the context of the multilevel model. Basically, it is an extension of Wolfgang's bloghttp://www.metafor-project.org/doku.php/tips:rma_vs_lm_lme_lmer

The intercept-only model works very well. We can get the same model coefficients (estimated fixed effect or intercept beta0) from the two models:
dat <- dat.konstantopoulos2011
# meta-analysis
res.ml <- rma.mv(yi, vi, random = list(~1|district, ~1|study), test = "t", data=dat)
res.ml.lm <- lm(yi ~ 1, weights = rowSums(solve(vcov(res.ml, type="obs"))), dat = dat)
coef(summary(res.ml))
coef(summary(res.ml.lm))

If I do a post-hoc adjustment to the SE(beta0) of res.ml, we can get the same SE from res.ml.lm:
coef(summary(res.ml.lm))[2]/summary(res.ml.lm)$sigma

However, when I was working on meta-regression, it did not work. see the below syntax:
# regression with vi as a predictor
res.mr <- rma.mv(yi, vi, random = list(~1|district, ~1|study), mods = ~ vi, test = "t", data=dat)
res.ml.lm <- lm(yi ~ vi, weights = rowSums(solve(vcov(res.ml, type="obs"))), dat = dat)
coef(summary(res.mr))
coef(summary(res.mr.lm))

This is a key illustration of my working paper. Hopefully, I can get some help from here, especially from Wolfgang. Also, I would be grateful if someone would like to provide the formula to estimate model slopes for meta-regression in non-matrix notation. Summation notation is the best one - matrix notation is elsewhere.

Best,
Yefeng Yang PhD
UNSW Sydney
#
Hi Yefeng,

Comments inline below.

James

On Mon, Apr 3, 2023 at 8:27?PM Yefeng Yang via R-sig-meta-analysis <
r-sig-meta-analysis at r-project.org> wrote:

            
It is not possible to represent this model as a weighted linear regression
within the scope of lm(). The rma.mv() estimator uses generalized least
squares with block-diagonal weight matrices and it is not generally
possible to translate those block-diagonal weights into diagonal weights
except under some pretty specific, restrictive circumstances (such as when
the mods vary only at the highest level of the model).
Why? The matrix notation is extremely useful for this sort of thing,
whereas summation notation is cumbersome and awkward once you are working
with regression/meta-regression models (especially when estimated by
generalized least squares).

  
  
#
On my first point, I explore the case of meta-regression where the
predictors vary only at the top level of the model in this post:
https://www.jepusto.com/weighting-in-multivariate-meta-analysis/
On Mon, Apr 3, 2023 at 9:06?PM James Pustejovsky <jepusto at gmail.com> wrote:

            

  
  
#
Hi James,
Thanks for providing insights and this blog, which is very comprehensive and useful (actually, I am a big fan of your blog website). Additive heterogeneity and multiplicative heterogeneity is an interesting topic in the context of meta-analysis. I know many people are against multiplicative heterogeneity, but it is useful in some (important) circumstances - this is what I want to illustrate in my paper. Regarding the matrix notation, I know matrix notation is more elegant. The word "best" I used in my previous email is restricted to question because I want to know how to represent model coefficients estimated from the multilevel model using summation notation - it is not meant that matrix notation is not good. Sorry for the confusion.

Actually, I am going to write to you to consult with you about how to properly calculate robust cluster errors for weighted regression (or weighted lease square), which is fitted by lm() with the weight argument. I saw one of your illustrations using the target argument in coef_test() to account for weights when calculating robust SE and doing corresponding hypothesis testing (I did not find the description of this argument in the package documentation). I am curious about your general recommendation of how to use the combination of weighted regression and robust variance estimation (which is implemented in clubsandwhich package).

Best,
Yefeng
#
A note about this:
What you are doing here is using 'row sum weights', which you can also get directly from weights():

wi <- weights(res.ml, type="rowsum")
res.ml.lm <- lm(yi ~ 1, weights = wi, dat = dat) 

This is described in detail here:

https://www.metafor-project.org/doku.php/tips:weights_in_rma.mv_models#models_fitted_with_the_rmamv_function

I would be interested to hear under what circumstances 'multiplicative heterogeneity' is useful.

Best,
Wolfgang