[R-meta] weights in forest plot
Michael Dewey
li@t@ @ending from dewey@myzen@co@uk
Mon Aug 27 14:53:35 CEST 2018
Dear Antonia
You need to do two things to fix this
1 - make space for it by starting the forest plot higher up, or by
leaving a space. You use rows = ... to do this
2 - tell R where to put your addpoly, again by using the rows = argument.
You may also need to use the ylim argument to move the frame of the plot
so that your forest plot does not overprint it. You can find you what
value it is currently using for ylim by inspecting the result of forest
- try wrapping the call in str() - and then add to the second value to
make more space at the top or subtract from the first to make space at
the bottom.
Hard to give you exact numbers, you have to experiment. But, hey, you
are a scientist so you must believe in experimentation as the road to
wisdom and enlightenment.
Michael
On 27/08/2018 12:22, Antonia Sudkaemper wrote:
> 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("Study 1", "Study 2", "Study 3", "Study 4", "Study 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)
> addpoly.default(x = 0.5, ci.lb <http://ci.lb>=0.35, ci.ub=0.65)
--
Michael
http://www.dewey.myzen.co.uk/home.html
More information about the R-sig-meta-analysis
mailing list