[R] metafor package

Viechtbauer Wolfgang (STAT) wolfgang.viechtbauer at maastrichtuniversity.nl
Tue Dec 8 09:47:43 CET 2015


Hi John,

Please keep r-help copied on the reply.

What's the 'previous model'? How do you get estimates within subgroups that 'includes the overall effect'? I really cannot follow you here.

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: John Peterson [mailto:john.peterson.can at gmail.com]
> Sent: Monday, December 07, 2015 22:14
> To: Viechtbauer Wolfgang (STAT)
> Subject: Re: [R] metafor package
> 
> Hi Dr. Viechtbauer,
> Thank you very much for your reply. I tried your advice and was able to
> make a forest plot with only the estimates for each subgroup.For the
> estiamte for each subgroup, similar to the previous model, I random
> effects model within each subgroup. However, I now find the result for
> the estiamte within subgroup to be different thant the result for the
> previous model. I have tried analyzing this in STATA and I get the same
> result as the model which includes the overall effect. Any advice on what
> may be wrong here? Thanks greatly,
> John
> 
> On 7 December 2015 at 04:02, Viechtbauer Wolfgang (STAT)
> <wolfgang.viechtbauer at maastrichtuniversity.nl> wrote:
> The code you posted is totally mangled up, but it's just what can be
> found here:
> 
> http://www.metafor-project.org/doku.php/plots:forest_plot_with_subgroups
> 
> If you don't want an overall estimate, just pass the estimates and
> corresponding sampling variances to the forest() function (and not the
> model object). Use the 'rows' argument to specify where the estimates
> will be placed and adjust 'ylim' so give you enough space to leave gaps
> for headings and the subgroup estimates. Then fit models within the
> subgroups (the 'subset' argument is useful here) and use addpoly() to add
> the subgroup estimates in the appropriate rows. With text(), you can add
> headings as needed.
> 
> If you use weights() on each subgroup model object, you can get the
> subgroup weights (that add up to 100% within each subgroup). It's
> probably easiest to just add those values with text() in an appropriate
> place to the plot.
> 
> 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-help [mailto:r-help-bounces at r-project.org] On Behalf Of John
> > Peterson
> > Sent: Monday, December 07, 2015 01:39
> > To: r-help at r-project.org
> > Subject: [R] metafor package
> >
> > Hi Everyone,
> >
> > I am conducting a meta-analysis using the metafor package. I am
> > interested
> > in obtaining an estimate by subgroup only without showing an overall
> > effect. This is directly from the metafor website. How would i modify
> > this
> > code to only show subgroup effects? Further, I want to show weights by
> > subgroup. The option showweights=TRUE does not display weights by
> > subgroup
> > but by the weight of each study in comparison to all studies (and not
> the
> > subgroup). You help would be appreciated.

[snip garbled code]



More information about the R-help mailing list