Skip to content

Metafor package: Including multiple (categorical) predictors

3 messages · Bexkens, Anika, Jeremy Miles, Viechtbauer Wolfgang (STAT)

#
The test of moderator coefficients (QM) is chi-square distributed.You
can use the change in this value when you add a predictor to the model
as a chi-square test, with df equal to the change in df.

Jeremy
On 2 August 2012 05:54, Bexkens, Anika <A.Bexkens at uva.nl> wrote:
#
Just to follow up on that: You can use the 'btt' argument in the rma() function to specify which coefficients to include in the QM test. For example:

data(dat.bcg)
dat <- escalc(measure="RR", ai=tpos, bi=tneg, ci=cpos, di=cneg, data=dat.bcg, append=TRUE)
rma(yi, vi, mods = ~ factor(alloc) + year + ablat, data=dat, btt=c(2,3))

will give you a test of the alloc factor. Note that it does not matter which level of the factor is the reference level:

rma(yi, vi, mods = ~ relevel(factor(alloc), ref="random") + year + ablat, data=dat, btt=c(2,3))

This will give you a Wald-type test. Alternatively, you can use a likelihood ratio test (for this, you have to use method="ML"):

res1 <- rma(yi, vi, mods = ~ factor(alloc) + year + ablat, data=dat, method="ML")
res0 <- rma(yi, vi, mods = ~               + year + ablat, data=dat, method="ML")
anova(res1, res0)

Best,

Wolfgang

--   
Wolfgang Viechtbauer, Ph.D., Statistician   
Department of Psychiatry and Psychology   
School for Mental Health and Neuroscience   
Faculty of Health, Medicine, and Life Sciences   
Maastricht University, P.O. Box 616 (VIJV1)   
6200 MD Maastricht, The Netherlands   
+31 (43) 388-4170 | http://www.wvbauer.com