Skip to contents

Summarise mock coding/billing data frame

Usage

summarise_claims(df, vars = c(dplyr::starts_with("days_"), dar))

Arguments

df

[data.frame] data frame generated from mock_claims() |> prep_claims()

vars

[character] variables to summarise, e.g. c(days_service, days_reconciliation)

Value

A tibble

Examples

x <- mock_claims(rows = 500) |> prep_claims()

summarise_claims(x)
#> # A tibble: 1 × 9
#>   n_claims gross_charges ending_ar mean_release mean_sub…¹ mean_acc…² mean_adj…³
#>      <int>         <dbl>     <dbl>        <dbl>      <dbl>      <dbl>      <dbl>
#> 1      500        64752.    43413.          8.1        2.9        7.6        15.
#> # ℹ abbreviated names: ¹​mean_submission, ²​mean_acceptance, ³​mean_adjudication
#> # ℹ 2 more variables: mean_reconciliation <dbl>, mean_dar <dbl>

x |>
  dplyr::group_by(
    year = ymd::year(date_service),
    month = ymd::month(date_service)) |>
  summarise_claims()
#> # A tibble: 4 × 11
#>    year month n_claims gross_charges ending_ar mean_rele…¹ mean_sub…² mean_acc…³
#>   <int> <int>    <int>         <dbl>     <dbl>       <dbl>      <dbl>      <dbl>
#> 1  2024     4       97        11949.     7541.         8          2.6        7.3
#> 2  2024     5      161        21007.    13776.         8.5        3.2        7.7
#> 3  2024     6      185        24067.    16180.         7.9        3.0        7.7
#> 4  2024     7       57         7728.     5915.         7.9        2.7        7.5
#> # ℹ abbreviated names: ¹​mean_release, ²​mean_submission, ³​mean_acceptance
#> # ℹ 3 more variables: mean_adjudication <dbl>, mean_reconciliation <dbl>,
#> #   mean_dar <dbl>