# NOT RUN {
## Smoking cessation
# }
# NOT RUN {
# Run smoking FE NMA example if not already available
if (!exists("smk_fit_FE")) example("example_smk_fe")
# }
# NOT RUN {
# Run smoking RE NMA example if not already available
if (!exists("smk_fit_RE")) example("example_smk_re")
# }
# NOT RUN {
# Compare DIC of FE and RE models
(smk_dic_FE <- dic(smk_fit_FE))
(smk_dic_RE <- dic(smk_fit_RE)) # substantially better fit
# Plot residual deviance contributions under RE model
plot(smk_dic_RE)
# Check for inconsistency using UME model
# }
# NOT RUN {
# Run smoking UME NMA example if not already available
if (!exists("smk_fit_RE_UME")) example("example_smk_ume")
# }
# NOT RUN {
# Compare DIC
smk_dic_RE
(smk_dic_RE_UME <- dic(smk_fit_RE_UME)) # no difference in fit
# Compare residual deviance contributions
plot(smk_dic_RE, smk_dic_RE_UME, show_uncertainty = FALSE)
# }
Run the code above in your browser using DataLab