Description Usage Arguments Details Value Examples
Fits a Beta-Binomial model to a 2x2 table/matrix of two groups and two outcomes/features.
1 2 3 4 5 6 | beta_binom(
x,
n = NULL,
prior = c(a = 0.5, b = 0.5, c = 0.5, d = 0.5),
n_sims = 10000
)
|
x |
A numeric vector of success counts OR a 2x2 table or matrix. |
n |
A numeric vector of totals. (Optional if x is a table or matrix.) |
prior |
Parameters for independent beta priors. See Details. |
n_sims |
Number of draws (simulations) to make from the posterior distributions. |
The model assumes
x_i ~ Binomial(n_i, p_i); p_1 ~ Beta(a, b); p_2 ~ Beta(c, d)
for i = 1, 2. The default is a = b = c = d = 1/2
which
corresponds to a Jeffreys prior on p_1 and p_2.
An S3 object of class "beta_binomial_fit". It has the following properties: posterior_simulations, posterior_parameters, successes, totals
1 2 3 4 5 6 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.