View source: R/conflict_sensitivity.R
| prior_conflict | R Documentation |
Evaluates conflict between a specified prior and observed data using multiple complementary diagnostics: Box's (1980) predictive p-value, the surprise index (standardised distance), Kullback-Leibler divergence, and the Bhattacharyya overlap coefficient between the prior and the (normalised) likelihood.
prior_conflict(prior, data_summary, alpha = 0.05)
prior |
A |
data_summary |
Named list describing the observed data:
|
alpha |
Numeric. Significance level for the Box p-value flag.
Default |
An object of class bayprior_conflict containing:
box_pvalueBox's prior predictive p-value.
surprise_indexStandardised distance between prior mean and observed data.
kl_prior_likelihoodKL divergence from prior to likelihood.
overlapBhattacharyya overlap coefficient in [0, 1].
conflict_severityOne of "none", "mild",
"severe".
conflict_flagLogical; TRUE if
box_pvalue < alpha.
recommendationPlain-language guidance string.
data_summaryThe data summary passed in.
priorThe input prior.
Box, G. E. P. (1980). Sampling and Bayes' inference in scientific modelling and robustness. Journal of the Royal Statistical Society A, 143, 383-430.
prior <- elicit_beta(mean = 0.30, sd = 0.10, method = "moments",
label = "Response rate")
cd <- prior_conflict(prior, list(type = "binary", x = 18, n = 40))
print(cd)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.