## Assume we have a 2x2 table:{{40,56},{49,60}} and set prior parameters as a1=b1=a2=b2=rho=0.5.
# \donttest{
library(mmeta)
library(ggplot2)
## If exact method is used, the codes for sampling method are similar.
## Create object \code{single_table_obj_exact}
single_table_obj_exact <- SingleTable.create(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")
## model fit
single_table_obj_exact <- SingleTable.modelFit(single_table_obj_exact, method = 'exact')
## Summary of the fitting process (default)
single_table_obj_exact <- SingleTable.summary(single_table_obj_exact, alpha = 0.05)
## Structure of SingleTable object
str(single_table_obj_exact)
## If set alpha level to 0.1
single_table_obj_exact <- SingleTable.summary(single_table_obj_exact, alpha = 0.1)
## If set digit to 2
single_table_obj_exact <- SingleTable.summary(single_table_obj_exact, digit = 2)
## If decided not to print out
single_table_obj_exact <- SingleTable.summary(single_table_obj_exact, verbose = FALSE)
# }
Run the code above in your browser using DataLab