3
$\begingroup$

I saw a very neat and clear table in this paper https://link.springer.com/article/10.3758/s13421-018-0797-5:enter image description here

As shown above, the authors added error bars of parameter estimates into a table, which makes the essentials obvious and straightforward. Suppose I have a similar data shown above, how can I make one for myself? Does any software package out there just do the job?

$\endgroup$
7
$\begingroup$

It's called a forest plot, you can download the r package. It's about getting the data into the right format required by the plot. We can use a dataset from metafor, calculate the odds ratio, and include it together with 95% confidence interval as one of the columns:

library(forestplot)
library(broom)

data = metafor::dat.bcg
res = apply(data[,c("tpos","tneg","cpos","cneg")],
1,function(i)tidy(fisher.test(matrix(i,ncol=2,byrow=TRUE))) )

res = do.call(rbind,res)[,1:4]

naming = list(
       "study"=paste(data$author,data$year),
        "odds ratio[95% CI]" = paste(round(res$estimate,digits=2),
        "[",
        round(res$conf.low,digits=2),"-",
        round(res$conf.high,digits=2),"]")
          )

forestplot(labeltext = naming,
           mean = log(res$estimate), upper = log(res$conf.high),
           lower = log(res$conf.low))

enter image description here

The example you showed, i think it's putting together quite a few forestplot which might require more effort. You can also check out this book example

$\endgroup$
4
  • $\begingroup$ Thank you! I'd like to upvote but don't have enough reputation. It precisely solved my problem. $\endgroup$
    – LI Bing
    May 6 '20 at 2:36
  • $\begingroup$ you're welcome :) $\endgroup$
    – StupidWolf
    May 6 '20 at 12:14
  • 3
    $\begingroup$ You have posted what many (perhaps most) people would call a "high-low-close" plot, such as the one offered in Excel. I believe what makes something a "forest plot" is that this graphic is integrated with the table of estimates and confidence intervals. See the first line of the Wikipedia article referenced in your first link. $\endgroup$
    – whuber
    May 6 '20 at 12:31
  • 1
    $\begingroup$ Good point @whuber, I updated the post, it was a too simplified example. $\endgroup$
    – StupidWolf
    May 6 '20 at 14:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.