1
votes
library(meta)
m1 <- metaprop(4:1, c(10, 20, 30, 40))
m2 <- update(m1, sm="PAS")
m3 <- update(m1, sm="PRAW")
m4 <- update(m1, sm="PLN")
m5 <- update(m1, sm="PFT")
#
forest(m5)

enter image description here I have a simple example here, and I want to extract the random estimate of the effect and its corresponding 95% CI (i.e. 0.11[ 0.01; 0.26] as shown in the picture).

I used names(m5) to see a list of values. And I've tried m5$lower.random in hopes of getting the lower CI bound for the random effects model, but the returned value is 0.1837517 instead of 0.01, which is what's presented in the forest plot.

2

2 Answers

1
votes

To calculate the proportion estimated by the random effects models (with 95% confidence intervals), the m5$TE.random, m5$lower.random and m5$upper.random values need to be backtransformed according to the sm option specified in metaprop.
Let consider a first case where the logit transformation was chosen to calculate an overall proportion:

library(meta) 
m1 <- metaprop(4:1, c(10, 20, 30, 40), sm="PLOGIT")
summary(m1)

################
Number of studies combined: k = 4

                     proportion           95%-CI  z  p-value
Fixed effect model       0.1439 [0.0769; 0.2533] --       --
Random effects model     0.1214 [0.0373; 0.3306] --       --

Quantifying heterogeneity:
 tau^2 = 1.1288; H = 1.77 [1.04; 3.01]; I^2 = 68.0% [7.1%; 89.0%]

Test of heterogeneity:
    Q d.f.  p-value
 9.38    3   0.0247

Details on meta-analytical method:
- Inverse variance method
- DerSimonian-Laird estimator for tau^2
- Logit transformation
- Clopper-Pearson confidence interval for individual studies

    (random.est1 <- c(m1$TE.random,m1$lower.random,m1$upper.random))
    meta:::backtransf(random.est1, sm="PLOGIT")
    meta:::logit2p(random.est1)
################

We extract from m1 the trasformed values of the random effect model:

(random.est1 <- c(m1$TE.random,m1$lower.random,m1$upper.random))

###############
[1] -1.9788316 -3.2521123 -0.7055509

and then we backtransform using the meta:::backtransf function of meta

meta:::backtransf(random.est1, sm="PLOGIT")
#######
[1] 0.12144344 0.03725106 0.33058266

or directly the logit backtransformation logit2p:

meta:::logit2p(random.est1)
#######
[1] 0.12144344 0.03725106 0.33058266

which is equivalent to:

plogis(random.est1)
#######
[1] 0.12144344 0.03725106 0.33058266

Now we consider a second example using the Freeman-Tukey Double arcsine transformation:

m2 <- metaprop(4:1, c(10, 20, 30, 40), sm="PFT")
summary(m2)

###################
Number of studies combined: k = 4

                     proportion           95%-CI  z  p-value
Fixed effect model       0.0775 [0.0272; 0.1449] --       --
Random effects model     0.1093 [0.0138; 0.2589] --       --

Quantifying heterogeneity:
 tau^2 = 0.0229; H = 1.78 [1.05; 3.04]; I^2 = 68.6% [9.1%; 89.2%]

Test of heterogeneity:
    Q d.f.  p-value
 9.56    3   0.0227

Details on meta-analytical method:
- Inverse variance method
- DerSimonian-Laird estimator for tau^2
- Freeman-Tukey double arcsine transformation
- Clopper-Pearson confidence interval for individual studies
###################

Using the backtrasformation we get

random.est2 <- c(m2$TE.random,m2$lower.random,m2$upper.random)
unlist(lapply(random.est2, meta:::backtransf,  sm="PFT", n=1/mean(1/m2$n)))
########
[1] 0.10932841 0.01376599 0.25889792

unlist(lapply(random.est2, meta:::asin2p,  n=1/mean(1/m2$n))) 
##########
[1] 0.10932841 0.01376599 0.25889792
0
votes

The 95%-CI's are delivered by the summary.meta function:

summary(m5)
Number of studies combined: k = 4

                     proportion           95%-CI  z  p-value
Fixed effect model       0.0775 [0.0272; 0.1449] --       --
Random effects model     0.1093 [0.0138; 0.2589] --       --

Quantifying heterogeneity:
 tau^2 = 0.0229; H = 1.78 [1.05; 3.04]; I^2 = 68.6% [9.1%; 89.2%]

Test of heterogeneity:
    Q d.f.  p-value
 9.56    3   0.0227

Details on meta-analytical method:
- Inverse variance method
- DerSimonian-Laird estimator for tau^2
- Freeman-Tukey double arcsine transformation
- Clopper-Pearson confidence interval for individual studies

It's fairly common to find that "mysterious values" in the output displayed at the console (or in this case in the graphical output) are actually not a part of a complex object, but are instead calculated by one (or more) of print.<class>, plot.<class>, or a summary.<class> functions associated with one of the classes of the object. In this case I first looked at the help pages (where I found nothing useful) and then at the code for getAnywhere(print.metaprop) and getting nothing then used m5's second class with getAnywhere(print.meta) and then saw a summary function being used.