tab_ci | R Documentation |
tab
Add confidence intervals to a tab
tab_ci(
tabs,
ci = "auto",
comp = NULL,
conf_level = 0.95,
color = "no",
visible = FALSE,
method_cell = "wilson",
method_diff = "ac"
)
tabs |
A |
ci |
The type of ci to calculate. Set to "cell" to calculate absolute confidence
intervals. Set to "diff" to calculate the confidence intervals of the difference
between a cell and the relative total cell (or the reference cell,
when |
comp |
Comparison level. When |
conf_level |
The confidence level, as a single numeric between 0 and 1. Default to 0.95 (95%). |
color |
The type of colors to print, as a single string.
|
visible |
By default confidence intervals are calculated and used to set colors,
but not printed. Set to |
method_cell |
Character string specifying which method to use with percentages
for |
method_diff |
Character string specifying which method to use with percentages
for |
A tibble
of class tab
, colored based on differences (from
totals/first cells) and confidence intervals.
# A typical workflow with tabxplor step-by-step functions :
data <- dplyr::starwars %>%
tab_prepare(sex, hair_color, gender, other_if_less_than = 5,
na_drop_all = sex)
data %>%
tab_plain(sex, hair_color, gender, tot = c("row", "col"),
pct = "row", comp = "all") %>%
tab_ci("diff", color = "after_ci")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.