Summary statistics
Usage
summary_stats(
df,
condition = NULL,
group_vars = NULL,
summary_vars = NULL,
arr = NULL,
digits = 3
)
Examples
x <- dplyr::tibble(
provider = sample(c("A", "B", "C"), size = 200, replace = TRUE),
city = sample(c("ATL", "NYC"), size = 200, replace = TRUE),
charges = sample(1000:2000, size = 200),
payment = sample(1000:2000, size = 200))
summary_stats(
x,
condition = city == "ATL",
group_vars = provider,
summary_vars = c(charges, payment),
arr = provider)
#> # A tibble: 3 × 8
#> provider charges_median charges_mean charges_sd payment_median payment_mean
#> <chr> <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1 C 1488. 1480. 258. 1378. 1432.
#> 2 B 1555 1535. 303. 1556 1517.
#> 3 A 1645 1605. 256. 1574 1575.
#> # ℹ 2 more variables: payment_sd <dbl>, n <int>