[R-meta] Mismatch between output from sub-group analysis and forest plot

Joao Afonso jot@|on@o @end|ng |rom gm@||@com
Fri Feb 14 17:05:07 CET 2020

Dear Guido,

Thank you so much for your reply and help.

I can see that your forest plot results differ only in the estimates
for each group (as a result of assuming a common or different tau2
values). I also see that your code is much simpler than the one I have
used (which was extracted from How to Conduct a Meta-Analysis of
Proportions in R: A Comprehensive Tutorial by Naike Wang).

A final question if you don't mind.

I have the same overall pooled estimate ("Prevalence of Lameness in
British Dairy Cattle") in all forest plots I have produced while
conducting sub-group analysis on the different moderators. Yet all the
overall pooled estimates I get in the console are different from the
corresponding plot. Could it be that the code I have used (below)
modifies how the overall pooled estimate is calculated (specially
lines 7 to 9 estimating dat.samevar and then lines 10 to 12 estimating
the pooled effect size - pes - based on dat.samevar)?  Maybe
estimating the overall pooled estimate ("Prevalence of Lameness in
British Dairy Cattle") based on the tau2 of each subgroup? (I can't
find any difference in our forest plot code, thus it is likely that
the difference relies on the meta-analysis code...)

1. subganal.lcmbi=rma(yi, vi, data=ies.da.lcmbi, mods=~lcmbi, method="DL")
2. pes.da.lcm=rma(yi, vi, data=ies.da.lcmbi, subset =
lcmbi=="Records", method="DL")
3. pes.da.records=rma(yi, vi, data=ies.da.lcmbi, subset =
lcmbi=="Locomotion Scoring Method", method="DL")
4. pes.subg.lcmbi=predict(subganal.lcmbi,
5. transf=transf.ipft.hm,
6. targ=list(ni=prevalence_2020_cow_nomv$ssizeanimal))
7. dat.samevar=data.frame(estimate=c((pes.da.lcm$b)[1], (pes.da.records$b)[1]),
8. stderror=c((pes.da.lcm$se)[1], (pes.da.records$se)[1]),
9. tau2=subganal.lcmbi$tau2)
10. pes.da.lcmbi=rma(estimate, sei=stderror,
11. method="DL",
12. data=dat.samevar)
13. pes.lcmbi=predict(pes.da.lcmbi, transf=transf.ipft.hm,
14. pes.lcm=predict(pes.da.lcm, transf=transf.ipft.hm,
15. pes.records=predict(pes.da.records, transf=transf.ipft.hm,
16. print(pes.da.lcm, digits=3) #display subgroup 1 summary effect size
17. print(pes.da.records, digits=3) #display subgroup 2 summary effect size
18. print(pes.lcm, digits=3) #display subgroup 1 summary effect size
19. print(pes.records, digits=3) #display subgroup 2 summary effect size
20. print(subganal.lcmbi, digits=3) #display subgroup analysis results
21. print(pes.lcmbi, digits=3) #display recomputed summary effect size

I hope this question isn't too stupid but I am curious to know what
the code above does differently to result in the overall pooled
estimate being different between console output and forest plot.

Wishing all a great weekend and once again many thanks for all the help!


On Fri, Feb 14, 2020 at 1:13 PM Guido Schwarzer <sc using imbi.uni-freiburg.de> wrote:
> Joao,
> I can only find a very subtle difference in the results of the Freeman-Tukey method between meta and metafor. While meta uses subgroup-specific harmonic means to back-transform results, metafor uses the harmonic mean of all studies for both subgroups. Differences are only visible in the third digit for prevalence estimates and confidence intervals.
> Another point to mention is that differences in results of random effects subgroup analyses (i) allowing for different estimates of the between-study variance tau2 and (ii) assuming a common value of tau2 have to be expected. It should be clear that subgroup analyses assuming a common value for tau2 of 0.0218 produce different results than two separate subgroup analyses using values of 0.0109 and 0.0269, respectively.
> Best wishes, Guido

João Afonso
DVM, MSc Veterinary Epidemiology
PhD Student
Department of Infection and Global Health
University of Liverpool

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