Description Usage Arguments Value Examples
Extraction functions for objects returned from the ab_test
function.
1 2 3 4 5 6 7 | get_bf(x, log = FALSE)
get_prior_prob(x)
get_post_prob(x)
get_post_samples(x, hypothesis = "H1")
|
x |
object of class |
log |
determines whether the log Bayes factors are returned. |
hypothesis |
determines for which hypothesis posterior samples are returned. Needs to be either "H1", "H+", or "H-" (the default is "H1"). |
get_bf
returns the Bayes factors in favor of "H1", "H+", and
"H-" (compared to H0). get_prior_prob
returns the prior
probabilities of the hypotheses. get_post_prob
returns the posterior
probabilities of the hypotheses. get_post_samples
returns posterior
samples for the specified hypothesis.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | # synthetic data
data <- list(y1 = 10, n1 = 28, y2 = 14, n2 = 26)
# Bayesian A/B test with default settings
ab <- ab_test(data = data, posterior = TRUE)
# extract Bayes factors
get_bf(ab)
# extract prior probabilities
get_prior_prob(ab)
# extract posterior probabilities
get_post_prob(ab)
# extract posterior samples for H1
s <- get_post_samples(ab, hypothesis = "H1")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.