Skip to contents

Fit a Bayesian model using gemtc

Usage

bayes_model(configured_data, n_adapt = 5000, n_iter = 20000, async = FALSE)

Arguments

configured_data

list. Input dataset created by setup_configure() or setup_exclude()

n_adapt

numeric. Number of adaptation iterations. Defaults to 5000 and can normally be left unchanged

n_iter

numeric. Number of simulation iterations. Defaults to 20000 and can normally be left unchanged

async

Whether or not the function is being used asynchronously. Default FALSE

Value

List containing:

mtcResults

mtc.result. Output from gemtc::mtc.run()

mtcRelEffects

mtc.result. Output from gemtc::relative.effect()

rel_eff_tbl

mtc.relative.effect.table. Output from gemtc::relative.effect.table()

sumresults

summary.mtc.result. Output from summary(mtcRelEffects)

mtcNetwork

mtc.network. Output from gemtc::mtc.network()

dic

dataframe. Containing the statistics 'Dbar', 'pD', 'DIC', and 'data points'

outcome

character. The outcome from configured_data

outcome_measure

character. The outcome_measurefrom configured_data

reference_treatment

character. The reference_treatmentfrom configured_data

effects

character. The effects from configured_data

seed

numeric. The seed from configured_data

Examples

configured_data_path <- system.file("extdata", "configured_data.Rds", package = "metainsight")
configured_data <- readRDS(configured_data_path)

# n_adapt and n_iter are set low to run quickly, but should be left as the
# default values in real use

fitted_bayes_model <- bayes_model(configured_data = configured_data,
                                  n_adapt = 100,
                                  n_iter = 100)