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

Possibly bug in metabind #21

Closed fmmattioni closed 4 years ago

fmmattioni commented 4 years ago

I have noticed that metabind is checking whether the meta-analysis objects have the same arguments. Possibly here:

https://github.com/guido-s/meta/blob/492c5add580a3f24b8be3276c59b60df77a750b2/R/metabind.R#L495-L501

However, the problem is that arguments like warn do not influence the calculations and still are being considered in this check.

warn     A logical indicating whether warnings should be printed (e.g., if studies are excluded from meta-analysis due to zero standard deviations).

reprex:

library(meta)
#> Loading 'meta' package (version 4.11-1).
#> Type 'help(meta)' for a brief overview.

data(Fleiss93cont)

Fleiss93cont$age <- c(55, 65, 55, 65, 55)

Fleiss93cont$region <- c("Europe", "Europe", "Asia", "Asia", "Europe")

m1 <- metacont(n.e, mean.e, sd.e, n.c, mean.c, sd.c, data = Fleiss93cont, sm = "MD")

mu1 <- update(m1, byvar = age, bylab = "Age group", warn = TRUE)
mu2 <- update(m1, byvar = region, bylab = "Region", warn = FALSE)

metabind(mu1, mu2)
#> Error in metabind(mu1, mu2): All meta-analyses must use the same basic settings which differ for the following argument: 'warn'

Created on 2020-02-20 by the reprex package (v0.3.0)

Any thoughts on this?

guido-s commented 4 years ago

Thank you for pointing out this bug. I have removed the arguments warn and prediction from these checks.