# How to add error bar plots into a parameter table?

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

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?

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))


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

• Thank you! I'd like to upvote but don't have enough reputation. It precisely solved my problem. May 6, 2020 at 2:36
• you're welcome :) May 6, 2020 at 12:14
• 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.
– whuber
May 6, 2020 at 12:31
• Good point @whuber, I updated the post, it was a too simplified example. May 6, 2020 at 14:36