# The metafor Package

A Meta-Analysis Package for R

### Site Tools

tips:comp_mh_different_software

# Differences

This shows you the differences between two versions of the page.

 tips:comp_mh_different_software [2018/12/08 10:57]Wolfgang Viechtbauer tips:comp_mh_different_software [2019/05/05 16:21]Wolfgang Viechtbauer Both sides previous revision Previous revision 2019/05/05 16:21 Wolfgang Viechtbauer 2018/12/08 10:57 Wolfgang Viechtbauer 2016/03/12 13:55 Wolfgang Viechtbauer 2014/12/29 15:56 Wolfgang Viechtbauer 2014/09/08 14:56 Wolfgang Viechtbauer 2014/09/08 14:49 Wolfgang Viechtbauer created 2019/05/05 16:21 Wolfgang Viechtbauer 2018/12/08 10:57 Wolfgang Viechtbauer 2016/03/12 13:55 Wolfgang Viechtbauer 2014/12/29 15:56 Wolfgang Viechtbauer 2014/09/08 14:56 Wolfgang Viechtbauer 2014/09/08 14:49 Wolfgang Viechtbauer created Line 121: Line 121: The results differ because studies with zero cases in either group are handled by default in a different way in metafor compared to Stata, RevMan, and CMA. To understand this better, note that the Mantel-Haenszel method itself does not require the calculation of the observed outcomes of the individual studies (in the present example, the observed (log) odds ratios of the $k$ studies) and instead directly makes use of the 2×2 table counts. Zero cells are not a problem (except in some extreme cases, such as when there are zero cases in one or both groups across all of the 2×2 tables). Therefore, it is unnecessary to add some constant to the cell counts of a study with zero cases in either group. However, both Stata, RevMan, and CMA apply an adjustment (often called a continuity correction) to the cell counts in such studies (but studies with zero cases in both groups are dropped/​excluded from the method). In particular, ''​1/​2''​ is added to each of the cells of the 2×2 table in such studies before applying the Mantel-Haenszel method. The results differ because studies with zero cases in either group are handled by default in a different way in metafor compared to Stata, RevMan, and CMA. To understand this better, note that the Mantel-Haenszel method itself does not require the calculation of the observed outcomes of the individual studies (in the present example, the observed (log) odds ratios of the $k$ studies) and instead directly makes use of the 2×2 table counts. Zero cells are not a problem (except in some extreme cases, such as when there are zero cases in one or both groups across all of the 2×2 tables). Therefore, it is unnecessary to add some constant to the cell counts of a study with zero cases in either group. However, both Stata, RevMan, and CMA apply an adjustment (often called a continuity correction) to the cell counts in such studies (but studies with zero cases in both groups are dropped/​excluded from the method). In particular, ''​1/​2''​ is added to each of the cells of the 2×2 table in such studies before applying the Mantel-Haenszel method. - By default, metafor uses the same adjustment when calculating the observed outcomes (the observed log odds ratios) of the $k$ studies (here, zero cells can be problematic,​ so adding a constant value to the cell counts ensures that all $k$ values can be calculated). Also, similarly, studies with zero cases in both groups are automatically dropped/​excluded. However, when applying the Mantel-Haenszel method, no adjustment to the cell counts is made, since this is not necessary (and in fact can increase the bias in the Mantel-Haenszel method -- see Bradburn et al., 2007). + By default, metafor uses this adjustment when calculating the observed outcomes (the observed log odds ratios) of the $k$ studies (here, zero cells can be problematic,​ so adding a constant value to the cell counts ensures that all $k$ values can be calculated). Also, similarly, studies with zero cases in both groups are automatically dropped/​excluded. However, when applying the Mantel-Haenszel method, no adjustment to the cell counts is made, since this is not necessary (and in fact can increase the bias in the Mantel-Haenszel method -- see Bradburn et al., 2007). We can, however, adjust the settings, so that metafor also applies the cell count adjustment, not only when calculating the observed outcomes, but also when carrying out the computations of the Mantel-Haenszel method. For this, we have to adjust the defaults of the ''​add'',​ ''​to'',​ and ''​drop00''​ arguments (see the documentation of the ''​escalc()''​ and ''​rma.mh()''​ functions for further details). In particular, we could use: We can, however, adjust the settings, so that metafor also applies the cell count adjustment, not only when calculating the observed outcomes, but also when carrying out the computations of the Mantel-Haenszel method. For this, we have to adjust the defaults of the ''​add'',​ ''​to'',​ and ''​drop00''​ arguments (see the documentation of the ''​escalc()''​ and ''​rma.mh()''​ functions for further details). In particular, we could use: