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

`metacont` and `forest`: studies with available central tendency but not spread are not counted in `metacont$K` #26

Closed Rscho314 closed 4 years ago

Rscho314 commented 4 years ago

Using the forest function to plot results from metacont where a study has only central tendency but not spread (SD) available causes the plot to display the study with missing spread but excludes the last study from the plot. This is apparently caused by metacont not accounting for studies with missing spread in k.

Demo

Metacont with study causing the problem (Zuurbier 2008)

                          MD                95%-CI %W(fixed) %W(random)
haider 1984               NA                             0.0        0.0
lolley 1985               NA                             0.0        0.0
andel 1990                NA                             0.0        0.0
wistbacka 1992        0.0000 [ -28.1692;  28.1692]       0.5        3.6
boldt 1993                NA                             0.0        0.0
boldt 1993                NA                             0.0        0.0
brodin 1993               NA                             0.0        0.0
kjellman 2000             NA                             0.0        0.0
lindholm 2001             NA                             0.0        0.0
szabo 2001                NA                             0.0        0.0
bruemmer 2002             NA                             0.0        0.0
lell 2002             6.4000 [  -5.1944;  17.9944]       3.1       11.6
wallin 2003               NA                             0.0        0.0
visser 2005               NA                             0.0        0.0
quinn 2006                NA                             0.0        0.0
shim 2006             1.6000 [  -2.0946;   5.2946]      31.0       19.4
barcellos 2007            NA                             0.0        0.0
zuurbier 2008         1.6000                             0.0        0.0
shim 2013            -4.4000 [  -7.4852;  -1.3148]      44.4       19.8
laiq 2015                 NA                             0.0        0.0
ahmad 2017          -15.1000 [ -20.5008;  -9.6992]      14.5       17.9
oldfield 1986             NA                             0.0        0.0
girard 1992           1.0000 [-141.6784; 143.6784]       0.0        0.2
lazar 1997                NA                             0.0        0.0
tunerir 1998              NA                             0.0        0.0
besogul 1999              NA                             0.0        0.0
lazar 2000                NA                             0.0        0.0
lazar 2004                NA                             0.0        0.0
celkan 2006         -23.3500 [ -45.4665;  -1.2335]       0.9        5.3
koskenkari 2006           NA                             0.0        0.0
ranasinghe 2006           NA                             0.0        0.0
ranasinghe 2006           NA                             0.0        0.0
smith 2008                NA                             0.0        0.0
jovic 2009                NA                             0.0        0.0
jovic 2009                NA                             0.0        0.0
howell 2011               NA                             0.0        0.0
sato 2011                 NA                             0.0        0.0
foroughi 2012       -55.0000 [-110.0985;   0.0985]       0.1        1.1
rujirojindakul 2014       NA                             0.0        0.0
duncan 2015               NA                             0.0        0.0
roh 2015            -11.6000 [ -27.0141;   3.8141]       1.8        8.7
duncan 2018               NA                             0.0        0.0
ellenberger 2018      0.0000 [ -10.7662;  10.7662]       3.6       12.4
tsang 2007                NA                             0.0        0.0
zhao 2020                 NA                             0.0        0.0
straus 2013               NA                             0.0        0.0
seied 2010                NA                             0.0        0.0
wistbacka 1994            NA                             0.0        0.0
turkoz 2000               NA                             0.0        0.0

Number of studies combined: k = 10

                          MD              95%-CI     z p-value
Fixed effect model   -3.9303 [ -5.9863; -1.8743] -3.75  0.0002
Random effects model -5.3660 [-11.2840;  0.5521] -1.78  0.0755

Quantifying heterogeneity:
 tau^2 = 43.4641 [0.0000; >363.7533]; tau = 6.5927 [0.0000; >19.0723];
 I^2 = 75.0% [53.4%; 86.6%]; H = 2.00 [1.46; 2.73]

Test of heterogeneity:
     Q d.f.  p-value
 35.98    9 < 0.0001

Details on meta-analytical method:
- Inverse variance method
- DerSimonian-Laird estimator for tau^2
- Jackson method for confidence interval of tau^2 and tau

forest_ckmb

Metacont without study causing the problem (Zuurbier 2008)

                          MD                95%-CI %W(fixed) %W(random)
haider 1984               NA                             0.0        0.0
lolley 1985               NA                             0.0        0.0
andel 1990                NA                             0.0        0.0
wistbacka 1992        0.0000 [ -28.1692;  28.1692]       0.5        3.6
boldt 1993                NA                             0.0        0.0
boldt 1993                NA                             0.0        0.0
brodin 1993               NA                             0.0        0.0
kjellman 2000             NA                             0.0        0.0
lindholm 2001             NA                             0.0        0.0
szabo 2001                NA                             0.0        0.0
bruemmer 2002             NA                             0.0        0.0
lell 2002             6.4000 [  -5.1944;  17.9944]       3.1       11.6
wallin 2003               NA                             0.0        0.0
visser 2005               NA                             0.0        0.0
quinn 2006                NA                             0.0        0.0
shim 2006             1.6000 [  -2.0946;   5.2946]      31.0       19.4
barcellos 2007            NA                             0.0        0.0
zuurbier 2008             NA                             0.0        0.0
shim 2013            -4.4000 [  -7.4852;  -1.3148]      44.4       19.8
laiq 2015                 NA                             0.0        0.0
ahmad 2017          -15.1000 [ -20.5008;  -9.6992]      14.5       17.9
oldfield 1986             NA                             0.0        0.0
girard 1992           1.0000 [-141.6784; 143.6784]       0.0        0.2
lazar 1997                NA                             0.0        0.0
tunerir 1998              NA                             0.0        0.0
besogul 1999              NA                             0.0        0.0
lazar 2000                NA                             0.0        0.0
lazar 2004                NA                             0.0        0.0
celkan 2006         -23.3500 [ -45.4665;  -1.2335]       0.9        5.3
koskenkari 2006           NA                             0.0        0.0
ranasinghe 2006           NA                             0.0        0.0
ranasinghe 2006           NA                             0.0        0.0
smith 2008                NA                             0.0        0.0
jovic 2009                NA                             0.0        0.0
jovic 2009                NA                             0.0        0.0
howell 2011               NA                             0.0        0.0
sato 2011                 NA                             0.0        0.0
foroughi 2012       -55.0000 [-110.0985;   0.0985]       0.1        1.1
rujirojindakul 2014       NA                             0.0        0.0
duncan 2015               NA                             0.0        0.0
roh 2015            -11.6000 [ -27.0141;   3.8141]       1.8        8.7
duncan 2018               NA                             0.0        0.0
ellenberger 2018      0.0000 [ -10.7662;  10.7662]       3.6       12.4
tsang 2007                NA                             0.0        0.0
zhao 2020                 NA                             0.0        0.0
straus 2013               NA                             0.0        0.0
seied 2010                NA                             0.0        0.0
wistbacka 1994            NA                             0.0        0.0
turkoz 2000               NA                             0.0        0.0

Number of studies combined: k = 10

                          MD              95%-CI     z p-value
Fixed effect model   -3.9303 [ -5.9863; -1.8743] -3.75  0.0002
Random effects model -5.3660 [-11.2840;  0.5521] -1.78  0.0755

Quantifying heterogeneity:
 tau^2 = 43.4641 [0.0000; >363.7533]; tau = 6.5927 [0.0000; >19.0723];
 I^2 = 75.0% [53.4%; 86.6%]; H = 2.00 [1.46; 2.73]

Test of heterogeneity:
     Q d.f.  p-value
 35.98    9 < 0.0001

Details on meta-analytical method:
- Inverse variance method
- DerSimonian-Laird estimator for tau^2
- Jackson method for confidence interval of tau^2 and tau

forest_ckmb

In both cases, metacont results report k = 10.

You'll notice that removing central tendency data for zuurbier 2008 correctly removed zuurbier 2008 from the plot, but also allowed ellenberger 2018 to appear in the plot, while it was excluded before.

guido-s commented 4 years ago

I cannot reproduce the problem with the following R code:

m1 <- metacont(10 + 1:4, 1:4, c(1:2, NA, 4),
               10 + 1:4, 1:4, c(1:2, NA, 4))
m1
forest(m1)

m2 <- metacont(10 + c(1:4, NA), c(1:4, NA), c(1:2, NA, 4, NA),
               10 + c(1:4, NA), c(1:4, NA), c(1:2, NA, 4, NA))
m2
forest(m2)

Which R code are you using to generate the forest plot?

BTW, k is the number of studies contributing data to the meta-analysis which is 10 in both your examples.

Rscho314 commented 4 years ago

The behaviour seems to appear by setting allstudies = F in forest in my code. Sorry, I should absolutely have mentioned that!

BTW, k is the number of studies contributing data to the meta-analysis which is 10 in both your examples.

Indeed, that was what I meant. In metacont, k does not seem to account for the study with only central tendency and forest seems to always display k studies when using allstudies = F, therefore missing the last one.

So this exhibits the behaviour I described:

m1 <- metacont(10 + 1:4, 1:4, c(1:2, NA, 4),
10 + 1:4, 1:4, c(1:2, NA, 4))
forest(m1, allstudies = F)  # yields Warning Message: In forest.meta(m1, allstudies = F) : n.stud != sum(sel)
m2 <- metacont(10 + 1:4, c(1:2, NA, 4), c(1:2, NA, 4),
10 + 1:4, c(1:2, NA, 4), c(1:2, NA, 4))
forest(m2, allstudies = F)

forest(m1, allstudies = F) does not display study 4.

Perhaps this is intended and I am misunderstanding?

guido-s commented 4 years ago

Thank you for pointing out this bug (and the example R code).