Skip to content

[R-meta] Putting pooled effects from different multilevel meta analyses into the same forest plot

9 messages · Wolfgang Viechtbauer, Dylan Johnson, Michael Dewey

#
Please always cc the mailing list when replying.

You could use addpoly() to draw the polygons on top. Continuing with the example:

addpoly(c(coef(res.r), coef(res.n), coef(res)),
        c(vcov(res.r), vcov(res.n), vcov(res)),
        rows=3:1, efac=2, annotate=FALSE)

Best,
Wolfgang
#
Apologies for not CC?ing the mailing list.



As a last question, is there a way for me to make each of these polygons a different colour as opposed to all the same:



forest(c(coef(m.overall), coef(m.overall2), coef(m.overall3)),

       c(vcov(m.overall), vcov(m.overall2), round(vcov(m.overall3), digits = 3)),

       slab=c("Threat (k=23)", "Deprivation (k=14)", "Composite (k=77)"),

       header=c("Cognitive Flexibility", "Hedge's g [95% CI]"), xlab="Hedge's g",

       top=2, refline=NA, xlim=c(-3,1), at=log(c(.2, .5, 1)), psize=1, efac=0)



addpoly(c(coef(m.overall), coef(m.overall2), coef(m.overall3)),

        c(vcov(m.overall), vcov(m.overall2), vcov(m.overall3)),

        rows=3:1, efac=2, annotate=FALSE, col = 2)







Dylan Johnson, MSc

MA Student, School and Clinical Child Psychology
Department of Applied Psychology and Human Development

University of Toronto
252 Bloor Street West

Toronto, ON M5S 1V6



From: Viechtbauer, Wolfgang (SP)<mailto:wolfgang.viechtbauer at maastrichtuniversity.nl>
Sent: December 20, 2020 3:26 PM
To: Dylan Johnson<mailto:dylanr.johnson at mail.utoronto.ca>
Cc: R meta<mailto:r-sig-meta-analysis at r-project.org>
Subject: RE: Putting pooled effects from different multilevel meta analyses into the same forest plot



EXTERNAL EMAIL:

Please always cc the mailing list when replying.

You could use addpoly() to draw the polygons on top. Continuing with the example:

addpoly(c(coef(res.r), coef(res.n), coef(res)),
        c(vcov(res.r), vcov(res.n), vcov(res)),
        rows=3:1, efac=2, annotate=FALSE)

Best,
Wolfgang

  
  
#
Dear Dylan

Perhaps plot them one at a time?

Michael
On 20/12/2020 22:46, Dylan Johnson wrote:

  
    
  
#
As Michael suggested. Or, if you install the 'devel' version of metafor, then 'col' will also take a vector of colors in addpoly().

Best,
Wolfgang
1 day later
#
Hello,



Is there any reason that the plotwidth function isn?t working with the following forest plot:



dev.new(width=10, height=1)

forest(c(coef(m.overall), coef(m.overall2), coef(m.overall3)),

       c(vcov(m.overall), vcov(m.overall2), round(vcov(m.overall3), digits = 3)),

       slab=c("Threat (k=39)", "Deprivation (k=45)", "Composite (k=125)"),

       header=c("Inhibitory Control", "Hedge's g [95% CI]"), xlab="Hedge's g",

       top=2, refline=NA, xlim=c(-3.2,1), at=(c(0,-0.25,-0.50,-0.75)), psize=1, efac=0, plotwidth=unit(6, "cm") )

addpoly(c(coef(m.overall), coef(m.overall2), coef(m.overall3)),

        c(vcov(m.overall), vcov(m.overall2), vcov(m.overall3)),

        rows=3:1, efac=2, annotate=FALSE, col = 2, border = 2)



It doesn?t seem to change the width of the forest plot no matter what values I type in.



Thank you



Dylan Johnson, MSc

MA Student, School and Clinical Child Psychology
Department of Applied Psychology and Human Development

University of Toronto
252 Bloor Street West

Toronto, ON M5S 1V6



From: Viechtbauer, Wolfgang (SP)<mailto:wolfgang.viechtbauer at maastrichtuniversity.nl>
Sent: December 21, 2020 10:55 AM
To: Michael Dewey<mailto:lists at dewey.myzen.co.uk>; Dylan Johnson<mailto:dylanr.johnson at mail.utoronto.ca>
Cc: r-sig-meta-analysis at r-project.org<mailto:r-sig-meta-analysis at r-project.org>
Subject: RE: [R-meta] Putting pooled effects from different multilevel meta analyses into the same forest plot



EXTERNAL EMAIL:

As Michael suggested. Or, if you install the 'devel' version of metafor, then 'col' will also take a vector of colors in addpoly().

Best,
Wolfgang

  
  
#
Dear Dylan

Looking at the documentation for forest.default I see no parameter 
plotwidth so it is being passed to any functions called within that use 
the ... argument. What exactly are you trying to achieve here?

Michael
On 23/12/2020 00:54, Dylan Johnson wrote:

  
    
  
#
[cid:image002.png at 01D6D928.3583FD10]



I would like the Hedge?s g scale that runs along the x-axis to stretch further to the left and fill in some of that blank space



Thanks!



Dylan Johnson, MSc

MA Student, School and Clinical Child Psychology
Department of Applied Psychology and Human Development

University of Toronto
252 Bloor Street West

Toronto, ON M5S 1V6



From: Michael Dewey<mailto:lists at dewey.myzen.co.uk>
Sent: December 23, 2020 7:04 AM
To: Dylan Johnson<mailto:dylanr.johnson at mail.utoronto.ca>; Viechtbauer, Wolfgang (SP)<mailto:wolfgang.viechtbauer at maastrichtuniversity.nl>
Cc: r-sig-meta-analysis at r-project.org<mailto:r-sig-meta-analysis at r-project.org>
Subject: Re: [R-meta] Putting pooled effects from different multilevel meta analyses into the same forest plot



EXTERNAL EMAIL:

Dear Dylan

Looking at the documentation for forest.default I see no parameter
plotwidth so it is being passed to any functions called within that use
the ... argument. What exactly are you trying to achieve here?

Michael
On 23/12/2020 00:54, Dylan Johnson wrote:
--
Michael
http://www.dewey.myzen.co.uk/home.html

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://stat.ethz.ch/pipermail/r-sig-meta-analysis/attachments/20201223/14fa3ff0/attachment-0001.html>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 461171AD6C654B139C46CD078A66E8FA.png
Type: image/png
Size: 13652 bytes
Desc: 461171AD6C654B139C46CD078A66E8FA.png
URL: <https://stat.ethz.ch/pipermail/r-sig-meta-analysis/attachments/20201223/14fa3ff0/attachment-0001.png>
#
You probably need to play with xlim or alim, I forget which. The 
function returns some of the settings so you know where to start from.

Michael
On 23/12/2020 17:36, Dylan Johnson wrote:

  
    
  
2 days later
#
Thanks ? I will give it a go.



Best,

Dylan



Dylan Johnson, MSc

MA Student, School and Clinical Child Psychology
Department of Applied Psychology and Human Development

University of Toronto
252 Bloor Street West

Toronto, ON M5S 1V6



From: Michael Dewey<mailto:lists at dewey.myzen.co.uk>
Sent: December 24, 2020 6:38 AM
To: Dylan Johnson<mailto:dylanr.johnson at mail.utoronto.ca>; Viechtbauer, Wolfgang (SP)<mailto:wolfgang.viechtbauer at maastrichtuniversity.nl>
Cc: r-sig-meta-analysis at r-project.org<mailto:r-sig-meta-analysis at r-project.org>
Subject: Re: [R-meta] Putting pooled effects from different multilevel meta analyses into the same forest plot



EXTERNAL EMAIL:

You probably need to play with xlim or alim, I forget which. The
function returns some of the settings so you know where to start from.

Michael
On 23/12/2020 17:36, Dylan Johnson wrote:
--
Michael
http://www.dewey.myzen.co.uk/home.html