[R-meta] Duplicating the results of the metabin() function
Hi Sam, The discrepancy in your calculations can be explained as follows. By default, R function metabin() uses the Mantel-Haenszel method (argument 'method') under the fixed effect model. Accordingly, the fixed effect weights in 'w.fixed' come from the Mantel-Haenszel method. However, in order to calculate Cochran's Q, the fixed effect weights from the inverse variance method are used (which are different from the Mantel-Haenszel weights). You could use the following assignment in your code to calculate Q by hand: weights.fixed <- 1 / result$seTE^2 or weights.fixed <- update(result, method = "Inverse")$w.fixed Best wishes, Guido P.S. 'OR <- result$TE' should actually be 'lnOR <- result$TE' as metabin() stores the log odds ratio instead of the odds ratio.
Dr. Guido Schwarzer Institute of Medical Biometry and Statistics, Faculty of Medicine and Medical Center - University of Freiburg Postal address: Stefan-Meier-Str. 26, D-79104 Freiburg Phone: +49/761/203-6668 Mail: sc at imbi.uni-freiburg.de Homepage: http://www.imbi.uni-freiburg.de ORCID iD: https://orcid.org/0000-0001-6214-9087 R-book: https://www.springer.com/gp/book/9783319214153