[R-meta] logarithmic scale in forest plot
Michael Dewey
||@t@ @end|ng |rom dewey@myzen@co@uk
Wed Mar 4 16:46:47 CET 2020
Dear Antonia
You are forming the confidence interval for the odds ratio as plus and
minus a multiple of its standard error. It would be much, much, much
better to use the log odds ratio scale assuming you either have or can
obtain the corresponding standard errors (which are not the log of the
standard errors you have). Then you can make the plot using the
transformation parameters outlined in the documentation.
As it stands I am afraid your confidence intervals range below zero
which is impossible for an odds ratio so your plot is quite off-target.
Michael
On 04/03/2020 14:37, Antonia Sudkaemper wrote:
> Dear Metafor Community,
>
> I hope this email finds you well.
>
> I have a question regarding the metafor package. I made a forest plot using
> the code below. I have received feedback that, as the forest plot shows
> odds ratios I should use a log scale for the x axis rather than a linear
> scale, so that the CIs are symmetric around the natural log OR. I am not
> sure how I would achieve that? Could you help me out, please? I would much
> appreciate it.
>
> All the best, Antonia
>
> #race/ethnicity
> oddsratio = c(2.07, 0.90, 1.00, 0.82, 2.25, 0.92)
> sei <- c(.43, .32, .66, .50, .70, .44)
> ci.lb <- oddsratio - 1.96*sei
> ci.ub <- oddsratio + 1.96*sei
> study<-c("Aelenei et al., 2019", "Kulich et al., 2019a", "Kulich et al.,
> 2006a", "Kulich et al., 2006b", "Ryan & Haslam, 2004a", "Ryan & Haslam,
> 2004b")
> labels<-c(-2, 0, 2, 4, 6, 8)
>
> forest(oddsratio, ci.lb=ci.lb, ci.ub=ci.ub, showweights=TRUE, refline=1,
> xlab
> = "Odds Ratio", slab=study, alim = c(-2,8), xlim=c(-14,15),
> at=labels, cex =
> 0.9, ylim=c(-2,27))
> addpoly(x = 1.16, ci.lb=0.69, ci.ub=1.95)
>
>
--
Michael
http://www.dewey.myzen.co.uk/home.html
More information about the R-sig-meta-analysis
mailing list