Skip to content
Prev 4994 / 5636 Next

[R-meta] metafor inquiry: weighted moderators

Hi Daniel,

In the original formulation of the regression test by Egger (which uses standard regression models), there are two numerically equivalent formulations, one using the standard errors as predictor of the effect size estimates and one using the precisions (1 / standard errors) as predictor of the z-scores (effect size estimates / standard errors). In the first formulation, we use WLS, in the second formualation OLS. To demonstrate:

library(metafor)

### calculate log risk ratios and corresponding sampling variances
dat <- escalc(measure="RR", ai=ai, n1i=n1i,
                            ci=ci, n2i=n2i, data=dat.graves2010)
dat

### regression test using lm(); two formulations
summary(lm(yi ~ sqrt(vi), weights=1/vi, data=dat))
summary(lm(yi/sqrt(vi) ~ I(1/sqrt(vi)), data=dat))

Note that in the first formulation, we look at the slope of sqrt(vi), in the second formulation things are flipped around and we look at the intercept.

For fixed-effects meta-regression models, these two formulations are also equivalent:

### regression test using a fixed-effects meta-regression model
rma(yi, vi, mods = ~ sqrt(vi), data=dat, method="FE")
rma(yi/sqrt(vi), 1, mods = ~ I(1/sqrt(vi)), data=dat, method="FE")

Note that while the coefficients are the same as when using lm(), the SEs of the coefficients are different because a fixed-effects meta-regression model does not include the multiplicative dispersion term that lm() includes.

However, once we move to random/mixed-effects models, there is really only one formulation, where we use sqrt(vi) as predictor, that is:

### regression test using a mixed-effects meta-regression model
rma(yi, vi, mods = ~ sqrt(vi), data=dat)

The same applies to multilevel models like you are fitting. So, you really need to use the effect size estimates as outcome (not 'Tstat'). The rest is fine.

Best,
Wolfgang
Message-ID: <AS8PR08MB9193D8A08530C1AFD6E103468B87A@AS8PR08MB9193.eurprd08.prod.outlook.com>
In-Reply-To: <QB1PR01MB400320A6FB19754C88891224EC80A@QB1PR01MB4003.CANPRD01.PROD.OUTLOOK.COM>