[R-meta] Options for generating a forest plot for multilevel subgroup meta-analysis

Viechtbauer, Wolfgang (SP) wo||g@ng@v|echtb@uer @end|ng |rom m@@@tr|chtun|ver@|ty@n|
Mon Aug 17 09:16:32 CEST 2020

Dear Mikayla,

Given the data structure you describe, the two variance components in the multilevel model will be hardy distinguishable. I would be cautious in using a multilevel model then. I would personally do one of the following:

1) Select one of the two estimates (based on some a priori rule). Then there is no dependency and you can use standard methods for pooling the estimates.

2) Run the analysis twice, each time including only one of the two. As above.

3) Impute the covariance between the two estimates based on r*SE1*SE2, where r is some assumed correlation and SE1 and SE2 are the standard errors of the (transformed) prevalence estimates. I would then use this covariance in my V matrix and use rma.mv(), but without a multilevel structure (just random effects for the individual estimates). Then one could vary r within a reasonable range and check the sensitivity of the results to the assumed correlation.

You wrote that you used the "arcsine transformation" for your data, but then also "transf.ipft", which is for the Freeman-Tukey double arcsine transformation. The "arcsine transformation" (or more precisely, the arcsine square root transformation) is not the same as the latter. But I guess you indeed used the Freeman-Tukey double arcsine transformation.

However, before using the back-transformation, I would suggest to read:


As for showing subgroups with the forest() function from metafor, you will have to do more manual work. See, for example:



>-----Original Message-----
>From: R-sig-meta-analysis [mailto:r-sig-meta-analysis-bounces using r-project.org]
>On Behalf Of Mikayla Plishka
>Sent: Monday, 17 August, 2020 0:49
>To: r-sig-meta-analysis using r-project.org
>Subject: [R-meta] Options for generating a forest plot for multilevel
>subgroup meta-analysis
>Hi there,
>I am a masters student in epidemiology at the University of Guelph's
>Department of Population Medicine working on my thesis. I am conducting a
>meta-analysis of proportions, where prevalence is the outcome of interest. I
>am conducting multiple separate meta-analyses, however, each meta-analysis
>is relatively small and has less than 15 studies. Some of my meta-analyses
>have two prevalence estimates for one study. For instance, one of my
>datasets has 10 prevalence estimates for 9 studies (1 study reports 2
>prevalence estimates). As a result, I need to do a multi-level meta-analysis
>to account for this clustering. I also have subgroups that I would like to
>group by. However, I do not need to do the multilevel analysis for the
>subgroups as I do not have multiple estimates per study in each of the
>subgroups. I mainly need the multilevel analysis for the overall combined
>prevalence estimate.
>Using the rma.mv function from the metafor package, I was able to calculate
>an overall combined prevalence estimate using a multilevel meta-analysis.
>However, I am having difficulty finding a good function to generate a forest
>plot for the multilevel meta-analysis. My data is transformed via the
>arcsine transformation and then back transformed for ease of interpretation.
>Previously, in my meta-analyses that were not multilevel, I used forest.meta
>from the meta package. I used the results of the metaprop function as the
>first argument in the forest.meta function. The metaprop function was great
>as I could calculate the appropriate effect estimate, I2 value and
>confidence intervals for my data. It also worked very well for the subgroup
>analyses. However, to the best of my knowledge the metaprop function does
>not work for multilevel meta-analyses.
>Since I am therefore unable to use metaprop and forest.meta, I tried to use
>the result of the rma.mv function with forest.rma, and back-transform it
>within the function.
>For example, I used the following code: forest(data, transf=transf.ipft,
>The above code gave me the following error "Error in xy.coords(x, y, setLab
>= FALSE) : 'x' and 'y' lengths differ". I also tried the same forest
>function with transf=transf.ipft.hm instead. This worked and it generated a
>forest plot. However, I do not want the harmonic mean, I want the arithmetic
>I did additional research to find a solution. The author of the package
>answered someone's question (https://stat.ethz.ch/pipermail/r-help/2010-
>December/263286.html) and stated that transf.ipft does not work with that
>function and, instead, I have to calculate the back-transformed confidence
>intervals manually and use these with the forest.default function as
>forest(dat$pi, ci.lb=ci.lb, ci.ub=ci.ub, ylim=c(-0.5,8), refline=NA,
>xlim=c(-.5,1.8), alim=c(0,1), digits=3, xlab="Proportion")
>I did this and it worked, however, I was unable to figure out how to show
>the subgroups with forest.default.
>I also tried the forestplot function from the forestplot package. This
>function allows me to enter in all of the data manually, however, I also
>could not figure out how to show the subgroups.
>I also tried the viz_forest function from the metaviz package, but this
>function only takes in the standard error and I could not figure out how to
>give it my own confidence intervals that I calculated. I tried adding in
>annotate_CI = TRUE to the function, but these confidence intervals are not
>correct for my purposes and the standard error bars are still printed on the
>plot (instead of the confidence interval bars).
>In addition, I would like the heterogeneity values to be printed at the
>bottom. The forest.meta function using metaprop gives this to me, but I
>cannot figure out how to generate this automatically in any of the other
>forest plot functions.
>My primary question is, what is the best option to generate a forest plot
>for a multilevel meta-analysis with subgroups? Is there a way to use
>transf=transf.ipft in forest.rma (as this seems to be the ideal option)?
>Any help would be greatly appreciated.
>Mikayla Plishka, Hons. BA.
>MSc Candidate Epidemiology
>Department of Population Medicine
>Rm 2505, Stewart Building (office)
>Ontario Veterinary College
>Email: plishkam using uoguelph.ca

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