Learn R Programming

mmeta (version 2.4)

multipletables: Exact posterior inference based on multiple 2x2 tables

Description

This function conducts exact posterior inference based on multiple 2x2 tables.

Usage

multipletables(data=NULL, measure=NULL, model="Sarmanov",
                           method="sampling", nsam=10000, alpha=0.05)

Value

An object is returned, inheriting from class multipletables. Objects of this class have methods for the generic functions summary and plot. The following components must be included in a legitimate multipletables object.

measure

the value of measure argument.

model

the value of model argument.

method

the value of method argument.

dataset

a data matrix with rows being y1, n1, y2, and n2.

studynames

a character string indicating all the study names

measurename

a character string specifying the full names of value of measure argument. Can be Odds Ratio, Relative Risk, and Risk Difference.

alpha

the value of alpha argument.

chi2

the chi-square test statistics of the likelihood ratio test

pvalue

the p-value of the likelihood ratio test

MLE

a numeric vector of the estimated hyperparameters in the following order: a1, b1, a2, b2, rho.

cov.matrix

the estimated covariance matrix of the estimated parameters in the transformed scales

hessian

the estimated hessian matrix of the estimated parameters in the transformed scales

overall

a list of two components that contain the overall measure (e.g., overall OR) and its 95% equal-tail credible interval.

sample

a list of length the number of studies with components numerical vectors of the samples of the each study-specific measure.

density

a list of length the number of studies with components lists of density of each study-specific measure.

dataset

a numeric vector of input data with components: y1, n1, y2, n2

parameter

a numeric vector specifying the hyperparameters with components a1, b1, a2, b2, and rho.

alpha

a numeric value specifying the significant level. Default value sets to 0.05.

sample

a list of samples for the posterior and prior distributions

density

a list of the density of the posterior and prior distributions

studynames

a character vector being "Posterior" and "Prior".

Arguments

data

a data frame that contains y1, n1, y2, n2, studynames. See details

measure

a character string specifying a measure. Options are OR, RR, and RD. OR is odds ratio, RR is relative risk, and RD is risk difference.

model

a character string specifying the model. Options are Independent and Sarmanov. Independent is independent beta-binomial model. Sarmanovis Sarmanov beta-binomial model.

method

a character string specifying the method. Options are exact and sampling. sampling (default) is a method based on Monte Carlo sampling. exact is exact method.

alpha

a numeric value specifying the significant level. Default value sets to 0.05.

nsam

a numeric value specifying the number of samples if method is sampling. Default value sets to 10000

Details

There are two kinds of study design, i.e., prospective study or clinical trial, and retrospective or case-control study. In a prospective study or clinical trial, data is a data frame that contains y1, n1, y2, n2, studynames. y1 is the number of subjects experienced a certain event in the unexposed group. n1 is the number of subjects in the unexposed group. y2 is the number of subjects experienced a certain event in the exposed group. n2 is the number of subjects in the exposed group. In this study, OR is odds ratio of event comparing exposed group with unexposed group. RR is relative risk of event comparing exposed group with unexposed group. RD is risk difference of event comparing exposed group with unexposed group.

For case-control study, y1 is the number of subjects with exposure in the control group. n1 is the number of subjects in the control group. y2 is the number of subjects with exposure in the case group. n2 is the number of subjects in the case group. In this study, OR is odds ratio of event comparing case group with control group. RR is relative risk of event comparing case group with control group. RD is risk difference of event comparing case group with control group.

Empirical Bayes method is used to maximize the marginal likelihood combining all studies to obtained the estimates of the hyperparameters a1, b1, a2, b2, and rho. When method="independent", only the estimated hyperparameters of a1, b1, a2, and b2 are used. When model="Sarmanov", rho is subject to constraints. See Chen et al (2011) for details.

The output cov.matrix and hessian are the estimated covariance matrix and hessian matrix of the estimated parameters in the transformed scales. The estimated parameters are log(a1), log(b1), log(a2), log(b2), omega, where the correlation coefficient rho is a function of a1, b1, a2, b2, and omega. Please see details on page 7 of Chen et al (2012 b).

References

Luo, S., Chen, Y., Su, X., Chu, H., (2014). mmeta: An R Package for Multivariate Meta-Analysis.
Journal of Statistical Software, 56(11), 1-26.
<https://dukespace.lib.duke.edu/dspace/bitstream/handle/10161/15522/2014Luo_Chen_Su_Chu_JSS_mmeta.pdf?sequence=1>

Chen, Y., Luo, S., (2011a). A Few Remarks on "Statistical Distribution of the Difference of Two Proportions' by Nadarajah and Kotz, Statistics in Medicine 2007; 26(18):3518-3523".
Statistics in Medicine, 30(15), 1913-1915.
<doi:10.1002/sim.4248>

Chen, Y., Chu, H., Luo, S., Nie, L., and Chen, S. (2014a). Bayesian analysis on meta-analysis of case-control studies accounting for within-study correlation.
Statistical Methods in Medical Research, 4.6 (2015): 836-855.
<https://doi.org/10.1177/0962280211430889>.

Chen, Y., Luo, S., Chu, H., Su, X., and Nie, L. (2014b). An empirical Bayes method for multivariate meta-analysis with an application in clinical trials.
Communication in Statistics: Theory and Methods, 43.16 (2014): 3536-3551.
<https://doi.org/10.1080/03610926.2012.700379>.

Chen, Y., Luo, S., Chu, H., Wei, P. (2013). Bayesian inference on risk differences: an application to multivariate meta-analysis of adverse events in clinical trials.
Statistics in Biopharmaceutical Research, 5(2), 142-155.
<https://doi.org/10.1080/19466315.2013.791483>.

See Also

plot.multipletables summary.multipletables

Examples

Run this code
# \donttest{
library(mmeta)
#Analyze the dataset colorectal to conduct exact inference of the odds ratios
data(colorectal)
multiple.OR <- multipletables(data=colorectal, measure="OR",
 model="Sarmanov", method="exact")
summary(multiple.OR)
# Generate the forest plot with 95% CIs of study-specific odds ratios
# and 95% CI of overall odds ratio
plot(multiple.OR, type="forest", addline=1)
# Plot the posterior density functions of some target studies
# in an overlaying manner
plot(multiple.OR, type="overlap", select=c(4,14,16,20))
# Plot the posterior density functions of some target studies in a
#side-by-side manner 
plot(multiple.OR, type="sidebyside", select=c(4,14,16,20), ylim=c(0,2.7),
 xlim=c(0.5,1.5))

# Analyze the dataset withdrawal to conduct inference of the relative risks
data(withdrawal)
multiple.RR <- multipletables(data=withdrawal, measure="RR", model="Sarmanov")
summary(multiple.RR)
plot(multiple.RR, type="forest", addline=1)
plot(multiple.RR, type="overlap", select=c(3,8,14,16))
plot(multiple.RR, type="sidebyside", select=c(3,8,14,16), 
ylim=c(0,1.2), xlim=c(0.4,3))

# Analyze the dataset withdrawal to conduct inference of the risk differences
data(withdrawal)
multiple.RD <- multipletables(data=withdrawal, measure="RD", model="Sarmanov")
summary(multiple.RD)
plot(multiple.RD, type="forest", addline=0)
plot(multiple.RD, type="overlap", select=c(3,8,14,16))
plot(multiple.RD, type="sidebyside", select=c(3,8,14,16))
plot(multiple.RD, type="sidebyside", select=c(3,8,14,16), 
      ylim=c(0,6), xlim=c(-0.2,0.4))
# }

Run the code above in your browser using DataLab