[R-meta] Two ways to calculate subgroup and overall average effect sizes

Viechtbauer Wolfgang (SP) wolfgang.viechtbauer at maastrichtuniversity.nl
Wed Aug 16 18:34:35 CEST 2017


Dear Naike,

Take a look at:

http://www.metafor-project.org/doku.php/tips:comp_two_independent_estimates

and especially the last section (Meta-Regression with All Studies but Different Amounts of (Residual) Heterogeneity). To get an overall estimate, but allowing for different amounts of heterogeneity across the levels of some factor (e.g., 'alloc' here), you would use:

rma.mv(yi, vi, random = ~ alloc | trial, struct="DIAG", data=dat)

Adapt to your data accordingly.

Best,
Wolfgang

-- 
Wolfgang Viechtbauer, Ph.D., Statistician | Department of Psychiatry and    
Neuropsychology | Maastricht University | P.O. Box 616 (VIJV1) | 6200 MD    
Maastricht, The Netherlands | +31 (43) 388-4170 | http://www.wvbauer.com    

-----Original Message-----
From: R-sig-meta-analysis [mailto:r-sig-meta-analysis-bounces at r-project.org] On Behalf Of Naike Wang
Sent: Wednesday, August 16, 2017 18:29
To: r-sig-meta-analysis at r-project.org
Subject: [R-meta] Two ways to calculate subgroup and overall average effect sizes

ATTACHMENT(S) REMOVED: ATT00001.txt | do not assume same variance.jpg | assume same variance.jpg | no subgrouping.jpg | two options you can select.jpg | data.csv 

Hi all,
I noticed that in Comprehensive Meta Analysis (CMA), there are two options you can select to calculate subgroup average effect sizes. The first approach is assume a common among-study variance component across subgroups and the second one is not assume a common among-study variance component. When you select different approaches, the subgroup average effect sizes, the overall average effect size and their confidence intervals will change accordingly. This has something to do with the tau-squared calculated by different approaches. This video here explains the reason behind it in detail if you fast forward to 22:40.

I have attached my dataset here as an example. I want to do a meta-analysis of proportions so the data doesn't have a control group. It includes a moderator called studytype that divides the studies into two subgroups: birth cohort and others.

Using R, the subgroup average effect sizes I calculated are the same as obtained in CMA. My question is that how to use R to get the same overall average effect size as calculated in CMA using different approaches?

My code:
dat=read.csv("data.csv",header=T,sep=",")
es=escalc(xi=cases,ni=total,measure="PLO",data=dat)
overall.es=rma(yi,vi,data=es,method="DL",weighted=TRUE)
pred=predict(overall.es,transf=transf.ilogit,digits=5)
print(pred,digits=5)

The overall average effect size:
 pred   ci.lb   ci.ub   cr.lb   cr.ub
 0.00042 0.00032 0.00057 0.00013 0.00135 
The overall average effect size obtained above is derived when you don't do subgrouping. In CMA, if you do subgrouping, the overall effect size will change according to the approach you select. If you assume a common among-study variance, the overall average will become 0.000430 with a 95% CI [0.000307, 0.000602]; if you do not assume that, the overall average will become 0.000453 with a 95% CI [0.000335, 0.000611], which are the values I try to obtain in R (I don't know how to do this, which is why I'm asking this question).

If assuming a common among-study variance component across subgroups:
studytype=rma(yi,vi,data=ies.logit,mods=~studytype,method="DL")
pred.studytype=predict(studytype,transf=transf.ilogit,digits=5)
print(pred.studytype[c(1,17)])
then the subgroup average effect sizes are:
      pred   ci.lb   ci.ub   cr.lb   cr.ub
1  0.00034 0.00020 0.00061 0.00008 0.00142 #Birth cohort
17 0.00049 0.00032 0.00074 0.00012 0.00191 #Others

If not assuming a common among-study variance component across subgroups:
birthcohort=rma(yi,vi,data=ies.logit,subset=studytype=="Birth cohort",method="DL")
others=rma(yi,vi,data=ies.logit,subset=studytype=="Others",method="DL")
pred.birthcohort=predict(birthcohort,transf=transf.ilogit,digits=5)
pred.others=predict(others,transf=transf.ilogit,digits=5)
print(pred.birthcohort,digits=5)
print(pred.others,digits=5)
then the subgroup average effect sizes are:
 pred   ci.lb   ci.ub   cr.lb   cr.ub
 0.00035 0.00016 0.00078 0.00005 0.00274
 pred   ci.lb   ci.ub   cr.lb   cr.ub
 0.00047 0.00034 0.00065 0.00017 0.00132

The screen shots I attached here shows the same results I obtained above.

Please let me know if my question makes sense. It's kind of difficult to explain this very clearly in an email.

Thank you for your time!

Cheers,

Naike


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