[R-meta] weights in forest plot

Michael Dewey li@t@ @ending from dewey@myzen@co@uk
Fri Aug 24 13:13:48 CEST 2018


Dear Antonia

The function addpoly comes in two forms addpoly.rma and addpoly.default. 
I think you may be picking up addpoly.rma when you want addpoly.default.

Michael

On 24/08/2018 10:46, Antonia Sudkaemper wrote:
> Hello Michael and Wolfgang,
> 
> thank you very much for your replies!
> 
> I changed the height argument and I think that worked, great!
> 
> As for addpoly() - the metafor manual only gives an example for a 
> meta-analysis that was run with rma in R. I did not run the 
> meta-analysis in R, however, but entered the values manually, and can 
> hence not use the predict(res) function as suggested? How would I do it 
> in this case? (see code below)
> 
> hedgesg = c(-0.19, 0.10, 0.26, 0.60, 0.25)
> sei <- c(.16, .07, .18, .13, .11)
> ci.lb <http://ci.lb> <- hedgesg - 1.96*sei
> ci.ub <- hedgesg + 1.96*sei
> study<-c("1", "2", "3", "4", "5")
> labels<-c(-2, -1, 0, 1, 2)
> 
> forest(hedgesg, ci.lb <http://ci.lb>=ci.lb <http://ci.lb>, ci.ub=ci.ub, 
> showweights=TRUE, refline=0, xlab = "Hedges' g", slab=study, alim = 
> c(-2,2), xlim=c(-8,5), at=labels, cex = 0.9)
> 
> All the best, Antonia
> 
> 
> 
> On Thu, 23 Aug 2018 at 13:13, Viechtbauer, Wolfgang (SP) 
> <wolfgang.viechtbauer using maastrichtuniversity.nl 
> <mailto:wolfgang.viechtbauer using maastrichtuniversity.nl>> wrote:
> 
>     To follow-up on this:
> 
>     I think it is better to adjust the size of the plotting device. Use
>     png(), pdf(), etc. and adjust the 'height' argument.
> 
>     As for adding a summary polygon, see help(addpoly).
> 
>     Best,
>     Wolfgang
> 
>     -----Original Message-----
>     From: Michael Dewey [mailto:lists using dewey.myzen.co.uk
>     <mailto:lists using dewey.myzen.co.uk>]
>     Sent: Wednesday, 22 August, 2018 16:33
>     To: Antonia Sudkaemper; Viechtbauer, Wolfgang (SP)
>     Cc: r-sig-meta-analysis using r-project.org
>     <mailto:r-sig-meta-analysis using r-project.org>
>     Subject: Re: [R-meta] weights in forest plot
> 
>     Dear Antonia
> 
>     As far as spacing is concerned I think you might consider the rows =
>     parameter. You give it a vector of the rows where you want estimates
>     plotted. It may not do exactly what you want though, but worth a try.
> 
>     Mchael
> 
>     On 22/08/2018 14:36, Antonia Sudkaemper wrote:
>      > Thank you very much, Wolfgang - this worked very well!
>     (Previously I had
>      > not specified the standard error, hence it didn't work...)
>      >
>      > I have to follow-up questions, however.
>      >
>      > 1) How can I add a summary polygon to this plot indicating the Mean
>      > Weighted Effect Size at the bottom of the plot, as is done
>     automatically
>      > when using the forest.rma function?
>      >
>      > 2) (How) Can I adjust the space between the rows? I am asking as I am
>      > producing two different plots for the same study and I would like
>     them to
>      > look similar. One of the plots includes a lot more studies than
>     the other
>      > one though, and hence the space between the rows varies. Can I
>     change this
>      > so that the plots look similar?
>      >
>      > Again, thank you so much for your help! All the best, Antonia
>      >
>      > On Wed, 22 Aug 2018 at 12:00, Viechtbauer, Wolfgang (SP) <
>      > wolfgang.viechtbauer using maastrichtuniversity.nl
>     <mailto:wolfgang.viechtbauer using maastrichtuniversity.nl>> wrote:
>      >
>      >> Hi Antonia,
>      >>
>      >> This works just fine for me:
>      >>
>      >> yi <- c(.23, .55, .33)
>      >> sei <- rep(.1, 3)
>      >> ci.lb <http://ci.lb> <- yi - 1.96*sei
>      >> ci.ub <- yi + 1.96*sei
>      >> forest(yi, ci.lb <http://ci.lb>=ci.lb <http://ci.lb>,
>     ci.ub=ci.ub, showweights=TRUE, alim=c(0,1),
>      >> refline=NA)
>      >>
>      >> Best,
>      >> Wolfgang
>      >>
>      >> -----Original Message-----
>      >> From: R-sig-meta-analysis [mailto:
>      >> r-sig-meta-analysis-bounces using r-project.org
>     <mailto:r-sig-meta-analysis-bounces using r-project.org>] On Behalf Of
>     Antonia Sudkaemper
>      >> Sent: Wednesday, 22 August, 2018 12:05
>      >> To: r-sig-meta-analysis using r-project.org
>     <mailto:r-sig-meta-analysis using r-project.org>
>      >> Subject: [R-meta] weights in forest plot
>      >>
>      >> Hello metafor users,
>      >>
>      >> I am currently making a forest plot for a meta-analysis, I am using
>      >> forest.default and am using vectors with the effect size, low
>     CI, high CI
>      >> as input.
>      >>
>      >>   I have been wondering whether there is a possibility to also
>     display the
>      >> weights used for each study? A colleague suggested to do this
>     via the
>      >> little squares that display the effect sizes, but I am not sure
>     how that
>      >> would work - any ideas?
>      >>
>      >> I found the "showweights" function, but when I set it to TRUE
>     all values
>      >> displayed are "0"- how can I enter a vector with the different
>     weights per
>      >> study?
>      >>
>      >> Thank you very much for your help.
>      >>
>      >> All the best, Antonia
>      >>
>      >> --
>      >> Antonia Sudkämper
>      >> PhD Candidate in Organizational Psychology/University of Exeter
>      >> www.antoniasudkaemper.com <http://www.antoniasudkaemper.com>
>      >> a.sudkaemper using gmail.com <mailto:a.sudkaemper using gmail.com>
> 
> 
> 
> -- 
> Antonia Sudkämper
> PhD Candidate in Organizational Psychology/University of Exeter
> www.antoniasudkaemper.com <http://www.antoniasudkaemper.com>
> a.sudkaemper using gmail.com <mailto:a.sudkaemper using gmail.com>
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 

-- 
Michael
http://www.dewey.myzen.co.uk/home.html



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