[R] Metafor and forest(); not showing 'ilab' and text
Michael Dewey
lists at dewey.myzen.co.uk
Tue Aug 25 19:24:54 CEST 2015
Dear Marco
When you change xlim it increases the width of the forest plot in the
sense you describe. It does not push your text out of the way to make
space for it but instead overprints it. You may like to use alim to
truncate your confidence interval whiskers to fit within the space you
see or make your labels shorter.
On 25/08/2015 17:25, Marco Colagrossi wrote:
> I think I've not explained myself well. When I say "the width of the
> forest plot" I mean the region above the observed outcome, the
> "actual" forest plot, not the plot as a whole. Even if I change values
> for Xlim, cex or ilab.xpos the width of that particular region within
> the plot doesn't change.
>
> Best,
>
> Marco
>
> On 25 August 2015 at 18:11, Viechtbauer Wolfgang (STAT)
> <wolfgang.viechtbauer at maastrichtuniversity.nl> wrote:
>> The 'xlim' argument does not change the actual width of the plotting device. For that, you need to use the 'width' argument with whatever device you are actually using. You can then use the 'xlim' argument to create appropriate spacing to the left/right of the part of the plot that shows the estimates and their CIs. Within that space, you can then add additional columns with the 'ilab' argument. It's up to you to find an appropriate combination of plotting device width, character/symbol expansion factor ('cex' argument), 'xlim' values, and 'ilab.xpos' values to create a nice looking plot that has no overlapping text and no excessive white space. An example is this:
>>
>> http://www.metafor-project.org/doku.php/plots:forest_plot_with_subgroups
>>
>> Note that it took me dozens of iterations to create that plot. You just have to start experimenting.
>>
>> Best,
>> Wolfgang
>>
>>> -----Original Message-----
>>> From: Marco Colagrossi [mailto:marco.colagrossi at gmail.com]
>>> Sent: Tuesday, August 25, 2015 17:59
>>> To: Viechtbauer Wolfgang (STAT)
>>> Cc: r-help at r-project.org; Michael Dewey
>>> Subject: Re: [R] Metafor and forest(); not showing 'ilab' and text
>>>
>>> Thanks again for your help. I'm sorry to bother you but I don't get
>>> how to widen the forest plot; if I try to change the values of xlim or
>>> the ilab.xpos values the width of the forest plot region does not
>>> change, but only moves on the graphs. What I'm I missing?
>>>
>>>
>>> forest(pc, var, ci95m, ci95p, slab = authoryear, psize=1,
>>> subset=(pub==1),
>>> xlim = c(-16, 6),
>>> ilab = data.frame(SIMdv, SIMiv),
>>> ilab.xpos = c(-7.5, -5.5), cex = 0.75)
>>> op <- par(cex=.75, font=2)
>>> text(c(-7.5, -5.5), 54, c("DV", "IV"))
>>> text(-16, 54, "Author(s) and Year", pos=4)
>>> text(6, 54, "Outcome [95% CI]", pos=2)
>>> par(op)
>>>> par("usr")[1:2]
>>> [1] -16 6
--
Michael
http://www.dewey.myzen.co.uk/home.html
More information about the R-help
mailing list