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

R version 4.2.2 meta package 6.0.0 forestmeta() sortvar command to sort studies according to weight is possible? #47

Closed marcelo-reategui-diaz closed 1 year ago

marcelo-reategui-diaz commented 1 year ago

Hi! We are conducting a systematic review and we have used your package for doing our meta-analysis. Now, we are struggling to sort the studies in the images by weights. We already try using sortvar command, but we could not find the exact way to order descendingly by the calculated weights. We will appreciate if you could clarify this.

Kind Regards, Marcelo Reategui

guido-s commented 1 year ago

Hi Marcelo, Here is an example to sort by increasing / decreasing weight under the common effect model:

m <- metagen(rep(1, 5), c(1, 5, 2, 4, 3) / 5)
forest(m, sortvar = w.common) # increasing weight
forest(m, sortvar = -w.common) # decreasing weight

Use w.random to sort by weights under the random effects model. Best, Guido