# \donttest{
library(mmeta)
library(ggplot2)
## Analyze the dataset colorectal to conduct exact inference of the odds ratios
data(colorectal)
colorectal['study_name'] <- colorectal['studynames']
# ########################## If exact method is used ############################
## Create object multiple_tables_obj_exact
multiple_tables_obj_exact <- MultipleTables.create(data=colorectal,
measure='OR', model= 'Sarmanov')
## Model fit default
multiple_tables_obj_exact <- MultipleTables.modelFit(
multiple_tables_obj_exact, method = 'exact')
## Options for Control; If set number of posterior samples is 5000
multiple_tables_obj_exact <- MultipleTables.modelFit(multiple_tables_obj_exact, method = 'exact',
control = list(n_samples = 3000))
## If set intial values correspoinding to c(a1, b1, a2, b2, rho) as c(1,1,1,1,0):
multiple_tables_obj_exact <- MultipleTables.modelFit(multiple_tables_obj_exact, method = 'exact',
control = list(initial_values = c(1,1,1,1,0)))
## If maximum number of iterations for iteration is 100
multiple_tables_obj_exact <- MultipleTables.modelFit(multiple_tables_obj_exact, method = 'exact',
control = list(maxit = 100))
## If maximum number of iterations for iteration is 100 and number of posterior samples as 3000
multiple_tables_obj_exact <- MultipleTables.modelFit(multiple_tables_obj_exact, method = 'exact',
control = list(maxit = 100, nsamples = 3000))
# ########################## If sampling method is used ############################
multiple_tables_obj_sampling <- MultipleTables.create(data=colorectal,
measure='OR', model= 'Sarmanov')
multiple_tables_obj_sampling <- MultipleTables.modelFit(
multiple_tables_obj_sampling, method = 'sampling')
## The options of \code{control} list specifying the fitting process are similar
## to the codes shown above.
# }
Run the code above in your browser using DataLab