Plot posterior predictive checks for a fitted probit model
Source:R/probit_posterior_predictive.R
plot_probit_posterior_predictive_checks.RdCompact multi-page PDF: observed-vs-replicated marginal resistance,
number-resistant-per-event distribution, observed-vs-replicated pairwise
RR/RS/SR/SS, complete-profile concentration/entropy, hospital
heterogeneity, admission/patient clustering, and (when
ppc_replicates with materialised replicate arrays is supplied) a
small-multiples page comparing the observed data against
n_small_multiples randomly selected posterior replications. A
good posterior predictive plot makes it visually apparent whether the
observed data look typical among the replicated datasets.
Usage
plot_probit_posterior_predictive_checks(
ppc_statistics,
ppc_replicates = NULL,
output_pdf_path,
title_base,
n_small_multiples = 10L,
small_multiple_seed = 123L
)Arguments
- ppc_statistics
Tibble returned by
compute_probit_ppc_statistics.- ppc_replicates
Optional
"amr_ppc_draws"object returned bysimulate_probit_posterior_predictivewithreturn_replicates = TRUE– enables the small-multiples page.NULL(default) skips that page.- output_pdf_path
Path to the PDF to write.
- title_base
Character; prefixed to every page's title (e.g.
"<experiment_id>\n<pathogen>").- n_small_multiples
Integer; number of replicate states to show on the small-multiples page. Default 10.
- small_multiple_seed
Integer seed for selecting which replicate states appear on the small-multiples page. Default 123.