Summarizes descriptive statistics for binomial variables
Source:R/summary_statistics.R
summary_binomial.RdSummarizes descriptive statistics for binomial variables
Value
A tibble with descriptive statistics containing the following columns:
- Variables
Character vector specifying the name of each variable.
- Statistics
Character vector combining the reference level of a variable with its frequency count and its percentage.
Examples
x <- data.frame(A = sample(c("X", "Y"), 100, replace = TRUE))
summary_binomial(x)
#> # A tibble: 1 × 2
#> Variables Statistics
#> <chr> <chr>
#> 1 A X : 53 (53%)
summary_binomial(x, digits = 2, width = 5)
#> # A tibble: 1 × 2
#> Variables Statistics
#> <chr> <chr>
#> 1 A "X : 53\n(53%)"