# NOT RUN {
## Smoking cessation
# }
# NOT RUN {
# Run smoking RE NMA example if not already available
if (!exists("smk_fit_RE")) example("example_smk_re")
# }
# NOT RUN {
# Working with arrays of posterior draws (as mcmc_array objects) is
# convenient when transforming parameters
# Transforming log odds ratios to odds ratios
LOR_array <- as.array(relative_effects(smk_fit_RE))
OR_array <- exp(LOR_array)
# mcmc_array objects can be summarised to produce a nma_summary object
smk_OR_RE <- summary(OR_array)
# This can then be printed or plotted
smk_OR_RE
plot(smk_OR_RE, ref_line = 1)
# Transforming heterogeneity SD to variance
tau_array <- as.array(smk_fit_RE, pars = "tau")
tausq_array <- tau_array^2
# Correct parameter names
names(tausq_array) <- "tausq"
# Summarise
summary(tausq_array)
# }
Run the code above in your browser using DataLab