Learn R Programming

mmeta (version 2.4)

singletable: Exact posterior inference based on a single 2x2 table

Description

This function conducts exact posterior inference based on a single 2x2 table.

Usage

singletable(y1=y1,n1=n1,y2=y2,n2=n2,measure=measure,model="Sarmanov",
                        method="exact",a1=0.5,b1=0.5,a2=0.5,b2=0.5,rho=0,alpha=0.05,
                        nsam=10000)

Value

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

measure

the value of measure argument.

model

the value of model argument.

method

the value of method argument.

dataset

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

parameter

a numeric vector of the hyperparameters: a1, b1, a2, b2, and rho.

alpha

the value of alpha argument.

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 specifying the study names.

Arguments

y1

an integer indicating the number of events in group 1

n1

an integer indicating the total number of subjects in group 1

y2

an integer indicating the number of events in group 2

n2

an integer indicating the total number of subjects in group 2

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. exact (default) is a method based on Monte Carlo sampling. exact is exact method.

a1

a numeric value specifying the first hyperparameter of the beta prior for group 1. Default value set to 0.5

b1

a numeric value specifying the second hyperparameter of the beta prior for group 1. Default value set to 0.5

a2

a numeric value specifying the first hyperparameter of the beta prior for group 2. Default value set to 0.5

b2

a numeric value specifying the second hyperparameter of the beta prior for group 2. Default value set to 0.5

rho

a numeric value specifying correlation coefficient for Sarmanov bivariate prior distribution. Default value set to 0. It is subject to constraints. See Details.

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.

When model="Sarmanov", rho is subject to constraints. See Chen et al (2011) for details.

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

multipletables plot.singletable summary.singletable

Examples

Run this code
# \donttest{
oldpar <- par(no.readonly = TRUE)

# Inference under Jeffreys prior distribution
single.OR.Jeffreys <- singletable(a1=0.5, b1=0.5, a2=0.5,
                                  b2=0.5, y1=40, n1=96, y2=49, n2=109,
                                  model="Independent",
                                  measure="OR", method="exact")
summary(single.OR.Jeffreys)

# Inference under Laplace prior distribution
single.OR.Laplace <- singletable(a1=1, b1=1, a2=1, b2=1,
                                 y1=40, n1=96, y2=49, n2=109,
                                 model="Independent", measure="OR",
                                 method="exact")
summary(single.OR.Laplace)

# Inference under Sarmanov prior distribution with positive correlation
single.OR.Sar1 <- singletable(a1=0.5, b1=0.5, a2=0.5, b2=0.5,
                              rho=0.5, y1=40, n1=96, y2=49, n2=109,
                              model="Sarmanov",
                              measure="OR", method="exact")
summary(single.OR.Sar1)

# Inference under Sarmanov prior distribution with negative correlation
single.OR.Sar2 <- singletable(a1=0.5, b1=0.5, a2=0.5, b2=0.5,
                              rho=-0.5, y1=40, n1=96, y2=49, n2=109,
                              model="Sarmanov",
                              measure="OR", method="exact")
summary(single.OR.Sar2)

# generate a 2X2 panel plot
par(mfrow=c(2,2))
plot(single.OR.Jeffreys, type="overlap", xlim=c(0.5, 2),
    main="Jefferys Prior")
plot(single.OR.Laplace, type="overlap", xlim=c(0.5, 2),
     main="Laplace Prior")
plot(single.OR.Sar1, type="overlap", xlim=c(0.5, 2),
     main=expression(paste("Sarmanov Prior ",rho," = 0.5")))
plot(single.OR.Sar2, type="overlap", xlim=c(0.5, 2),
     main=expression(paste("Sarmanov Prior ",rho," = -0.5")))
     
par(oldpar)
# }

Run the code above in your browser using DataLab