Skip to content
Back to formatted view

Raw Message

Message-ID: <9e6352ef-26e9-28ab-5a79-27784710d892@imbi.uni-freiburg.de>
Date: 2019-09-30T17:31:24Z
From: Guido Schwarzer
Subject: [R-meta] Duplicating the results of the metabin() function
In-Reply-To: <CALJFG-S6HwbtQki7_px546Mjk8dhEQOYTN0iCWAaCprws_=zpg@mail.gmail.com>

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