Introduction to the pimeta package

Kengo Nagashima

2019-03-11

The pimeta package is easy. Load your data and then pass it the pima function!

require("pimeta")
## Loading required package: pimeta
data(sbp, package = "pimeta")

# a parametric bootstrap prediction interval
out <- pima(
  y        = sbp$y,      # effect size estimates
  se       = sbp$sigmak, # within studies standard errors
  B        = 25000,      # number of bootstrap samples
  seed     = 14142135,   # random number seed
  parallel = 4           # multi-threading     
)
out
## 
## Prediction & Confidence Intervals for Random-Effects Meta-Analysis
## 
## A parametric bootstrap prediction and confidence intervals
##  Heterogeneity variance: DerSimonian-Laird
##  Variance for average treatment effect: Hartung (Hartung-Knapp)
## 
## No. of studies: 10
## 
## Average treatment effect [95% prediction interval]:
##  -0.3341 [-0.8807, 0.2240]
##  d.f.: 9
## 
## Average treatment effect [95% confidence interval]:
##  -0.3341 [-0.5613, -0.0985]
##  d.f.: 9
## 
## Heterogeneity measure
##  tau-squared: 0.0282
##  I-squared:  70.5%
plot(out, base_size = 10, studylabel = sbp$label)

Several type of methods are supported.

# Higgins-Thompson-Spiegelhalter prediction interval
pima(sbp$y, sbp$sigmak, method = "HTS")
## 
## Prediction & Confidence Intervals for Random-Effects Meta-Analysis
## 
## Higgins-Thompson-Spiegelhalter prediction and confidence intervals
##  Heterogeneity variance: DerSimonian-Laird
##  Variance for average treatment effect: approximate
## 
## No. of studies: 10
## 
## Average treatment effect [95% prediction interval]:
##  -0.3341 [-0.7598, 0.0917]
##  d.f.: 8
## 
## Average treatment effect [95% confidence interval]:
##  -0.3341 [-0.5068, -0.1613]
##  d.f.: 9
## 
## Heterogeneity measure
##  tau-squared: 0.0282
##  I-squared:  70.5%
# Partlett-Riley prediction interval (Hartung and Knapp's variance)
pima(sbp$y, sbp$sigmak, method = "HK")
## 
## Prediction & Confidence Intervals for Random-Effects Meta-Analysis
## 
## Partlett-Riley prediction and confidence intervals
##  Heterogeneity variance: REML
##  Variance for average treatment effect: Hartung (Hartung-Knapp)
## 
## No. of studies: 10
## 
## Average treatment effect [95% prediction interval]:
##  -0.3287 [-0.9887, 0.3312]
##  d.f.: 8
## 
## Average treatment effect [95% confidence interval]:
##  -0.3287 [-0.5761, -0.0814]
##  d.f.: 9
## 
## Heterogeneity measure
##  tau-squared: 0.0700
##  I-squared:  85.5%
# Partlett-Riley prediction interval (Sidik and Jonkman's variance)
pima(sbp$y, sbp$sigmak, method = "SJ")
## 
## Prediction & Confidence Intervals for Random-Effects Meta-Analysis
## 
## Partlett-Riley prediction and confidence intervals
##  Heterogeneity variance: REML
##  Variance for average treatment effect: bias corrected Sidik-Jonkman
## 
## No. of studies: 10
## 
## Average treatment effect [95% prediction interval]:
##  -0.3287 [-0.9835, 0.3261]
##  d.f.: 8
## 
## Average treatment effect [95% confidence interval]:
##  -0.3287 [-0.5625, -0.0950]
##  d.f.: 9
## 
## Heterogeneity measure
##  tau-squared: 0.0700
##  I-squared:  85.5%
# Partlett-Riley prediction interval (Kenward and Roger's variance)
pima(sbp$y, sbp$sigmak, method = "KR")
## 
## Prediction & Confidence Intervals for Random-Effects Meta-Analysis
## 
## Partlett-Riley prediction and confidence intervals
##  Heterogeneity variance: REML
##  Variance for average treatment effect: Kenward-Roger
## 
## No. of studies: 10
## 
## Average treatment effect [95% prediction interval]:
##  -0.3287 [-1.0280, 0.3706]
##  d.f.: 5.9508
## 
## Average treatment effect [95% confidence interval]:
##  -0.3287 [-0.5815, -0.0759]
##  d.f.: 6.9508
## 
## Heterogeneity measure
##  tau-squared: 0.0700
##  I-squared:  85.5%

The convert_bin() function converts binary outcome data to effect size estimates and within studies standard errors vectors. A data set of 13 placebo-controlled trials with cisapride that was reported by Hartung and Knapp (Stat Med., 2001, doi:10.1002/sim.1009) was analyzed below.

m1 <- c(15,12,29,42,14,44,14,29,10,17,38,19,21)
n1 <- c(16,16,34,56,22,54,17,58,14,26,44,29,38)
m2 <- c( 9, 1,18,31, 6,17, 7,23, 3, 6,12,22,19)
n2 <- c(16,16,34,56,22,55,15,58,15,27,45,30,38)
dat <- convert_bin(m1, n1, m2, n2, type = "logOR")
dat
##             y        se
## 1   2.0989861 0.9847737
## 2   3.3570262 1.0165653
## 3   1.5652318 0.5747840
## 4   0.8640463 0.4042977
## 5   1.4656407 0.6332968
## 6   2.2325713 0.4481371
## 7   1.5465488 0.7782417
## 8   0.4125323 0.3721812
## 9   2.1202635 0.8265438
## 10  1.8071598 0.6022988
## 11  2.7646729 0.5382109
## 12 -0.3544099 0.5555283
## 13  0.2058521 0.4541130
pibin <- pima(dat$y, dat$se, seed = 2236067, parallel = 4)
pibin
## 
## Prediction & Confidence Intervals for Random-Effects Meta-Analysis
## 
## A parametric bootstrap prediction and confidence intervals
##  Heterogeneity variance: DerSimonian-Laird
##  Variance for average treatment effect: Hartung (Hartung-Knapp)
## 
## No. of studies: 13
## 
## Average treatment effect [95% prediction interval]:
##  1.4209 [-0.6283, 3.5173]
##  d.f.: 12
## 
## Average treatment effect [95% confidence interval]:
##  1.4209 [0.7992, 2.0567]
##  d.f.: 12
## 
## Heterogeneity measure
##  tau-squared: 0.7176
##  I-squared:  69.9%
binlabel <- c(
   "Creytens", "Milo", "Francois and De Nutte", "Deruyttere et al.",
   "Hannon", "Roesch", "De Nutte et al.", "Hausken and Bestad",
   "Chung", "Van Outryve et al.", "Al-Quorain et al.", "Kellow et al.",
   "Yeoh et al.")
plot(pibin, digits = 2, base_size = 10, studylabel = binlabel)