View source: R/bmult_S3methods.R
| summary.bmult | R Documentation |
bmultSummarizes results from Bayes factor analysis
## S3 method for class 'bmult' summary(object, ...)
object |
object of class |
... |
additional arguments, currently ignored |
Invisibly returns a list which contains the Bayes factor and associated hypotheses for the full
model, but also the separate for the independent equality and inequality constraints.
The summary method returns a list with the following elements:
$hypVector containing the informed hypothesis as specified by the user
$bfContains Bayes factor
$logmlHeContains log marginal likelihood of the encompassing model
$logmlH0Contains log marginal likelihood of the null model
$logmlHrContains log marginal likelihood of the informed model
$re2Contains relative mean-square error for the Bayes factor
$bf_typeContains Bayes factor type as specified by the user
$cred_levelCredible interval for the posterior point estimates.
$priorList containing the prior parameters.
$dataList containing the data.
$nr_equalNumber of independent equality-constrained hypotheses.
$nr_inequalNumber of independent inequality-constrained hypotheses.
$estimatesParameter estimates for the encompassing model
factor_level: Vector with category names
alpha: Vector with posterior concentration parameters of Dirichlet
distribution (for multinomial models) or alpha parameters for independent beta
distributions (for binomial models)
beta: Vector with beta parameters for independent beta
distributions (for binomial models)
lower: Lower value of credible intervals of marginal beta distributions
median: Posterior median of marginal beta distributions
upper: Upper value of credible intervals of marginal beta distributions
# data
x <- c(3, 4, 10, 11)
n <- c(15, 12, 12, 12)
# priors
a <- c(1, 1, 1, 1)
b <- c(1, 1, 1, 1)
# informed hypothesis
factor_levels <- c('theta1', 'theta2', 'theta3', 'theta4')
Hr <- c('theta1', '<', 'theta2', '<', 'theta3', '<', 'theta4')
## Binomial Case
out_binom <- binom_bf_informed(x=x, n=n, Hr=Hr, a=a, b=b, niter=1e3,factor_levels, seed=2020)
summary(out_binom)
## Multinomial Case
out_mult <- mult_bf_informed(x=x, Hr=Hr, a=a, niter=1e3,factor_levels, seed=2020)
summary(out_mult)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.