Description Usage Arguments Value Examples
Outputs a nicely-formatted table suitable for presentations and reports. Especially useful for combining multiple results into a single summary table.
1 2 3 4 5 6 7 8 9 |
object |
An object of class "beta_binomial_fit" or a list (named or
unnamed) of "beta_binomial_fit" objects created by |
conf_interval |
A logical flag indicating whether to include Bayesian confidence intervals in the generated table. |
conf_level |
Probability level for credible intervals. 95% by default. |
interval_type |
Method for computing intervals ("quantile" or "HPD"). |
raw |
A logical flag to return a data frame instead of the character
vector produced by |
fancy_names |
A logical flag to use reader-friendly column names. |
... |
Arguments to forward to |
A character vector formatted as Markdown, HTML, or LaTeX. The table has the following columns:
The total count of trials in group 1.
The total count of trials in group 2.
Point estimate of the probability of success in group 1.
Point estimate of the probability of success in group 2.
Pr(Success) in Group 1 - Pr(Success) in Group 2
How likely trials in group 1 are to succeed relative to group 2.
The ratio of the odds of success in group 1 vs odds of success in group 2.
The estimated quantities have credible intervals by default but these can
be turned off with the conf_interval
argument.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | ## Not run:
fake_data <- matrix(c(200, 150, 250, 300), nrow = 2, byrow = TRUE)
colnames(fake_data) <- c('Safe' ,'Dangerous')
rownames(fake_data) <- c('Animals', 'Plants')
fit <- beta_binom(fake_data)
present_bbfit(fit) # uses getOption("digits")
present_bbfit(fit, digits = 2)
present_bbfit(fit, conf_interval = FALSE, digits = 3)
present_bbfit(fit, conf_level = 0.8, interval_type = "HPD", digits = 2)
fit_2 <- update(fit, x = c(8, 4), n = c(10, 50))
fit_3 <- update(fit_2, x = c(1, 20), n = c(15, 40))
fit_4 <- update(fit_3, x = c(20, 13), n = c(80, 45))
present_bbfit(list("Day 1" = fit, "Day 2" = fit_2, "Day 3" = fit_3, "Day 4" = fit_4), digits = 2)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.