metafor package

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

metafor package

NLPace
Hi,

I have a random effects meta analysis of a proportion (logit transformation) using rma.glmm.

I have created a forest plot of the proportion (inverse logic transformation) using forest.rma.

I have added the credibility interval.

The forest plot is saved as a pdf.

The dotted line and whiskers of the credibility interval are too faint.

I need help on the argument(s) to widen the credibility interval dots and whiskers.

I have looked at the forest.default function, but don’t see anything obvious to me.

Nathan

--
Nathan Pace, MD, MStat
Department of Anesthesiology
University of Utah
801.581.6393
[hidden email]

        [[alternative HTML version deleted]]


______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: metafor package

Michael Dewey
At 22:11 11/02/2014, Nathan Pace wrote:

>Hi,
>
>I have a random effects meta analysis of a proportion (logit
>transformation) using rma.glmm.
>
>I have created a forest plot of the proportion (inverse logic
>transformation) using forest.rma.
>
>I have added the credibility interval.
>
>The forest plot is saved as a pdf.
>
>The dotted line and whiskers of the credibility interval are too faint.
>
>I need help on the argument(s) to widen the credibility interval
>dots and whiskers.
>
>I have looked at the forest.default function, but don't see anything
>obvious to me.

Dear Nathan
I think you need to look at forest.rma. There is a fairly obvious
section (search for addcred). If worst comes to worst you can always
hack it and save as nathansforest.rma.


>Nathan
>
>--
>Nathan Pace, MD, MStat
>Department of Anesthesiology
>University of Utah
>801.581.6393
>[hidden email]
>
>         [[alternative HTML version deleted]]

Michael Dewey
[hidden email]
http://www.aghmed.fsnet.co.uk/home.html

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: metafor package

S Ellison-2
In reply to this post by NLPace
Like most plotting routines in R, forest has a ... argument that passes names arguments through to other routines.
In forest's case, ... passes (at least) to abline, axis and segments, so all the lines and axes in the plot are affected by any argument that is valid for those.
In your case, specifying lwd=2 in your forest call will give all the lines width 2 instead of the default.

S Ellison

> -----Original Message-----
> From: [hidden email] [mailto:[hidden email]]
> On Behalf Of Nathan Pace
> Sent: 11 February 2014 22:11
> To: [hidden email]
> Subject: [R] metafor package
>
> Hi,
>
> I have a random effects meta analysis of a proportion (logit transformation)
> using rma.glmm.
>
> I have created a forest plot of the proportion (inverse logic transformation)
> using forest.rma.
>
> I have added the credibility interval.
>
> The forest plot is saved as a pdf.
>
> The dotted line and whiskers of the credibility interval are too faint.
>
> I need help on the argument(s) to widen the credibility interval dots and
> whiskers.
>
> I have looked at the forest.default function, but don't see anything obvious
> to me.
>
> Nathan
>
> --
> Nathan Pace, MD, MStat
> Department of Anesthesiology
> University of Utah
> 801.581.6393
> [hidden email]
>
> [[alternative HTML version deleted]]



*******************************************************************
This email and any attachments are confidential. Any use...{{dropped:8}}

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: metafor package

Wolfgang Viechtbauer-2
In reply to this post by Michael Dewey
Good advice already from Michael and S Ellison.

I must apologize for the 'hack-job of a function' called forest() in metafor. I realized a while ago that people would prefer more fine-grained control over the various elements of the plot (this has come up a few times before). I think Paul Murrell described the issue best in his R Journal article:

http://journal.r-project.org/archive/2012-2/RJournal_2012-2_Murrell.pdf

But it is what it is at this point.

I noticed the problem with the dotted line of the credibility interval myself a while back. In an updated version of the metafor package (to be released at some point in the near future), there will at least be the possibility to control the color of that line. Maybe also the line type (a dotted line is indeed often too faint).

You can try changing efac=2 (or something larger than 1) to at least make the whiskers longer.

Best,
Wolfgang

--  
Wolfgang Viechtbauer, Ph.D., Statistician  
Department of Psychiatry and Psychology  
School for Mental Health and Neuroscience  
Faculty of Health, Medicine, and Life Sciences  
Maastricht University, P.O. Box 616 (VIJV1)  
6200 MD Maastricht, The Netherlands  
+31 (43) 388-4170 | http://www.wvbauer.com   


> -----Original Message-----
> From: [hidden email] [mailto:[hidden email]]
> On Behalf Of Michael Dewey
> Sent: Wednesday, February 12, 2014 12:50
> To: Nathan Pace; [hidden email]
> Subject: Re: [R] metafor package
>
> At 22:11 11/02/2014, Nathan Pace wrote:
> >Hi,
> >
> >I have a random effects meta analysis of a proportion (logit
> >transformation) using rma.glmm.
> >
> >I have created a forest plot of the proportion (inverse logic
> >transformation) using forest.rma.
> >
> >I have added the credibility interval.
> >
> >The forest plot is saved as a pdf.
> >
> >The dotted line and whiskers of the credibility interval are too faint.
> >
> >I need help on the argument(s) to widen the credibility interval
> >dots and whiskers.
> >
> >I have looked at the forest.default function, but don't see anything
> >obvious to me.
>
> Dear Nathan
> I think you need to look at forest.rma. There is a fairly obvious
> section (search for addcred). If worst comes to worst you can always
> hack it and save as nathansforest.rma.
>
> >Nathan
> >
> >--
> >Nathan Pace, MD, MStat
> >Department of Anesthesiology
> >University of Utah
> >801.581.6393
> >[hidden email]
> >
> >         [[alternative HTML version deleted]]
>
> Michael Dewey
> [hidden email]
> http://www.aghmed.fsnet.co.uk/home.html

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: metafor package

S Ellison-2


> -----Original Message-----
> I must apologize for the 'hack-job of a function' called forest() in metafor.
Well, certainly no apology needed there!

> I realized a while ago that people would prefer more fine-grained control over
> the various elements of the plot (this has come up a few times before).
Ploting functions should ideally never have hard-coded defaults.
Having said that, it's an absolute pain to do anything else.

I've tinkered a fair bit with the problem in my own package, which for at least some plots tries to match graphical arguments in ... with those applicable to specific plotting functions so as to avoid the frequent 'duplicate parameters' or 'xxx is not a recognised parameter in <some_plotting_function>'

Another useful approach I've toyed with is to allow a list like this.special.line.pars=list(lwd=2, col=3, lty=2) to be provided, and then use do.call with functions like line, axis etc. That avoids a plot function full of things like like this.special.line.lwd, like this.special.line.col, like this.special.line.lty

But there's no really simple answer; at some point we have to give up and point out that if saomeone really wants that much control, they can always hack the code!

S Ellison


*******************************************************************
This email and any attachments are confidential. Any use...{{dropped:8}}

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: metafor package

NLPace
In reply to this post by Wolfgang Viechtbauer-2
I appreciate the several replies.

efac = 2 had already been set in the forest call.

Adding lwd = 2 in the forest call has improved the visibility of the
credibility interval.

Nathan



-----Original Message-----
From: "Viechtbauer Wolfgang   (STAT)"
<[hidden email]>
Date: Wednesday, February 12, 2014 at 6:39 AM
To: "[hidden email]" <[hidden email]>, "Nathan Leon Pace, MD,
MStat" <[hidden email]>, Michael Dewey <[hidden email]>, S
Ellison <[hidden email]>
Subject: RE: [R] metafor package

>Good advice already from Michael and S Ellison.
>
>I must apologize for the 'hack-job of a function' called forest() in
>metafor. I realized a while ago that people would prefer more
>fine-grained control over the various elements of the plot (this has come
>up a few times before). I think Paul Murrell described the issue best in
>his R Journal article:
>
>http://journal.r-project.org/archive/2012-2/RJournal_2012-2_Murrell.pdf
>
>But it is what it is at this point.
>
>I noticed the problem with the dotted line of the credibility interval
>myself a while back. In an updated version of the metafor package (to be
>released at some point in the near future), there will at least be the
>possibility to control the color of that line. Maybe also the line type
>(a dotted line is indeed often too faint).
>
>You can try changing efac=2 (or something larger than 1) to at least make
>the whiskers longer.
>
>Best,
>Wolfgang
>
>--  
>Wolfgang Viechtbauer, Ph.D., Statistician
>Department of Psychiatry and Psychology
>School for Mental Health and Neuroscience
>Faculty of Health, Medicine, and Life Sciences
>Maastricht University, P.O. Box 616 (VIJV1)
>6200 MD Maastricht, The Netherlands
>+31 (43) 388-4170 | http://www.wvbauer.com
>
>
>> -----Original Message-----
>> From: [hidden email] [mailto:[hidden email]]
>> On Behalf Of Michael Dewey
>> Sent: Wednesday, February 12, 2014 12:50
>> To: Nathan Pace; [hidden email]
>> Subject: Re: [R] metafor package
>>
>> At 22:11 11/02/2014, Nathan Pace wrote:
>> >Hi,
>> >
>> >I have a random effects meta analysis of a proportion (logit
>> >transformation) using rma.glmm.
>> >
>> >I have created a forest plot of the proportion (inverse logic
>> >transformation) using forest.rma.
>> >
>> >I have added the credibility interval.
>> >
>> >The forest plot is saved as a pdf.
>> >
>> >The dotted line and whiskers of the credibility interval are too faint.
>> >
>> >I need help on the argument(s) to widen the credibility interval
>> >dots and whiskers.
>> >
>> >I have looked at the forest.default function, but don't see anything
>> >obvious to me.
>>
>> Dear Nathan
>> I think you need to look at forest.rma. There is a fairly obvious
>> section (search for addcred). If worst comes to worst you can always
>> hack it and save as nathansforest.rma.
>>
>> >Nathan
>> >
>> >--
>> >Nathan Pace, MD, MStat
>> >Department of Anesthesiology
>> >University of Utah
>> >801.581.6393
>> >[hidden email]
>> >
>> >         [[alternative HTML version deleted]]
>>
>> Michael Dewey
>> [hidden email]
>> http://www.aghmed.fsnet.co.uk/home.html

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.