guido-s / meta

Official Git repository of R package meta
http://cran.r-project.org/web/packages/meta/index.html
GNU General Public License v2.0
82 stars 32 forks source link

Displaying mean and deviation (SD) in one column in metacont()/forest() functions #7

Closed wptmdoorn closed 6 years ago

wptmdoorn commented 6 years ago

Hi,

I have been looking through the API and internet for some hours now but I feel like I cannot find any satisfying answers. When we construct forest plots for a continuous measure (e.g. group mean) we use the metacont() -> forest() workflow. This will result (with correct alterations) in three columns showing the group size ('Total'), mean and SD for the control as well as experimental groups.

I was wondering: is it possible to put the mean and SD into one column representing it as; mean (± SD) such as 28.0 (± 1.2)?

Thank you for the help.

guido-s commented 6 years ago

I would do this the following way:

  1. Add a column with the (already formated) information to the dataset
  2. In forest.meta(), use argument 'leftcols' to add new columns to the forest plot (and argument 'leftlabs' to provide a label.

Please have a look at the R code for an example: forest14.txt

Best wishes, Guido