[R] refline in forest() {metafor}
johnwilliams at fas.harvard.edu
johnwilliams at fas.harvard.edu
Thu Dec 12 09:50:31 CET 2013
I would like another line, and the solution below will work great. Thank you.
- John
Quoting "Viechtbauer Wolfgang (STAT)"
<wolfgang.viechtbauer at maastrichtuniversity.nl>:
> Regarding your question: Do you want *another* line or do you just want to
> move the reference line to the value of the summary estimate? The latter can
> be done by passing the value of the summary estimate to the 'refline'
> argument. If you want another line, you could just use the abline function,
> or, for finer control, the segments function. Something like:
>
> segments(coef(res), 0, coef(res), res$k, lty="dashed")
>
> where 'res' is the name of the fitted model object. You may have to play
> around with the 0 and res$k values, so that the line has the 'correct'
> length.
>
> Thanks for the positive feedback about the package.
>
> 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
> ________________________________________
> From: r-help-bounces at r-project.org [r-help-bounces at r-project.org] On Behalf
> Of johnwilliams at fas.harvard.edu [johnwilliams at fas.harvard.edu]
> Sent: Thursday, December 12, 2013 6:49 AM
> To: r-help at r-project.org
> Subject: [R] refline in forest() {metafor}
>
> Hello all,
>
> I am using forest.rma to plot a random effects model meta-analysis. I noticed
> that refline sets a vertical line indicating the null hypothesis.
>
> Is there a way to draw another vertical line, possibly dashed, centered on
> the
> summary estimate?
>
> Prof. Viechtbauer, if you happen to read this, I'd like to thank you for
> making
> an excellent package. I have been using the metafor package to do my first
> meta-analysis, having never used R before. The documentation is thorough and
> intuitive.
>
> Thanks,
>
> John
>
> John Williams
> ALB Candidate
> Harvard University Extension School
> johnwilliams at fas.harvard.edu
>
> ______________________________________________
> R-help at r-project.org 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.
More information about the R-help
mailing list