Skip to content
Prev 433 / 5632 Next

[R-meta] Testing for subgroup differences - meta (byvar) vs metafor

I'll add one further difference between metagen and rma. In metagen, the
test of the moderator is based on the usual large-sample chi-squared
approximation, even if the CIs for the sub-group average effects use the
Knapp-Hartung adjustment:

metagen_fit <- metagen(MD, seMD, byvar = region, data = Fleiss93cont,
tau.common = TRUE, method.tau = "REML", sm = "MD", hakn = TRUE)
metagen_fit$Q.b.random
pchisq(metagen_fit$Q.b.random, df = metagen_fit$df.Q.b, lower.tail = FALSE)

If you fit the same model in metafor, the test of the moderator appears to
use the meta-regression version of the Knapp-Hartung adjustment and an
F-test with (k - p) degrees of freedom, where k is the number of studies
and p is the number of coefficients in the meta-regression:

rma_fit <- rma(y = MD, sei = seMD, mods = ~ region, data = Fleiss93cont,
method = "REML", test = "knha")
pf(rma_fit$QM, df1 = 1, df2 = 3, lower.tail = FALSE) # as an F test
2 * pt(abs(rma_fit$zval[2]), df = 3, lower.tail = FALSE) # as a t test

There is a similar discrepancy if we instead use rma.mv and test = "t". In
that case (with two variance components), I doubt either version of the
test is that great and it would probably be better to use some sort of
Satterthwaite approximation for the degrees of freedom. Or get yourself
more studies.

James

On Wed, Dec 6, 2017 at 3:23 AM, Viechtbauer Wolfgang (SP) <
wolfgang.viechtbauer at maastrichtuniversity.nl> wrote: