# \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, the codes for sampling method are similar.
## 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')
## Summary of the fitting process (default)
multiple_tables_obj_exact <- MultipleTables.summary(multiple_tables_obj_exact)
## Density plot, overlay
## Note: There are no enough types of line, if we have too many densities!
MultipleTables.plot(multiple_tables_obj_exact, plot_type = 'density',
layout_type = 'overlay')
## Choose Set by = ‘color’
MultipleTables.plot(multiple_tables_obj_exact, plot_type = 'density',
layout_type = 'overlay',by = 'color')
## Set by = ‘color’ and specify xlim as 0 to 5.
MultipleTables.plot(multiple_tables_obj_exact, plot_type = 'density',
layout_type = 'overlay', by = 'color', xlim = c(0,5))
## Set by = ‘color’ and specify xlim as 0 to 5 and add vertical line at OR = 1
MultipleTables.plot(multiple_tables_obj_exact, plot_type = 'density',
layout_type = 'overlay', by = 'color',xlim = c(0,5), add_vertical = 1)
## If select three studies
MultipleTables.plot(multiple_tables_obj_exact, plot_type = 'density',
layout_type = 'overlay',selected_study_names = c('Bell','Chen','Oda'), xlim = c(0,5))
## We can add external layouts for the return ggplot2. xlab as Odds ratio
ggplot2_obj <- MultipleTables.plot(multiple_tables_obj_exact,
plot_type = 'density', layout_type = 'overlay', by = 'color',xlim = c(0,5))
ggplot2_obj + xlab('Odds Ratio') + ggtitle('OR ration for XX cancer')
## density plot, plot side by side
MultipleTables.plot(multiple_tables_obj_exact, plot_type = 'density',
layout_type = 'side_by_side')
## Forest plot (default)
MultipleTables.plot(multiple_tables_obj_exact, plot_type = 'forest')
## forest plot: not show the CIs
MultipleTables.plot(multiple_tables_obj_exact, plot_type = 'forest',
add_vertical = 1, show_CI = FALSE)
# }
Run the code above in your browser using DataLab