singletable {mmeta} | R Documentation |
This function conducts exact posterior inference based on a single 2x2 table.
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)
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
|
model |
a character string specifying the model. Options are
|
method |
a character string specifying the method. Options are
|
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 |
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.
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 |
model |
the value of |
method |
the value of |
dataset |
a numeric vector of input data with components:
|
parameter |
a numeric vector of the hyperparameters:
|
alpha |
the value of |
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. |
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.
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.
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, doi: 10.1177/0962280211430889. In press.
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. In press.
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.
multipletables
plot.singletable
summary.singletable
# 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",file="singleOR_Jef") #plot(single.OR.Laplace, type="overlap", xlim=c(0.5, 2), # main="Laplace Prior",file="singleOR_La") #plot(single.OR.Sar1, type="overlap", xlim=c(0.5, 2), # main=expression(paste("Sarmanov Prior ",rho," = 0.5")),file="singleOR_Sar1") #plot(single.OR.Sar2, type="overlap", xlim=c(0.5, 2), # main=expression(paste("Sarmanov Prior ",rho," = -0.5")),file="singleOR_Sar2")