[R-meta] Q-Statistic for Between-Subgroup Heterogeneity

Viechtbauer, Wolfgang (SP) wolfg@ng@viechtb@uer @ending from m@@@trichtuniver@ity@nl
Fri Jul 13 18:31:02 CEST 2018

Dear Ty,

The test for 'between-group' differences/heterogeneity is provided if you include the subgroup variable as a categorial moderator (i.e., as a factor) in the model. For example:


dat <- get(data(dat.bcg))
dat <- escalc(measure="RR", ai=tpos, bi=tneg, ci=cpos, di=cneg, data=dat.bcg)

res <- rma(yi, vi, mods = ~ factor(alloc), data=dat)

In the output, you will find:

Test of Moderators (coefficients 2:3):
QM(df = 2) = 1.7675, p-val = 0.4132

This is the test for between-subgroup heterogeneity.


-----Original Message-----
From: R-sig-meta-analysis [mailto:r-sig-meta-analysis-bounces using r-project.org] On Behalf Of Ty Beal
Sent: Friday, 13 July, 2018 15:46
To: r-sig-meta-analysis using r-project.org
Subject: [R-meta] Q-Statistic for Between-Subgroup Heterogeneity

I am conducting a meta-analysis of proportions using the metafor package and want to compare heterogeneity between subgroups. I don’t see an option to generate a Q-statistic for between-subgroup heterogeneity. Is there any way to accomplish this with the metafor package?

I can do this with the meta package using metaprop() and the byvar option—however, it does not let me specify separate weightings as rma() from the metafor package does.


Ty Beal, PhD
Technical Specialist
Knowledge Leadership

GAIN – Global Alliance for Improved Nutrition
1509 16th Street NW, 7th Floor | Washington, DC 20036
tbeal using gainhealth.org<mailto:atumilowicz using gainhealth.org>
C: +1 (602) 481-5211
Skype: tyroniousbeal

More information about the R-sig-meta-analysis mailing list