diff --git a/README.Rmd b/README.Rmd index 9d75aee..339f99a 100644 --- a/README.Rmd +++ b/README.Rmd @@ -15,7 +15,7 @@ knitr::opts_chunk$set( ) ``` -# healthyR +# healthyR [![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/healthyR)](https://cran.r-project.org/package=healthyR) diff --git a/docs/404.html b/docs/404.html index 10a28b4..7568349 100644 --- a/docs/404.html +++ b/docs/404.html @@ -6,11 +6,18 @@ Page not found (404) • healthyR + + + + + + + Contributor Covenant Code of Conduct • healthyRContributor Covenant Code of Conduct • healthyR @@ -52,7 +52,7 @@
diff --git a/docs/LICENSE-text.html b/docs/LICENSE-text.html index 4fa6a6d..46abcb2 100644 --- a/docs/LICENSE-text.html +++ b/docs/LICENSE-text.html @@ -1,5 +1,5 @@ -License • healthyRLicense • healthyR @@ -52,7 +52,7 @@
diff --git a/docs/LICENSE.html b/docs/LICENSE.html index d56e006..1b002d5 100644 --- a/docs/LICENSE.html +++ b/docs/LICENSE.html @@ -1,5 +1,5 @@ -MIT License • healthyRMIT License • healthyR @@ -52,7 +52,7 @@
diff --git a/docs/apple-touch-icon-120x120.png b/docs/apple-touch-icon-120x120.png new file mode 100644 index 0000000..b73e9d0 Binary files /dev/null and b/docs/apple-touch-icon-120x120.png differ diff --git a/docs/apple-touch-icon-152x152.png b/docs/apple-touch-icon-152x152.png new file mode 100644 index 0000000..3b9bef2 Binary files /dev/null and b/docs/apple-touch-icon-152x152.png differ diff --git a/docs/apple-touch-icon-180x180.png b/docs/apple-touch-icon-180x180.png new file mode 100644 index 0000000..b9053fb Binary files /dev/null and b/docs/apple-touch-icon-180x180.png differ diff --git a/docs/apple-touch-icon-60x60.png b/docs/apple-touch-icon-60x60.png new file mode 100644 index 0000000..d6db546 Binary files /dev/null and b/docs/apple-touch-icon-60x60.png differ diff --git a/docs/apple-touch-icon-76x76.png b/docs/apple-touch-icon-76x76.png new file mode 100644 index 0000000..8c68956 Binary files /dev/null and b/docs/apple-touch-icon-76x76.png differ diff --git a/docs/apple-touch-icon.png b/docs/apple-touch-icon.png new file mode 100644 index 0000000..a632d41 Binary files /dev/null and b/docs/apple-touch-icon.png differ diff --git a/docs/articles/getting-started.html b/docs/articles/getting-started.html index 534e8c0..80a48a0 100644 --- a/docs/articles/getting-started.html +++ b/docs/articles/getting-started.html @@ -7,12 +7,19 @@ Getting Started with healthyR • healthyR + + + + + + + Articles • healthyRArticles • healthyR @@ -52,7 +52,7 @@
diff --git a/docs/authors.html b/docs/authors.html index a0df12b..5997386 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -1,5 +1,5 @@ -Authors and Citation • healthyRAuthors and Citation • healthyR @@ -52,7 +52,7 @@
diff --git a/docs/favicon-16x16.png b/docs/favicon-16x16.png new file mode 100644 index 0000000..b986688 Binary files /dev/null and b/docs/favicon-16x16.png differ diff --git a/docs/favicon-32x32.png b/docs/favicon-32x32.png new file mode 100644 index 0000000..8f35647 Binary files /dev/null and b/docs/favicon-32x32.png differ diff --git a/docs/favicon.ico b/docs/favicon.ico new file mode 100644 index 0000000..d135d6f Binary files /dev/null and b/docs/favicon.ico differ diff --git a/docs/index.html b/docs/index.html index fb57a95..eb76ea3 100644 --- a/docs/index.html +++ b/docs/index.html @@ -12,6 +12,12 @@ amounts by service lines just to name a few. The aim is to provide a simple and consistent verb framework that takes the guesswork out of everything."> Hospital Data Analysis Workflow Tools • healthyR + + + + + + @@ -23,6 +29,7 @@ of these include average length of stay, readmission rates, average net pay amounts by service lines just to name a few. The aim is to provide a simple and consistent verb framework that takes the guesswork out of everything."> +

The goal of healthyR is to help quickly analyze common data problems in the Administrative and Clincial spaces.

diff --git a/docs/logo.png b/docs/logo.png new file mode 100644 index 0000000..6d5f246 Binary files /dev/null and b/docs/logo.png differ diff --git a/docs/news/index.html b/docs/news/index.html index ac4ac8c..57f8a59 100644 --- a/docs/news/index.html +++ b/docs/news/index.html @@ -1,5 +1,5 @@ -Changelog • healthyRChangelog • healthyR @@ -52,7 +52,7 @@
diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml index 39b9b33..70bc528 100644 --- a/docs/pkgdown.yml +++ b/docs/pkgdown.yml @@ -3,7 +3,7 @@ pkgdown: 2.0.7 pkgdown_sha: ~ articles: getting-started: getting-started.html -last_built: 2023-05-03T02:19Z +last_built: 2023-05-05T16:11Z urls: reference: https://www.spsanderson.com/healthyR/reference article: https://www.spsanderson.com/healthyR/articles diff --git a/docs/reference/Rplot002.png b/docs/reference/Rplot002.png index 8753976..3878c16 100644 Binary files a/docs/reference/Rplot002.png and b/docs/reference/Rplot002.png differ diff --git a/docs/reference/category_counts_tbl.html b/docs/reference/category_counts_tbl.html index b90db26..ed8cee5 100644 --- a/docs/reference/category_counts_tbl.html +++ b/docs/reference/category_counts_tbl.html @@ -1,7 +1,7 @@ Counts by Category — category_counts_tbl • healthyR @@ -54,7 +54,7 @@
diff --git a/docs/reference/color_blind.html b/docs/reference/color_blind.html index 760b38b..0ffd7ed 100644 --- a/docs/reference/color_blind.html +++ b/docs/reference/color_blind.html @@ -1,5 +1,5 @@ -Provide Colorblind Compliant Colors — color_blind • healthyRProvide Colorblind Compliant Colors — color_blind • healthyR @@ -52,7 +52,7 @@
diff --git a/docs/reference/diverging_bar_plt.html b/docs/reference/diverging_bar_plt.html index 46550ec..11dea71 100644 --- a/docs/reference/diverging_bar_plt.html +++ b/docs/reference/diverging_bar_plt.html @@ -13,7 +13,7 @@ your categorical variable has 2 categories that changes values at a certain threshold of the continuous variable. In below example, the mpg from mtcars data set is normalized by computing the z score. Those vehicles with mpg -above zero are marked green and those below are marked red.">Diverging Bar Chart — diverging_bar_plt • healthyRDiverging Bar Chart — diverging_bar_plt • healthyR @@ -80,7 +80,7 @@
diff --git a/docs/reference/diverging_lollipop_plt.html b/docs/reference/diverging_lollipop_plt.html index f85eece..83432f4 100644 --- a/docs/reference/diverging_lollipop_plt.html +++ b/docs/reference/diverging_lollipop_plt.html @@ -3,11 +3,11 @@ information as bar chart and diverging bar. Except that it looks more modern. Instead of geom_bar, I use geom_point and geom_segment to get the lollipops right. Let’s draw a lollipop using the same data I prepared in the previous -example of diverging bars.">Diverging Lollipop Chart — diverging_lollipop_plt • healthyRDiverging Lollipop Chart — diverging_lollipop_plt • healthyR @@ -60,7 +60,7 @@
diff --git a/docs/reference/dx_cc_mapping.html b/docs/reference/dx_cc_mapping.html index c4e3743..018e303 100644 --- a/docs/reference/dx_cc_mapping.html +++ b/docs/reference/dx_cc_mapping.html @@ -1,7 +1,7 @@ Diagnosis to Condition Code Mapping file — dx_cc_mapping • healthyR @@ -54,7 +54,7 @@
diff --git a/docs/reference/figures/README-gartner_chart-1.png b/docs/reference/figures/README-gartner_chart-1.png index 27c563c..26e521f 100644 Binary files a/docs/reference/figures/README-gartner_chart-1.png and b/docs/reference/figures/README-gartner_chart-1.png differ diff --git a/docs/reference/figures/logo.png b/docs/reference/figures/logo.png new file mode 100644 index 0000000..6d5f246 Binary files /dev/null and b/docs/reference/figures/logo.png differ diff --git a/docs/reference/gartner_magic_chart_plt-1.png b/docs/reference/gartner_magic_chart_plt-1.png index 4969bff..89504d0 100644 Binary files a/docs/reference/gartner_magic_chart_plt-1.png and b/docs/reference/gartner_magic_chart_plt-1.png differ diff --git a/docs/reference/gartner_magic_chart_plt-2.png b/docs/reference/gartner_magic_chart_plt-2.png index a3cc4b8..eb3b916 100644 Binary files a/docs/reference/gartner_magic_chart_plt-2.png and b/docs/reference/gartner_magic_chart_plt-2.png differ diff --git a/docs/reference/gartner_magic_chart_plt.html b/docs/reference/gartner_magic_chart_plt.html index 537031e..dac0e13 100644 --- a/docs/reference/gartner_magic_chart_plt.html +++ b/docs/reference/gartner_magic_chart_plt.html @@ -1,5 +1,5 @@ -Gartner Magic Chart - Plotting of two continuous variables — gartner_magic_chart_plt • healthyRGartner Magic Chart - Plotting of two continuous variables — gartner_magic_chart_plt • healthyR @@ -52,7 +52,7 @@
diff --git a/docs/reference/hr_scale_color_colorblind.html b/docs/reference/hr_scale_color_colorblind.html index 267e666..216136e 100644 --- a/docs/reference/hr_scale_color_colorblind.html +++ b/docs/reference/hr_scale_color_colorblind.html @@ -1,5 +1,5 @@ -Provide Colorblind Compliant Colors — hr_scale_color_colorblind • healthyRProvide Colorblind Compliant Colors — hr_scale_color_colorblind • healthyR @@ -52,7 +52,7 @@
diff --git a/docs/reference/hr_scale_fill_colorblind.html b/docs/reference/hr_scale_fill_colorblind.html index f5aafda..610ff1b 100644 --- a/docs/reference/hr_scale_fill_colorblind.html +++ b/docs/reference/hr_scale_fill_colorblind.html @@ -1,5 +1,5 @@ -Provide Colorblind Compliant Colors — hr_scale_fill_colorblind • healthyRProvide Colorblind Compliant Colors — hr_scale_fill_colorblind • healthyR @@ -52,7 +52,7 @@
diff --git a/docs/reference/index.html b/docs/reference/index.html index b05cff2..06387fc 100644 --- a/docs/reference/index.html +++ b/docs/reference/index.html @@ -1,5 +1,5 @@ -Function reference • healthyRFunction reference • healthyR @@ -52,7 +52,7 @@
diff --git a/docs/reference/los_ra_index_plt-1.png b/docs/reference/los_ra_index_plt-1.png index 460546e..ca5b39f 100644 Binary files a/docs/reference/los_ra_index_plt-1.png and b/docs/reference/los_ra_index_plt-1.png differ diff --git a/docs/reference/los_ra_index_plt-2.png b/docs/reference/los_ra_index_plt-2.png index 065c5cf..8de4d36 100644 Binary files a/docs/reference/los_ra_index_plt-2.png and b/docs/reference/los_ra_index_plt-2.png differ diff --git a/docs/reference/los_ra_index_plt.html b/docs/reference/los_ra_index_plt.html index e80f060..9e5130b 100644 --- a/docs/reference/los_ra_index_plt.html +++ b/docs/reference/los_ra_index_plt.html @@ -1,7 +1,7 @@ Plot LOS and Readmit Index with Variance — los_ra_index_plt • healthyR @@ -54,7 +54,7 @@
diff --git a/docs/reference/los_ra_index_summary_tbl.html b/docs/reference/los_ra_index_summary_tbl.html index b419258..9f866bd 100644 --- a/docs/reference/los_ra_index_summary_tbl.html +++ b/docs/reference/los_ra_index_summary_tbl.html @@ -1,5 +1,5 @@ -Make LOS and Readmit Index Summary Tibble — los_ra_index_summary_tbl • healthyRMake LOS and Readmit Index Summary Tibble — los_ra_index_summary_tbl • healthyR @@ -52,7 +52,7 @@
@@ -156,21 +156,21 @@

Examples#> # A tibble: 15 × 4 #> los_group los_index rar_index los_ra_var #> <dbl> <dbl> <dbl> <dbl> -#> 1 1 0.114 0.833 1.05 -#> 2 2 0.264 1.08 0.820 -#> 3 3 0.327 2.14 1.82 -#> 4 4 0.382 1.2 0.818 -#> 5 5 0.590 1.5 0.910 -#> 6 6 0.527 0.818 0.655 -#> 7 7 0.704 1.27 0.569 -#> 8 8 0.698 1.33 0.635 -#> 9 9 1.01 0.917 0.0951 -#> 10 10 1.38 1 0.384 -#> 11 11 1.12 1.62 0.749 -#> 12 12 1.54 1.4 0.942 -#> 13 13 1.13 0.833 0.298 -#> 14 14 1.49 0.667 0.823 -#> 15 15 2.11 1.09 1.20 +#> 1 1 0.0964 1.18 1.09 +#> 2 2 0.208 1.08 0.875 +#> 3 3 0.471 1.09 0.620 +#> 4 4 0.368 1.25 0.882 +#> 5 5 0.549 1.75 1.20 +#> 6 6 0.643 2.14 1.50 +#> 7 7 0.785 1 0.215 +#> 8 8 0.828 1 0.172 +#> 9 9 1.09 1.08 0.163 +#> 10 10 0.858 1.33 0.475 +#> 11 11 1.40 0.909 0.494 +#> 12 12 1.41 1.33 0.739 +#> 13 13 1.72 0.846 0.878 +#> 14 14 1.25 1 0.254 +#> 15 15 1.87 1.44 1.32 los_ra_index_summary_tbl( .data = data_tbl @@ -183,16 +183,16 @@

Examples#> # A tibble: 10 × 4 #> los_group los_index rar_index los_ra_var #> <dbl> <dbl> <dbl> <dbl> -#> 1 1 0.114 0.833 1.05 -#> 2 2 0.264 1.08 0.820 -#> 3 3 0.327 2.14 1.82 -#> 4 4 0.382 1.2 0.818 -#> 5 5 0.590 1.5 0.910 -#> 6 6 0.527 0.818 0.655 -#> 7 7 0.704 1.27 0.569 -#> 8 8 0.698 1.33 0.635 -#> 9 9 1.01 0.917 0.0951 -#> 10 10 1.67 1 0.673 +#> 1 1 0.0964 1.18 1.09 +#> 2 2 0.208 1.08 0.875 +#> 3 3 0.471 1.09 0.620 +#> 4 4 0.368 1.25 0.882 +#> 5 5 0.549 1.75 1.20 +#> 6 6 0.643 2.14 1.50 +#> 7 7 0.785 1 0.215 +#> 8 8 0.828 1 0.172 +#> 9 9 1.09 1.08 0.163 +#> 10 10 1.53 1.2 0.729

diff --git a/docs/reference/named_item_list.html b/docs/reference/named_item_list.html index 20236f6..f69169e 100644 --- a/docs/reference/named_item_list.html +++ b/docs/reference/named_item_list.html @@ -1,9 +1,9 @@ Tibble to named list — named_item_list • healthyRTibble to named list — named_item_list • healthyR @@ -56,7 +56,7 @@
diff --git a/docs/reference/opt_bin.html b/docs/reference/opt_bin.html index 521a2cd..cfa760c 100644 --- a/docs/reference/opt_bin.html +++ b/docs/reference/opt_bin.html @@ -1,7 +1,7 @@ Get the optimal binwidth for a histogram — opt_bin • healthyR @@ -54,7 +54,7 @@ diff --git a/docs/reference/pipe.html b/docs/reference/pipe.html index fec520a..383f431 100644 --- a/docs/reference/pipe.html +++ b/docs/reference/pipe.html @@ -1,5 +1,5 @@ -Pipe operator — %>% • healthyRPipe operator — %>% • healthyR @@ -52,7 +52,7 @@
diff --git a/docs/reference/px_cc_mapping.html b/docs/reference/px_cc_mapping.html index 71e78b4..3473b0c 100644 --- a/docs/reference/px_cc_mapping.html +++ b/docs/reference/px_cc_mapping.html @@ -1,7 +1,7 @@ Procedure to Condition Code Mapping file — px_cc_mapping • healthyR @@ -54,7 +54,7 @@
diff --git a/docs/reference/save_to_excel.html b/docs/reference/save_to_excel.html index 77e76c6..885956f 100644 --- a/docs/reference/save_to_excel.html +++ b/docs/reference/save_to_excel.html @@ -1,9 +1,9 @@ Save a file to Excel — save_to_excel • healthyRSave a file to Excel — save_to_excel • healthyR @@ -56,7 +56,7 @@
diff --git a/docs/reference/service_line_augment.html b/docs/reference/service_line_augment.html index d0ce495..ac40c6b 100644 --- a/docs/reference/service_line_augment.html +++ b/docs/reference/service_line_augment.html @@ -1,7 +1,7 @@ Service Line Grouper Augment Function — service_line_augment • healthyR @@ -54,7 +54,7 @@
diff --git a/docs/reference/service_line_vec.html b/docs/reference/service_line_vec.html index 66aa0f5..30b2f7b 100644 --- a/docs/reference/service_line_vec.html +++ b/docs/reference/service_line_vec.html @@ -1,7 +1,7 @@ Service Line Grouper Vectorized Function — service_line_vec • healthyR @@ -54,7 +54,7 @@
diff --git a/docs/reference/sql_left.html b/docs/reference/sql_left.html index ca98c76..01d04df 100644 --- a/docs/reference/sql_left.html +++ b/docs/reference/sql_left.html @@ -1,5 +1,5 @@ -Use SQL LEFT type function — sql_left • healthyRUse SQL LEFT type function — sql_left • healthyR @@ -52,7 +52,7 @@
diff --git a/docs/reference/sql_mid.html b/docs/reference/sql_mid.html index 79855fb..90573e7 100644 --- a/docs/reference/sql_mid.html +++ b/docs/reference/sql_mid.html @@ -1,5 +1,5 @@ -Use SQL MID type function — sql_mid • healthyRUse SQL MID type function — sql_mid • healthyR @@ -52,7 +52,7 @@
diff --git a/docs/reference/sql_right.html b/docs/reference/sql_right.html index ad5d7de..316a138 100644 --- a/docs/reference/sql_right.html +++ b/docs/reference/sql_right.html @@ -1,5 +1,5 @@ -Use SQL RIGHT type functions — sql_right • healthyRUse SQL RIGHT type functions — sql_right • healthyR @@ -52,7 +52,7 @@
diff --git a/docs/reference/tidyeval.html b/docs/reference/tidyeval.html index d778cc1..21599e3 100644 --- a/docs/reference/tidyeval.html +++ b/docs/reference/tidyeval.html @@ -30,7 +30,7 @@ To learn more about tidy eval and how to use these tools, visit Metaprogramming -section of Advanced R.">Tidy eval helpers — tidyeval • healthyRTidy eval helpers — tidyeval • healthyR @@ -114,7 +114,7 @@
diff --git a/docs/reference/top_n_tbl.html b/docs/reference/top_n_tbl.html index 0261aa5..5aaccb8 100644 --- a/docs/reference/top_n_tbl.html +++ b/docs/reference/top_n_tbl.html @@ -1,7 +1,7 @@ Top N tibble — top_n_tbl • healthyR @@ -54,7 +54,7 @@
diff --git a/docs/reference/ts_alos_plt.html b/docs/reference/ts_alos_plt.html index 141fbec..58277c4 100644 --- a/docs/reference/ts_alos_plt.html +++ b/docs/reference/ts_alos_plt.html @@ -1,5 +1,5 @@ -Plot ALOS - Average Length of Stay — ts_alos_plt • healthyRPlot ALOS - Average Length of Stay — ts_alos_plt • healthyR @@ -52,7 +52,7 @@
diff --git a/docs/reference/ts_census_los_daily_tbl.html b/docs/reference/ts_census_los_daily_tbl.html index f02f5b3..e5e6c8c 100644 --- a/docs/reference/ts_census_los_daily_tbl.html +++ b/docs/reference/ts_census_los_daily_tbl.html @@ -9,7 +9,7 @@ If you have a record where the .start_date_col is filled in but the corresponding end_date is null then the end date will be set equal to Sys.Date() If a record has a start_date that is NA then it will be discarded. -This function can take a little bit of time to run while the join comparison runs.">Time Series - Census and LOS by Day — ts_census_los_daily_tbl • healthyRTime Series - Census and LOS by Day — ts_census_los_daily_tbl • healthyR @@ -72,7 +72,7 @@
diff --git a/docs/reference/ts_median_excess_plt.html b/docs/reference/ts_median_excess_plt.html index 8d5344e..b658f34 100644 --- a/docs/reference/ts_median_excess_plt.html +++ b/docs/reference/ts_median_excess_plt.html @@ -1,5 +1,5 @@ -Create a plot showing the excess of the median value — ts_median_excess_plt • healthyRCreate a plot showing the excess of the median value — ts_median_excess_plt • healthyR @@ -52,7 +52,7 @@
diff --git a/docs/reference/ts_plt.html b/docs/reference/ts_plt.html index 3f547d8..d1a1f93 100644 --- a/docs/reference/ts_plt.html +++ b/docs/reference/ts_plt.html @@ -1,9 +1,9 @@ Time Series Plot — ts_plt • healthyRTime Series Plot — ts_plt • healthyR @@ -56,7 +56,7 @@
diff --git a/docs/reference/ts_readmit_rate_plt.html b/docs/reference/ts_readmit_rate_plt.html index 6081d1b..ec2892b 100644 --- a/docs/reference/ts_readmit_rate_plt.html +++ b/docs/reference/ts_readmit_rate_plt.html @@ -1,5 +1,5 @@ -Plot Readmit Rate — ts_readmit_rate_plt • healthyRPlot Readmit Rate — ts_readmit_rate_plt • healthyR @@ -52,7 +52,7 @@
diff --git a/docs/reference/ts_signature_tbl.html b/docs/reference/ts_signature_tbl.html index 5fa60e2..7b75afa 100644 --- a/docs/reference/ts_signature_tbl.html +++ b/docs/reference/ts_signature_tbl.html @@ -1,9 +1,9 @@ Make a Time Enhanced Tibble — ts_signature_tbl • healthyRMake a Time Enhanced Tibble — ts_signature_tbl • healthyR @@ -56,7 +56,7 @@
diff --git a/docs/search.json b/docs/search.json index ac260f2..8b725cf 100644 --- a/docs/search.json +++ b/docs/search.json @@ -1 +1 @@ -[{"path":"https://www.spsanderson.com/healthyR/articles/getting-started.html","id":"libaray-load","dir":"Articles","previous_headings":"","what":"Libaray Load","title":"Getting Started with healthyR","text":"First things first, lets load library:","code":"library(healthyR) library(healthyR.data) library(timetk) library(dplyr) library(purrr)"},{"path":"https://www.spsanderson.com/healthyR/articles/getting-started.html","id":"generate-sample-data","dir":"Articles","previous_headings":"","what":"Generate Sample Data","title":"Getting Started with healthyR","text":"First going take look time series plotting functions. fairly straight forward therefore seem intuitive. going generate random numbers simulate different daily average length stay data. set seed reproducibility.","code":"# Get Length of Stay Data data_tbl <- healthyR_data df_tbl <- data_tbl %>% filter(ip_op_flag == \"I\") %>% select(visit_end_date_time, length_of_stay) %>% summarise_by_time( .date_var = visit_end_date_time , .by = \"day\" , visits = mean(length_of_stay, na.rm = TRUE) ) %>% filter_by_time( .date_var = visit_end_date_time , .start_date = \"2012\" , .end_date = \"2019\" ) %>% set_names(\"Date\",\"Values\")"},{"path":"https://www.spsanderson.com/healthyR/articles/getting-started.html","id":"plot-the-time-series","dir":"Articles","previous_headings":"","what":"Plot the Time Series","title":"Getting Started with healthyR","text":"Now data lets see easy generate ALOS chart: .interactive option set TRUE: can see, function ability return either static plot interactive plot. hood using timetk::plot_time_series function. can find timetk function . end first quick tutorial ts_alos_plt function.","code":"ts_alos_plt( .data = df_tbl , .date_col = Date , .value_col = Values , .by = \"month\" , .interactive = FALSE ) ts_alos_plt( .data = df_tbl , .date_col = Date , .value_col = Values , .by = \"month\" , .interactive = TRUE )"},{"path":"https://www.spsanderson.com/healthyR/articles/kmeans-umap.html","id":"libaray-load","dir":"Articles","previous_headings":"","what":"Libaray Load","title":"Clustering with K-Means and UMAP","text":"First things first, lets load library:","code":"library(healthyR)"},{"path":"https://www.spsanderson.com/healthyR/articles/kmeans-umap.html","id":"information","dir":"Articles","previous_headings":"","what":"Information","title":"Clustering with K-Means and UMAP","text":"K-Means partion algorithm initially designed signal processing. goal partition n observations k clusters n k. unsupervised k-means algorithm loose relationship k-nearest neighbor classifier, popular supervised machine learning technique classification often confused k-means due name. Applying 1-nearest neighbor classifier cluster centers obtained k-means classifies new data existing clusters. aim vignette showcase use healthyR wrapper kmeans function wrapper plot uwot::umap projection function. go entire workflow getting data getting fina UMAP plot.","code":""},{"path":"https://www.spsanderson.com/healthyR/articles/kmeans-umap.html","id":"generate-some-data","dir":"Articles","previous_headings":"","what":"Generate some data","title":"Clustering with K-Means and UMAP","text":"Now data need generate called user item table. use function kmeans_user_item_tbl takes just arguments. purpose user item table aggregate normalize data users items. data generated going look clustering amongst service_lines (user) payer_grouping (item) columns. Lets now create user item table.","code":"library(healthyR.data) library(dplyr) library(broom) library(ggplot2) data_tbl <- healthyR_data %>% filter(ip_op_flag == \"I\") %>% filter(payer_grouping != \"Medicare B\") %>% filter(payer_grouping != \"?\") %>% select(service_line, payer_grouping) %>% mutate(record = 1) %>% as_tibble() data_tbl %>% glimpse() #> Rows: 116,823 #> Columns: 3 #> $ service_line \"Medical\", \"Schizophrenia\", \"Syncope\", \"Pneumonia\", \"Ch… #> $ payer_grouping \"Blue Cross\", \"Medicare A\", \"Medicare A\", \"Medicare A\",… #> $ record 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1…"},{"path":"https://www.spsanderson.com/healthyR/articles/kmeans-umap.html","id":"user-item-tibble","dir":"Articles","previous_headings":"","what":"User Item Tibble","title":"Clustering with K-Means and UMAP","text":"table aggregated item various users algorithm applied. Now data need find optimal k (clusters). need generate table data column k k apply k-means function data k return total within sum squares. convienent function called kmeans_mapped_tbl takes sole argument output kmeans_user_item_tbl. argument .centers default set 15.","code":"uit_tbl <- kmeans_user_item_tbl(data_tbl, service_line, payer_grouping, record) uit_tbl #> # A tibble: 23 × 12 #> service_line Blue …¹ Comme…² Compe…³ Excha…⁴ HMO Medic…⁵ Medic…⁶ Medic…⁷ #> #> 1 Alcohol Abuse 0.0941 0.0321 5.25e-4 0.0116 0.0788 0.158 0.367 0.173 #> 2 Bariatric Sur… 0.317 0.0583 0 0.0518 0.168 0.00324 0.343 0.0485 #> 3 Carotid Endar… 0.0845 0.0282 0 0 0.0141 0 0.0282 0.648 #> 4 Cellulitis 0.110 0.0339 1.18e-2 0.00847 0.0805 0.0869 0.192 0.355 #> 5 Chest Pain 0.144 0.0391 2.90e-3 0.00543 0.112 0.0522 0.159 0.324 #> 6 CHF 0.0295 0.00958 5.18e-4 0.00414 0.0205 0.0197 0.0596 0.657 #> 7 COPD 0.0493 0.0228 2.28e-4 0.00548 0.0342 0.0461 0.172 0.520 #> 8 CVA 0.0647 0.0246 1.07e-3 0.0107 0.0524 0.0289 0.0764 0.555 #> 9 GI Hemorrhage 0.0542 0.0175 1.25e-3 0.00834 0.0480 0.0350 0.0855 0.588 #> 10 Joint Replace… 0.139 0.0179 3.36e-2 0.00673 0.0516 0 0.0874 0.5 #> # … with 13 more rows, 3 more variables: `Medicare HMO` , #> # `No Fault` , `Self Pay` , and abbreviated variable names #> # ¹​`Blue Cross`, ²​Commercial, ³​Compensation, ⁴​`Exchange Plans`, ⁵​Medicaid, #> # ⁶​`Medicaid HMO`, ⁷​`Medicare A` #> # ℹ Use `print(n = ...)` to see more rows, and `colnames()` to see all variable names"},{"path":"https://www.spsanderson.com/healthyR/articles/kmeans-umap.html","id":"k-means-mapped-tibble","dir":"Articles","previous_headings":"","what":"K-Means Mapped Tibble","title":"Clustering with K-Means and UMAP","text":"see three columns, centers, k_means glance. k_means column k_means list object glance tibble returned broom::glance function. stated use tot.withinss decide become k, easy way visualize Scree Plot, also known elbow plot. done ploting x-axis centers y-axis tot.withinss.","code":"kmm_tbl <- kmeans_mapped_tbl(uit_tbl) kmm_tbl #> # A tibble: 15 × 3 #> centers k_means glance #> #> 1 1 #> 2 2 #> 3 3 #> 4 4 #> 5 5 #> 6 6 #> 7 7 #> 8 8 #> 9 9 #> 10 10 #> 11 11 #> 12 12 #> 13 13 #> 14 14 #> 15 15 kmm_tbl %>% tidyr::unnest(glance) #> # A tibble: 15 × 6 #> centers k_means totss tot.withinss betweenss iter #> #> 1 1 1.41 1.41 1.33e-15 1 #> 2 2 1.41 0.592 8.17e- 1 1 #> 3 3 1.41 0.372 1.04e+ 0 2 #> 4 4 1.41 0.276 1.13e+ 0 2 #> 5 5 1.41 0.202 1.21e+ 0 2 #> 6 6 1.41 0.159 1.25e+ 0 4 #> 7 7 1.41 0.124 1.28e+ 0 3 #> 8 8 1.41 0.0884 1.32e+ 0 2 #> 9 9 1.41 0.0745 1.33e+ 0 3 #> 10 10 1.41 0.0576 1.35e+ 0 3 #> 11 11 1.41 0.0460 1.36e+ 0 2 #> 12 12 1.41 0.0363 1.37e+ 0 3 #> 13 13 1.41 0.0272 1.38e+ 0 2 #> 14 14 1.41 0.0202 1.39e+ 0 3 #> 15 15 1.41 0.0164 1.39e+ 0 2"},{"path":"https://www.spsanderson.com/healthyR/articles/kmeans-umap.html","id":"scree-plot-and-data","dir":"Articles","previous_headings":"","what":"Scree Plot and Data","title":"Clustering with K-Means and UMAP","text":"want see scree plot data creates plot can use another function kmeans_scree_data_tbl. pieces information can decide upon value k, instance going use 3. Now can go ahead creating umap list object can take look great many things associated data.","code":"kmeans_scree_plt(.data = kmm_tbl) kmeans_scree_data_tbl(kmm_tbl) #> # A tibble: 15 × 2 #> centers tot.withinss #> #> 1 1 1.41 #> 2 2 0.592 #> 3 3 0.372 #> 4 4 0.276 #> 5 5 0.202 #> 6 6 0.159 #> 7 7 0.124 #> 8 8 0.0884 #> 9 9 0.0745 #> 10 10 0.0576 #> 11 11 0.0460 #> 12 12 0.0363 #> 13 13 0.0272 #> 14 14 0.0202 #> 15 15 0.0164"},{"path":"https://www.spsanderson.com/healthyR/articles/kmeans-umap.html","id":"umap-list-object","dir":"Articles","previous_headings":"","what":"UMAP List Object","title":"Clustering with K-Means and UMAP","text":"Now lets go ahead create UMAP list object. Now created, lets take look item list. umap_list function returns list 5 items. umap_obj umap_results_tbl kmeans_obj kmeans_cluster_tbl umap_kmeans_cluster_results_tbl Since list object can now inspect kmeans_obj, first thing use kmeans_tidy_tbl function inspect things.","code":"ump_lst <- umap_list(.data = uit_tbl, kmm_tbl, 3) km_obj <- ump_lst$kmeans_obj kmeans_tidy_tbl(.kmeans_obj = km_obj, .data = uit_tbl, .tidy_type = \"glance\") #> # A tibble: 1 × 4 #> totss tot.withinss betweenss iter #> #> 1 1.41 0.372 1.04 2 kmeans_tidy_tbl(km_obj, uit_tbl, \"augment\") #> # A tibble: 23 × 2 #> service_line cluster #> #> 1 Alcohol Abuse 3 #> 2 Bariatric Surgery For Obesity 3 #> 3 Carotid Endarterectomy 1 #> 4 Cellulitis 2 #> 5 Chest Pain 2 #> 6 CHF 1 #> 7 COPD 1 #> 8 CVA 1 #> 9 GI Hemorrhage 1 #> 10 Joint Replacement 1 #> # … with 13 more rows #> # ℹ Use `print(n = ...)` to see more rows kmeans_tidy_tbl(km_obj, uit_tbl, \"tidy\") #> # A tibble: 3 × 14 #> Blue …¹ Comme…² Compe…³ Excha…⁴ HMO Medic…⁵ Medic…⁶ Medic…⁷ Medic…⁸ No Fa…⁹ #> #> 1 0.0784 0.0218 4.32e-3 0.00620 0.0449 0.0368 0.0800 0.563 0.152 0.00348 #> 2 0.117 0.0314 1.02e-2 0.0139 0.0982 0.0856 0.147 0.354 0.105 0.00707 #> 3 0.150 0.0368 3.07e-4 0.0207 0.163 0.131 0.314 0.132 0.0319 0.00136 #> # … with 4 more variables: `Self Pay` , size , withinss , #> # cluster , and abbreviated variable names ¹​`Blue Cross`, ²​Commercial, #> # ³​Compensation, ⁴​`Exchange Plans`, ⁵​Medicaid, ⁶​`Medicaid HMO`, #> # ⁷​`Medicare A`, ⁸​`Medicare HMO`, ⁹​`No Fault` #> # ℹ Use `colnames()` to see all variable names"},{"path":"https://www.spsanderson.com/healthyR/articles/kmeans-umap.html","id":"umap-plot","dir":"Articles","previous_headings":"","what":"UMAP Plot","title":"Clustering with K-Means and UMAP","text":"Now data can visualize clusters colored cluster number.","code":"umap_plt(.data = ump_lst, .point_size = 3, TRUE)"},{"path":"https://www.spsanderson.com/healthyR/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Steven Sanderson. Author, maintainer, copyright holder.","code":""},{"path":"https://www.spsanderson.com/healthyR/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Sanderson S (2023). healthyR: Hospital Data Analysis Workflow Tools. R package version 0.2.1.9000, https://github.com/spsanderson/healthyR.","code":"@Manual{, title = {healthyR: Hospital Data Analysis Workflow Tools}, author = {Steven Sanderson}, year = {2023}, note = {R package version 0.2.1.9000}, url = {https://github.com/spsanderson/healthyR}, }"},{"path":[]},{"path":"https://www.spsanderson.com/healthyR/CODE_OF_CONDUCT.html","id":"our-pledge","dir":"","previous_headings":"","what":"Our Pledge","title":"Contributor Covenant Code of Conduct","text":"interest fostering open welcoming environment, contributors maintainers pledge making participation project community harassment-free experience everyone, regardless age, body size, disability, ethnicity, sex characteristics, gender identity expression, level experience, education, socio-economic status, nationality, personal appearance, race, religion, sexual identity orientation.","code":""},{"path":"https://www.spsanderson.com/healthyR/CODE_OF_CONDUCT.html","id":"our-standards","dir":"","previous_headings":"","what":"Our Standards","title":"Contributor Covenant Code of Conduct","text":"Examples behavior contributes creating positive environment include: Using welcoming inclusive language respectful differing viewpoints experiences Gracefully accepting constructive criticism Focusing best community Showing empathy towards community members Examples unacceptable behavior participants include: use sexualized language imagery unwelcome sexual attention advances Trolling, insulting/derogatory comments, personal political attacks Public private harassment Publishing others’ private information, physical electronic address, without explicit permission conduct reasonably considered inappropriate professional setting","code":""},{"path":"https://www.spsanderson.com/healthyR/CODE_OF_CONDUCT.html","id":"our-responsibilities","dir":"","previous_headings":"","what":"Our Responsibilities","title":"Contributor Covenant Code of Conduct","text":"Project maintainers responsible clarifying standards acceptable behavior expected take appropriate fair corrective action response instances unacceptable behavior. Project maintainers right responsibility remove, edit, reject comments, commits, code, wiki edits, issues, contributions aligned Code Conduct, ban temporarily permanently contributor behaviors deem inappropriate, threatening, offensive, harmful.","code":""},{"path":"https://www.spsanderson.com/healthyR/CODE_OF_CONDUCT.html","id":"scope","dir":"","previous_headings":"","what":"Scope","title":"Contributor Covenant Code of Conduct","text":"Code Conduct applies within project spaces public spaces individual representing project community. Examples representing project community include using official project e-mail address, posting via official social media account, acting appointed representative online offline event. Representation project may defined clarified project maintainers.","code":""},{"path":"https://www.spsanderson.com/healthyR/CODE_OF_CONDUCT.html","id":"enforcement","dir":"","previous_headings":"","what":"Enforcement","title":"Contributor Covenant Code of Conduct","text":"Instances abusive, harassing, otherwise unacceptable behavior may reported contacting project team support@spsanderson.com. complaints reviewed investigated result response deemed necessary appropriate circumstances. project team obligated maintain confidentiality regard reporter incident. details specific enforcement policies may posted separately. Project maintainers follow enforce Code Conduct good faith may face temporary permanent repercussions determined members project’s leadership.","code":""},{"path":"https://www.spsanderson.com/healthyR/CODE_OF_CONDUCT.html","id":"attribution","dir":"","previous_headings":"","what":"Attribution","title":"Contributor Covenant Code of Conduct","text":"Code Conduct adapted Contributor Covenant, version 1.4, available https://www.contributor-covenant.org/version/1/4/code--conduct.html answers common questions code conduct, see https://www.contributor-covenant.org/faq","code":""},{"path":"https://www.spsanderson.com/healthyR/index.html","id":"healthyr-","dir":"","previous_headings":"","what":"Hospital Data Analysis Workflow Tools","title":"Hospital Data Analysis Workflow Tools","text":"goal healthyR help quickly analyze common data problems Administrative Clincial spaces.","code":""},{"path":"https://www.spsanderson.com/healthyR/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Hospital Data Analysis Workflow Tools","text":"can install released version healthyR CRAN : development version GitHub :","code":"install.packages(\"healthyR\") # install.packages(\"devtools\") devtools::install_github(\"spsanderson/healthyR\")"},{"path":"https://www.spsanderson.com/healthyR/index.html","id":"example","dir":"","previous_headings":"","what":"Example","title":"Hospital Data Analysis Workflow Tools","text":"basic example using ts_median_excess_plt() function`: simple example using ts_signature_tbl() function: simple example using plt_gartner_magic_chart() function:","code":"library(healthyR) library(timetk) library(dplyr) ts_signature_tbl(.data = m4_daily, .date_col = date, .pad_time = TRUE, id) %>% ts_median_excess_plt( .date_col = date , .value_col = value , .x_axis = week , .ggplot_group_var = year , .years_back = 5 ) library(healthyR) library(timetk) ts_signature_tbl(.data = m4_daily, .date_col = date) #> # A tibble: 17,578 × 31 #> id date value index.num diff year year.iso half quarter month #> #> 1 D410 1978-06-23 9109. 267408000 NA 1978 1978 1 2 6 #> 2 D410 1978-06-24 9103. 267494400 86400 1978 1978 1 2 6 #> 3 D410 1978-06-25 9116. 267580800 86400 1978 1978 1 2 6 #> 4 D410 1978-06-26 9116. 267667200 86400 1978 1978 1 2 6 #> 5 D410 1978-06-27 9106. 267753600 86400 1978 1978 1 2 6 #> 6 D410 1978-06-28 9094. 267840000 86400 1978 1978 1 2 6 #> 7 D410 1978-06-29 9094. 267926400 86400 1978 1978 1 2 6 #> 8 D410 1978-06-30 9084. 268012800 86400 1978 1978 1 2 6 #> 9 D410 1978-07-01 9081. 268099200 86400 1978 1978 2 3 7 #> 10 D410 1978-07-02 9047. 268185600 86400 1978 1978 2 3 7 #> # ℹ 17,568 more rows #> # ℹ 21 more variables: month.xts , month.lbl , day , hour , #> # minute , second , hour12 , am.pm , wday , #> # wday.xts , wday.lbl , mday , qday , yday , #> # mweek , week , week.iso , week2 , week3 , #> # week4 , mday7 suppressPackageStartupMessages(library(healthyR)) suppressPackageStartupMessages(library(tibble)) suppressPackageStartupMessages(library(dplyr)) gartner_magic_chart_plt( .data = tibble(x = rnorm(100, 0, 1), y = rnorm(100, 0, 1)) , .x_col = x , .y_col = y , .y_lab = \"los\" , .x_lab = \"RA\" , .plt_title = \"Test Title\" , .tl_lbl = \"Top Left lbl\" , .tr_lbl = \"Top Right lbl\" , .bl_lbl = \"Bottom Left lbl\" , .br_lbl = \"Bottom Right lbl\" )"},{"path":"https://www.spsanderson.com/healthyR/LICENSE.html","id":null,"dir":"","previous_headings":"","what":"MIT License","title":"MIT License","text":"Copyright (c) 2020 Steven Paul Sanderson II Permission hereby granted, free charge, person obtaining copy software associated documentation files (“Software”), deal Software without restriction, including without limitation rights use, copy, modify, merge, publish, distribute, sublicense, /sell copies Software, permit persons Software furnished , subject following conditions: copyright notice permission notice shall included copies substantial portions Software. SOFTWARE PROVIDED “”, WITHOUT WARRANTY KIND, EXPRESS IMPLIED, INCLUDING LIMITED WARRANTIES MERCHANTABILITY, FITNESS PARTICULAR PURPOSE NONINFRINGEMENT. EVENT SHALL AUTHORS COPYRIGHT HOLDERS LIABLE CLAIM, DAMAGES LIABILITY, WHETHER ACTION CONTRACT, TORT OTHERWISE, ARISING , CONNECTION SOFTWARE USE DEALINGS SOFTWARE.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/category_counts_tbl.html","id":null,"dir":"Reference","previous_headings":"","what":"Counts by Category — category_counts_tbl","title":"Counts by Category — category_counts_tbl","text":"Get counts column particular grouping supplied, otherwise just get counts column.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/category_counts_tbl.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Counts by Category — category_counts_tbl","text":"","code":"category_counts_tbl(.data, .count_col, .arrange_value = TRUE, ...)"},{"path":"https://www.spsanderson.com/healthyR/reference/category_counts_tbl.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Counts by Category — category_counts_tbl","text":".data data.frame/tibble supplied. .count_col column values want count. .arrange_value Defaults true, arrange resulting tibble descending order .count_col ... Place values want pass grouping .","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/category_counts_tbl.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Counts by Category — category_counts_tbl","text":"Requires data.frame/tibble. Requires value column, column going counted.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/category_counts_tbl.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Counts by Category — category_counts_tbl","text":"Steven P. Sanderson II, MPH","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/category_counts_tbl.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Counts by Category — category_counts_tbl","text":"","code":"library(healthyR.data) #> #> == Welcome to healthyR.data =========================================================================== #> If you find this package useful, please leave a star: #> https://github.com/spsanderson/healthyR.data' #> #> If you encounter a bug or want to request an enhancement please file an issue at: #> https://github.com/spsanderson/healthyR.data/issues #> #> Thank you for using healthyR.data library(dplyr) #> Warning: package 'dplyr' was built under R version 4.2.3 #> #> Attaching package: 'dplyr' #> The following objects are masked from 'package:stats': #> #> filter, lag #> The following objects are masked from 'package:base': #> #> intersect, setdiff, setequal, union healthyR_data %>% category_counts_tbl( .count_col = payer_grouping , .arrange = TRUE , ip_op_flag ) #> # A tibble: 25 × 3 #> ip_op_flag payer_grouping n #> #> 1 I Medicare A 52621 #> 2 O Medicare B 22270 #> 3 I Medicaid HMO 15466 #> 4 I Medicare HMO 13572 #> 5 O Blue Cross 13560 #> 6 I Blue Cross 10797 #> 7 O Medicaid HMO 10018 #> 8 O HMO 9331 #> 9 I HMO 8113 #> 10 I Medicaid 7131 #> # ℹ 15 more rows healthyR_data %>% category_counts_tbl( .count_col = ip_op_flag , .arrange_value = TRUE , service_line ) #> # A tibble: 30 × 3 #> service_line ip_op_flag n #> #> 1 Medical I 64435 #> 2 General Outpatient O 50526 #> 3 Surgical I 14916 #> 4 Colonoscopy/Endoscopy O 11486 #> 5 Cataract Removal O 4930 #> 6 COPD I 4398 #> 7 CHF I 3871 #> 8 Pneumonia I 3323 #> 9 Cellulitis I 3311 #> 10 Major Depression/Bipolar Affective Disorders I 2866 #> # ℹ 20 more rows"},{"path":"https://www.spsanderson.com/healthyR/reference/color_blind.html","id":null,"dir":"Reference","previous_headings":"","what":"Provide Colorblind Compliant Colors — color_blind","title":"Provide Colorblind Compliant Colors — color_blind","text":"8 Hex RGB color definitions suitable charts colorblind people.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/color_blind.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Provide Colorblind Compliant Colors — color_blind","text":"","code":"color_blind()"},{"path":"https://www.spsanderson.com/healthyR/reference/color_blind.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Provide Colorblind Compliant Colors — color_blind","text":"vector 8 Hex RGB definitions.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/color_blind.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Provide Colorblind Compliant Colors — color_blind","text":"function used others order help render plots color blind.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/color_blind.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Provide Colorblind Compliant Colors — color_blind","text":"Steven P. Sanderson II, MPH","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/color_blind.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Provide Colorblind Compliant Colors — color_blind","text":"","code":"color_blind() #> [1] \"#000000\" \"#E69F00\" \"#56B4E9\" \"#009E73\" \"#F0E442\" \"#0072B2\" \"#D55E00\" #> [8] \"#CC79A7\""},{"path":"https://www.spsanderson.com/healthyR/reference/diverging_bar_plt.html","id":null,"dir":"Reference","previous_headings":"","what":"Diverging Bar Chart — diverging_bar_plt","title":"Diverging Bar Chart — diverging_bar_plt","text":"Diverging Bars bar chart can handle negative positive values. can implemented smart tweak geom_bar(). usage geom_bar() can quite confusing. , can used make bar chart well histogram. Let explain. default, geom_bar() stat set count. means, provide just continuous X variable (Y variable), tries make histogram data. order make bar chart create bars instead histogram, need two things. Set stat = identity provide x y inside aes() , x either character factor y numeric. order make sure get diverging bars instead just bars, make sure, categorical variable 2 categories changes values certain threshold continuous variable. example, mpg mtcars data set normalized computing z score. vehicles mpg zero marked green marked red.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/diverging_bar_plt.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Diverging Bar Chart — diverging_bar_plt","text":"","code":"diverging_bar_plt( .data, .x_axis, .y_axis, .fill_col, .plot_title = NULL, .plot_subtitle = NULL, .plot_caption = NULL, .interactive = FALSE )"},{"path":"https://www.spsanderson.com/healthyR/reference/diverging_bar_plt.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Diverging Bar Chart — diverging_bar_plt","text":".data data pass function, must tibble/data.frame. .x_axis data passed x-axis. .y_axis data passed y-axis. also equal parameter label .fill_col column used fill color bars. .plot_title Default NULL .plot_subtitle Default NULL .plot_caption Default NULL .interactive Default FALSE. TRUE returns plotly plot","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/diverging_bar_plt.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Diverging Bar Chart — diverging_bar_plt","text":"plotly plot ggplot2 static plot","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/diverging_bar_plt.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Diverging Bar Chart — diverging_bar_plt","text":"function takes arguments returns ggplot2 object.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/diverging_bar_plt.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Diverging Bar Chart — diverging_bar_plt","text":"Steven P. Sanderson II, MPH","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/diverging_bar_plt.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Diverging Bar Chart — diverging_bar_plt","text":"","code":"suppressPackageStartupMessages(library(ggplot2)) data(\"mtcars\") mtcars$car_name <- rownames(mtcars) mtcars$mpg_z <- round((mtcars$mpg - mean(mtcars$mpg))/sd(mtcars$mpg), 2) mtcars$mpg_type <- ifelse(mtcars$mpg_z < 0, \"below\", \"above\") mtcars <- mtcars[order(mtcars$mpg_z), ] # sort mtcars$car_name <- factor(mtcars$car_name, levels = mtcars$car_name) diverging_bar_plt( .data = mtcars , .x_axis = car_name , .y_axis = mpg_z , .fill_col = mpg_type , .interactive = FALSE )"},{"path":"https://www.spsanderson.com/healthyR/reference/diverging_lollipop_plt.html","id":null,"dir":"Reference","previous_headings":"","what":"Diverging Lollipop Chart — diverging_lollipop_plt","title":"Diverging Lollipop Chart — diverging_lollipop_plt","text":"diverging lollipop function. Lollipop chart conveys information bar chart diverging bar. Except looks modern. Instead geom_bar, use geom_point geom_segment get lollipops right. Let’s draw lollipop using data prepared previous example diverging bars.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/diverging_lollipop_plt.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Diverging Lollipop Chart — diverging_lollipop_plt","text":"","code":"diverging_lollipop_plt( .data, .x_axis, .y_axis, .plot_title = NULL, .plot_subtitle = NULL, .plot_caption = NULL, .interactive = FALSE )"},{"path":"https://www.spsanderson.com/healthyR/reference/diverging_lollipop_plt.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Diverging Lollipop Chart — diverging_lollipop_plt","text":".data data pass function, must tibble/data.frame. .x_axis data passed x-axis. also x xend parameters geom_segment .y_axis data passed y-axis. also equal parameters yend label .plot_title Default NULL .plot_subtitle Default NULL .plot_caption Default NULL .interactive Default FALSE. TRUE returns plotly plot","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/diverging_lollipop_plt.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Diverging Lollipop Chart — diverging_lollipop_plt","text":"plotly plot ggplot2 static plot","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/diverging_lollipop_plt.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Diverging Lollipop Chart — diverging_lollipop_plt","text":"function takes arguments returns ggplot2 object.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/diverging_lollipop_plt.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Diverging Lollipop Chart — diverging_lollipop_plt","text":"Steven P. Sanderson II, MPH","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/diverging_lollipop_plt.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Diverging Lollipop Chart — diverging_lollipop_plt","text":"","code":"suppressPackageStartupMessages(library(ggplot2)) data(\"mtcars\") mtcars$car_name <- rownames(mtcars) mtcars$mpg_z <- round((mtcars$mpg - mean(mtcars$mpg))/sd(mtcars$mpg), 2) mtcars$mpg_type <- ifelse(mtcars$mpg_z < 0, \"below\", \"above\") mtcars <- mtcars[order(mtcars$mpg_z), ] # sort mtcars$car_name <- factor(mtcars$car_name, levels = mtcars$car_name) diverging_lollipop_plt(.data = mtcars, .x_axis = car_name , .y_axis = mpg_z)"},{"path":"https://www.spsanderson.com/healthyR/reference/dx_cc_mapping.html","id":null,"dir":"Reference","previous_headings":"","what":"Diagnosis to Condition Code Mapping file — dx_cc_mapping","title":"Diagnosis to Condition Code Mapping file — dx_cc_mapping","text":"dataset containing Diagnosis Code AHRQ Condition Code Mapping used helping define service lines inpatient discharges.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/dx_cc_mapping.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Diagnosis to Condition Code Mapping file — dx_cc_mapping","text":"","code":"data(dx_cc_mapping)"},{"path":"https://www.spsanderson.com/healthyR/reference/dx_cc_mapping.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Diagnosis to Condition Code Mapping file — dx_cc_mapping","text":"data frame 86852 rows 5 variables","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/dx_cc_mapping.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Diagnosis to Condition Code Mapping file — dx_cc_mapping","text":"CC_Code. DX_1, DX_2, ..., DX_n CC_Desc. DX_1 = Conduction disorders, DX_n = description ICD_Ver_Flag. ICD Version 10 9 ICDCode. ICD-9 ro ICD-10 Code Diagnosis. Long QT Syndrome","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/gartner_magic_chart_plt.html","id":null,"dir":"Reference","previous_headings":"","what":"Gartner Magic Chart - Plotting of two continuous variables — gartner_magic_chart_plt","title":"Gartner Magic Chart - Plotting of two continuous variables — gartner_magic_chart_plt","text":"Plot Gartner Magic Chart two continuous variables","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/gartner_magic_chart_plt.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Gartner Magic Chart - Plotting of two continuous variables — gartner_magic_chart_plt","text":"","code":"gartner_magic_chart_plt( .data, .x_col, .y_col, .point_size_col = NULL, .y_lab, .x_lab, .plt_title, .tl_lbl, .tr_lbl, .br_lbl, .bl_lbl )"},{"path":"https://www.spsanderson.com/healthyR/reference/gartner_magic_chart_plt.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Gartner Magic Chart - Plotting of two continuous variables — gartner_magic_chart_plt","text":".data data set want plot .x_col x-axis plot .y_col y-axis plot .point_size_col default NULL, want size dots column data.frame/tibble enter column name . .y_lab y-axis label .x_lab x-axis label .plt_title title plot .tl_lbl top left label .tr_lbl top right label .br_lbl bottom right label .bl_lbl bottom left label","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/gartner_magic_chart_plt.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Gartner Magic Chart - Plotting of two continuous variables — gartner_magic_chart_plt","text":"ggplot plot","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/gartner_magic_chart_plt.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Gartner Magic Chart - Plotting of two continuous variables — gartner_magic_chart_plt","text":"Supply data frame least two continuous variables plot ","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/gartner_magic_chart_plt.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Gartner Magic Chart - Plotting of two continuous variables — gartner_magic_chart_plt","text":"Steven P. Sanderson II, MPH","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/gartner_magic_chart_plt.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Gartner Magic Chart - Plotting of two continuous variables — gartner_magic_chart_plt","text":"","code":"library(dplyr) data_tbl <- tibble( x = rnorm(100, 0, 1), y = rnorm(100, 0, 1), z = abs(x) + abs(y) ) gartner_magic_chart_plt( .data = data_tbl, .x_col = x, .y_col = y, .point_size = z, .x_lab = \"los\", .y_lab = \"ra\", .plt_title = \"tst\", .tr_lbl = \"High RA-LOS\", .tl_lbl = \"High RA\", .bl_lbl = \"Leader\", .br_lbl = \"High LOS\" ) gartner_magic_chart_plt( .data = data_tbl, .x_col = x, .y_col = y, .point_size = NULL, .x_lab = \"los\", .y_lab = \"ra\", .plt_title = \"tst\", .tr_lbl = \"High RA-LOS\", .tl_lbl = \"High RA\", .bl_lbl = \"Leader\", .br_lbl = \"High LOS\" )"},{"path":"https://www.spsanderson.com/healthyR/reference/hr_scale_color_colorblind.html","id":null,"dir":"Reference","previous_headings":"","what":"Provide Colorblind Compliant Colors — hr_scale_color_colorblind","title":"Provide Colorblind Compliant Colors — hr_scale_color_colorblind","text":"8 Hex RGB color definitions suitable charts colorblind people.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/hr_scale_color_colorblind.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Provide Colorblind Compliant Colors — hr_scale_color_colorblind","text":"","code":"hr_scale_color_colorblind(..., theme = \"hr\")"},{"path":"https://www.spsanderson.com/healthyR/reference/hr_scale_color_colorblind.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Provide Colorblind Compliant Colors — hr_scale_color_colorblind","text":"... Data passed ggplot object theme Right now hr . Anything else render error.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/hr_scale_color_colorblind.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Provide Colorblind Compliant Colors — hr_scale_color_colorblind","text":"gggplot layer","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/hr_scale_color_colorblind.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Provide Colorblind Compliant Colors — hr_scale_color_colorblind","text":"function used others order help render plots color blind.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/hr_scale_color_colorblind.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Provide Colorblind Compliant Colors — hr_scale_color_colorblind","text":"Steven P. Sanderson II, MPH","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/hr_scale_fill_colorblind.html","id":null,"dir":"Reference","previous_headings":"","what":"Provide Colorblind Compliant Colors — hr_scale_fill_colorblind","title":"Provide Colorblind Compliant Colors — hr_scale_fill_colorblind","text":"8 Hex RGB color definitions suitable charts colorblind people.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/hr_scale_fill_colorblind.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Provide Colorblind Compliant Colors — hr_scale_fill_colorblind","text":"","code":"hr_scale_fill_colorblind(..., theme = \"hr\")"},{"path":"https://www.spsanderson.com/healthyR/reference/hr_scale_fill_colorblind.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Provide Colorblind Compliant Colors — hr_scale_fill_colorblind","text":"... Data passed ggplot object theme Right now hr . Anything else render error.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/hr_scale_fill_colorblind.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Provide Colorblind Compliant Colors — hr_scale_fill_colorblind","text":"gggplot layer","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/hr_scale_fill_colorblind.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Provide Colorblind Compliant Colors — hr_scale_fill_colorblind","text":"function used others order help render plots color blind.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/hr_scale_fill_colorblind.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Provide Colorblind Compliant Colors — hr_scale_fill_colorblind","text":"Steven P. Sanderson II, MPH","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/kmeans_mapped_tbl.html","id":null,"dir":"Reference","previous_headings":"","what":"K-Means Mapper — kmeans_mapped_tbl","title":"K-Means Mapper — kmeans_mapped_tbl","text":"Create tibble maps kmeans_obj() using purrr::map() create nested data.frame/tibble holds n centers. tibble used help create scree plot.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/kmeans_mapped_tbl.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"K-Means Mapper — kmeans_mapped_tbl","text":"","code":"kmeans_mapped_tbl(.data, .centers = 15)"},{"path":"https://www.spsanderson.com/healthyR/reference/kmeans_mapped_tbl.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"K-Means Mapper — kmeans_mapped_tbl","text":".data must tibble working environment kmeans_user_item_tbl() .centers many different centers want try","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/kmeans_mapped_tbl.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"K-Means Mapper — kmeans_mapped_tbl","text":"nested tibble","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/kmeans_mapped_tbl.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"K-Means Mapper — kmeans_mapped_tbl","text":"Takes single parameter .centers. used create tibble map kmeans_obj() function list creating nested tibble.","code":""},{"path":[]},{"path":"https://www.spsanderson.com/healthyR/reference/kmeans_mapped_tbl.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"K-Means Mapper — kmeans_mapped_tbl","text":"Steven P. Sanderson II, MPH","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/kmeans_mapped_tbl.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"K-Means Mapper — kmeans_mapped_tbl","text":"","code":"library(healthyR.data) library(dplyr) data_tbl <- healthyR_data%>% filter(ip_op_flag == \"I\") %>% filter(payer_grouping != \"Medicare B\") %>% filter(payer_grouping != \"?\") %>% select(service_line, payer_grouping) %>% mutate(record = 1) %>% as_tibble() ui_tbl <- kmeans_user_item_tbl( .data = data_tbl , .row_input = service_line , .col_input = payer_grouping , .record_input = record ) kmeans_mapped_tbl(ui_tbl) #> # A tibble: 15 × 3 #> centers k_means glance #> #> 1 1 #> 2 2 #> 3 3 #> 4 4 #> 5 5 #> 6 6 #> 7 7 #> 8 8 #> 9 9 #> 10 10 #> 11 11 #> 12 12 #> 13 13 #> 14 14 #> 15 15 "},{"path":"https://www.spsanderson.com/healthyR/reference/kmeans_obj.html","id":null,"dir":"Reference","previous_headings":"","what":"K-Means Functions — kmeans_obj","title":"K-Means Functions — kmeans_obj","text":"Takes output kmeans_user_item_tbl() function applies k-means algorithm using stats::kmeans()","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/kmeans_obj.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"K-Means Functions — kmeans_obj","text":"","code":"kmeans_obj(.data, .centers = 5)"},{"path":"https://www.spsanderson.com/healthyR/reference/kmeans_obj.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"K-Means Functions — kmeans_obj","text":".data data gets passed kmeans_user_item_tbl() .centers many initial centers start ","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/kmeans_obj.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"K-Means Functions — kmeans_obj","text":"stats k-means object","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/kmeans_obj.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"K-Means Functions — kmeans_obj","text":"Uses stats::kmeans() function creates wrapper around .","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/kmeans_obj.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"K-Means Functions — kmeans_obj","text":"Steven P. Sanderson II, MPH","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/kmeans_obj.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"K-Means Functions — kmeans_obj","text":"","code":"library(healthyR.data) library(dplyr) data_tbl <- healthyR_data%>% filter(ip_op_flag == \"I\") %>% filter(payer_grouping != \"Medicare B\") %>% filter(payer_grouping != \"?\") %>% select(service_line, payer_grouping) %>% mutate(record = 1) %>% as_tibble() kmeans_user_item_tbl( .data = data_tbl , .row_input = service_line , .col_input = payer_grouping , .record_input = record ) %>% kmeans_obj() #> K-means clustering with 5 clusters of sizes 2, 5, 1, 3, 12 #> #> Cluster means: #> Blue Cross Commercial Compensation Exchange Plans HMO Medicaid #> 1 0.27188303 0.05712358 0.0003293808 0.039065198 0.18065096 0.04246134 #> 2 0.13375082 0.03542694 0.0121998471 0.016160901 0.10724914 0.05150211 #> 3 0.00000000 0.00000000 0.0000000000 0.000000000 0.27272727 0.18181818 #> 4 0.07912806 0.02702478 0.0002914681 0.009301354 0.07723873 0.21428392 #> 5 0.07837450 0.02182129 0.0043244347 0.006202137 0.04493860 0.03684344 #> Medicaid HMO Medicare A Medicare HMO No Fault Self Pay #> 1 0.24760799 0.10958146 0.03584494 0.000000000 0.015452115 #> 2 0.13107693 0.35217108 0.11769769 0.008242686 0.034521844 #> 3 0.45454545 0.09090909 0.00000000 0.000000000 0.000000000 #> 4 0.28209782 0.23654904 0.04362913 0.002672067 0.027783628 #> 5 0.08001653 0.56250366 0.15152338 0.003475542 0.009976485 #> #> Clustering vector: #> [1] 4 1 5 5 5 5 2 2 5 5 1 5 4 2 5 2 5 4 2 5 5 3 5 #> #> Within cluster sum of squares by cluster: #> [1] 0.03549821 0.02592247 0.00000000 0.04450884 0.09625399 #> (between_SS / total_SS = 85.6 %) #> #> Available components: #> #> [1] \"cluster\" \"centers\" \"totss\" \"withinss\" \"tot.withinss\" #> [6] \"betweenss\" \"size\" \"iter\" \"ifault\""},{"path":"https://www.spsanderson.com/healthyR/reference/kmeans_scree_data_tbl.html","id":null,"dir":"Reference","previous_headings":"","what":"K-Means Scree Plot Data Table — kmeans_scree_data_tbl","title":"K-Means Scree Plot Data Table — kmeans_scree_data_tbl","text":"Take data kmeans_mapped_tbl() unnest tibble inspection use kmeans_scree_plt() function.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/kmeans_scree_data_tbl.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"K-Means Scree Plot Data Table — kmeans_scree_data_tbl","text":"","code":"kmeans_scree_data_tbl(.data)"},{"path":"https://www.spsanderson.com/healthyR/reference/kmeans_scree_data_tbl.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"K-Means Scree Plot Data Table — kmeans_scree_data_tbl","text":".data must tibble working environment kmeans_mapped_tbl()","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/kmeans_scree_data_tbl.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"K-Means Scree Plot Data Table — kmeans_scree_data_tbl","text":"nested tibble","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/kmeans_scree_data_tbl.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"K-Means Scree Plot Data Table — kmeans_scree_data_tbl","text":"Takes single parameter .data kmeans_mapped_tbl() transforms tibble used kmeans_scree_plt(). show values (tot.withinss) center.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/kmeans_scree_data_tbl.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"K-Means Scree Plot Data Table — kmeans_scree_data_tbl","text":"Steven P. Sanderson II, MPH","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/kmeans_scree_data_tbl.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"K-Means Scree Plot Data Table — kmeans_scree_data_tbl","text":"","code":"library(healthyR.data) library(dplyr) data_tbl <- healthyR_data%>% filter(ip_op_flag == \"I\") %>% filter(payer_grouping != \"Medicare B\") %>% filter(payer_grouping != \"?\") %>% select(service_line, payer_grouping) %>% mutate(record = 1) %>% as_tibble() ui_tbl <- kmeans_user_item_tbl( .data = data_tbl , .row_input = service_line , .col_input = payer_grouping , .record_input = record ) kmm_tbl <- kmeans_mapped_tbl(ui_tbl) kmeans_scree_data_tbl(kmm_tbl) #> # A tibble: 15 × 2 #> centers tot.withinss #> #> 1 1 1.41 #> 2 2 0.592 #> 3 3 0.372 #> 4 4 0.276 #> 5 5 0.202 #> 6 6 0.159 #> 7 7 0.124 #> 8 8 0.0922 #> 9 9 0.0722 #> 10 10 0.0576 #> 11 11 0.0461 #> 12 12 0.0363 #> 13 13 0.0272 #> 14 14 0.0231 #> 15 15 0.0160"},{"path":"https://www.spsanderson.com/healthyR/reference/kmeans_scree_plt.html","id":null,"dir":"Reference","previous_headings":"","what":"K-Means Scree Plot — kmeans_scree_plt","title":"K-Means Scree Plot — kmeans_scree_plt","text":"Create scree-plot kmeans_mapped_tbl() function.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/kmeans_scree_plt.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"K-Means Scree Plot — kmeans_scree_plt","text":"","code":"kmeans_scree_plt(.data)"},{"path":"https://www.spsanderson.com/healthyR/reference/kmeans_scree_plt.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"K-Means Scree Plot — kmeans_scree_plt","text":".data data kmeans_mapped_tbl() function","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/kmeans_scree_plt.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"K-Means Scree Plot — kmeans_scree_plt","text":"ggplot2 plot","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/kmeans_scree_plt.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"K-Means Scree Plot — kmeans_scree_plt","text":"Outputs scree-plot","code":""},{"path":[]},{"path":"https://www.spsanderson.com/healthyR/reference/kmeans_scree_plt.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"K-Means Scree Plot — kmeans_scree_plt","text":"Steven P. Sanderson II, MPH","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/kmeans_scree_plt.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"K-Means Scree Plot — kmeans_scree_plt","text":"","code":"library(healthyR.data) library(dplyr) data_tbl <- healthyR_data%>% filter(ip_op_flag == \"I\") %>% filter(payer_grouping != \"Medicare B\") %>% filter(payer_grouping != \"?\") %>% select(service_line, payer_grouping) %>% mutate(record = 1) %>% as_tibble() ui_tbl <- kmeans_user_item_tbl( .data = data_tbl , .row_input = service_line , .col_input = payer_grouping , .record_input = record ) kmm_tbl <- kmeans_mapped_tbl(ui_tbl) kmeans_scree_plt(.data = kmm_tbl)"},{"path":"https://www.spsanderson.com/healthyR/reference/kmeans_tidy_tbl.html","id":null,"dir":"Reference","previous_headings":"","what":"K-Means tidy Functions — kmeans_tidy_tbl","title":"K-Means tidy Functions — kmeans_tidy_tbl","text":"K-Means tidy functions","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/kmeans_tidy_tbl.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"K-Means tidy Functions — kmeans_tidy_tbl","text":"","code":"kmeans_tidy_tbl(.kmeans_obj, .data, .tidy_type = \"tidy\")"},{"path":"https://www.spsanderson.com/healthyR/reference/kmeans_tidy_tbl.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"K-Means tidy Functions — kmeans_tidy_tbl","text":".kmeans_obj stats::kmeans() object .data user item tibble created kmeans_user_item_tbl() .tidy_type \"tidy\",\"glance\", \"augment\"","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/kmeans_tidy_tbl.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"K-Means tidy Functions — kmeans_tidy_tbl","text":"tibble","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/kmeans_tidy_tbl.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"K-Means tidy Functions — kmeans_tidy_tbl","text":"Takes k-means object associated user item tibble returns one items asked . Either: broom::tidy(), broom::glance() broom::augment(). function defaults broom::tidy().","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/kmeans_tidy_tbl.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"K-Means tidy Functions — kmeans_tidy_tbl","text":"Steven P. Sanderson II, MPH","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/kmeans_tidy_tbl.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"K-Means tidy Functions — kmeans_tidy_tbl","text":"","code":"library(healthyR.data) library(dplyr) library(broom) data_tbl <- healthyR_data%>% filter(ip_op_flag == \"I\") %>% filter(payer_grouping != \"Medicare B\") %>% filter(payer_grouping != \"?\") %>% select(service_line, payer_grouping) %>% mutate(record = 1) %>% as_tibble() uit_tbl <- kmeans_user_item_tbl( .data = data_tbl , .row_input = service_line , .col_input = payer_grouping , .record_input = record ) km_obj <- kmeans_obj(uit_tbl) kmeans_tidy_tbl( .kmeans_obj = km_obj , .data = uit_tbl , .tidy_type = \"augment\" ) #> # A tibble: 23 × 2 #> service_line cluster #> #> 1 Alcohol Abuse 5 #> 2 Bariatric Surgery For Obesity 1 #> 3 CHF 3 #> 4 COPD 3 #> 5 CVA 3 #> 6 Carotid Endarterectomy 3 #> 7 Cellulitis 4 #> 8 Chest Pain 4 #> 9 GI Hemorrhage 3 #> 10 Joint Replacement 3 #> # … with 13 more rows #> # ℹ Use `print(n = ...)` to see more rows kmeans_tidy_tbl( .kmeans_obj = km_obj , .data = uit_tbl , .tidy_type = \"glance\" ) #> # A tibble: 1 × 4 #> totss tot.withinss betweenss iter #> #> 1 1.41 0.202 1.21 2 kmeans_tidy_tbl( .kmeans_obj = km_obj , .data = uit_tbl , .tidy_type = \"tidy\" ) %>% glimpse() #> Rows: 5 #> Columns: 14 #> $ `Blue Cross` 0.27188303, 0.00000000, 0.07837450, 0.13375082, 0.079… #> $ Commercial 0.05712358, 0.00000000, 0.02182129, 0.03542694, 0.027… #> $ Compensation 0.0003293808, 0.0000000000, 0.0043244347, 0.012199847… #> $ `Exchange Plans` 0.039065198, 0.000000000, 0.006202137, 0.016160901, 0… #> $ HMO 0.18065096, 0.27272727, 0.04493860, 0.10724914, 0.077… #> $ Medicaid 0.04246134, 0.18181818, 0.03684344, 0.05150211, 0.214… #> $ `Medicaid HMO` 0.24760799, 0.45454545, 0.08001653, 0.13107693, 0.282… #> $ `Medicare A` 0.10958146, 0.09090909, 0.56250366, 0.35217108, 0.236… #> $ `Medicare HMO` 0.03584494, 0.00000000, 0.15152338, 0.11769769, 0.043… #> $ `No Fault` 0.000000000, 0.000000000, 0.003475542, 0.008242686, 0… #> $ `Self Pay` 0.015452115, 0.000000000, 0.009976485, 0.034521844, 0… #> $ size 2, 1, 12, 5, 3 #> $ withinss 0.03549821, 0.00000000, 0.09625399, 0.02592247, 0.044… #> $ cluster 1, 2, 3, 4, 5"},{"path":"https://www.spsanderson.com/healthyR/reference/kmeans_user_item_tbl.html","id":null,"dir":"Reference","previous_headings":"","what":"K-Means Functions — kmeans_user_item_tbl","title":"K-Means Functions — kmeans_user_item_tbl","text":"Takes data.frame/tibble transforms aggregated/normalized user-item tibble proportions. user need input parameters rows/user columns/items.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/kmeans_user_item_tbl.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"K-Means Functions — kmeans_user_item_tbl","text":"","code":"kmeans_user_item_tbl(.data, .row_input, .col_input, .record_input)"},{"path":"https://www.spsanderson.com/healthyR/reference/kmeans_user_item_tbl.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"K-Means Functions — kmeans_user_item_tbl","text":".data data want transform .row_input column going row (user) .col_input column going column (item) .record_input column going summed aggregattion normalization process.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/kmeans_user_item_tbl.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"K-Means Functions — kmeans_user_item_tbl","text":"aggregated/normalized user item tibble","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/kmeans_user_item_tbl.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"K-Means Functions — kmeans_user_item_tbl","text":"function used using k-mean model. commonly referred user item matrix \"users\" tend rows \"items\" (e.g. orders) columns. must supply column can summed aggregation normalization process occur.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/kmeans_user_item_tbl.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"K-Means Functions — kmeans_user_item_tbl","text":"Steven P. Sanderson II, MPH","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/kmeans_user_item_tbl.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"K-Means Functions — kmeans_user_item_tbl","text":"","code":"library(healthyR.data) library(dplyr) data_tbl <- healthyR_data%>% filter(ip_op_flag == \"I\") %>% filter(payer_grouping != \"Medicare B\") %>% filter(payer_grouping != \"?\") %>% select(service_line, payer_grouping) %>% mutate(record = 1) %>% as_tibble() kmeans_user_item_tbl( .data = data_tbl , .row_input = service_line , .col_input = payer_grouping , .record_input = record ) #> # A tibble: 23 × 12 #> service_line Blue …¹ Comme…² Compe…³ Excha…⁴ HMO Medic…⁵ Medic…⁶ Medic…⁷ #> #> 1 Alcohol Abuse 0.0941 0.0321 5.25e-4 0.0116 0.0788 0.158 0.367 0.173 #> 2 Bariatric Sur… 0.317 0.0583 0 0.0518 0.168 0.00324 0.343 0.0485 #> 3 CHF 0.0295 0.00958 5.18e-4 0.00414 0.0205 0.0197 0.0596 0.657 #> 4 COPD 0.0493 0.0228 2.28e-4 0.00548 0.0342 0.0461 0.172 0.520 #> 5 CVA 0.0647 0.0246 1.07e-3 0.0107 0.0524 0.0289 0.0764 0.555 #> 6 Carotid Endar… 0.0845 0.0282 0 0 0.0141 0 0.0282 0.648 #> 7 Cellulitis 0.110 0.0339 1.18e-2 0.00847 0.0805 0.0869 0.192 0.355 #> 8 Chest Pain 0.144 0.0391 2.90e-3 0.00543 0.112 0.0522 0.159 0.324 #> 9 GI Hemorrhage 0.0542 0.0175 1.25e-3 0.00834 0.0480 0.0350 0.0855 0.588 #> 10 Joint Replace… 0.139 0.0179 3.36e-2 0.00673 0.0516 0 0.0874 0.5 #> # … with 13 more rows, 3 more variables: `Medicare HMO` , #> # `No Fault` , `Self Pay` , and abbreviated variable names #> # ¹​`Blue Cross`, ²​Commercial, ³​Compensation, ⁴​`Exchange Plans`, ⁵​Medicaid, #> # ⁶​`Medicaid HMO`, ⁷​`Medicare A` #> # ℹ Use `print(n = ...)` to see more rows, and `colnames()` to see all variable names"},{"path":"https://www.spsanderson.com/healthyR/reference/los_ra_index_plt.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot LOS and Readmit Index with Variance — los_ra_index_plt","title":"Plot LOS and Readmit Index with Variance — los_ra_index_plt","text":"Plot index length stay readmit rate along variance","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/los_ra_index_plt.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot LOS and Readmit Index with Variance — los_ra_index_plt","text":"","code":"los_ra_index_plt(.data)"},{"path":"https://www.spsanderson.com/healthyR/reference/los_ra_index_plt.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot LOS and Readmit Index with Variance — los_ra_index_plt","text":".data data supplied los_ra_index_summary_tbl()","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/los_ra_index_plt.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot LOS and Readmit Index with Variance — los_ra_index_plt","text":"patchwork ggplot2 plot","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/los_ra_index_plt.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Plot LOS and Readmit Index with Variance — los_ra_index_plt","text":"Expects tibble Expects Length Stay Readmit column, must numeric Uses cowplot stack plots","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/los_ra_index_plt.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Plot LOS and Readmit Index with Variance — los_ra_index_plt","text":"Steven P. Sanderson II, MPH","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/los_ra_index_plt.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot LOS and Readmit Index with Variance — los_ra_index_plt","text":"","code":"suppressPackageStartupMessages(library(dplyr)) data_tbl <- tibble( \"alos\" = runif(186, 1, 20) , \"elos\" = runif(186, 1, 17) , \"readmit_rate\" = runif(186, 0, .25) , \"readmit_rate_bench\" = runif(186, 0, .2) ) los_ra_index_summary_tbl( .data = data_tbl , .max_los = 15 , .alos_col = alos , .elos_col = elos , .readmit_rate = readmit_rate , .readmit_bench = readmit_rate_bench ) %>% los_ra_index_plt() los_ra_index_summary_tbl( .data = data_tbl , .max_los = 10 , .alos_col = alos , .elos_col = elos , .readmit_rate = readmit_rate , .readmit_bench = readmit_rate_bench ) %>% los_ra_index_plt()"},{"path":"https://www.spsanderson.com/healthyR/reference/los_ra_index_summary_tbl.html","id":null,"dir":"Reference","previous_headings":"","what":"Make LOS and Readmit Index Summary Tibble — los_ra_index_summary_tbl","title":"Make LOS and Readmit Index Summary Tibble — los_ra_index_summary_tbl","text":"Create length stay readmit index summary tibble","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/los_ra_index_summary_tbl.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Make LOS and Readmit Index Summary Tibble — los_ra_index_summary_tbl","text":"","code":"los_ra_index_summary_tbl( .data, .max_los = 15, .alos_col, .elos_col, .readmit_rate, .readmit_bench )"},{"path":"https://www.spsanderson.com/healthyR/reference/los_ra_index_summary_tbl.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Make LOS and Readmit Index Summary Tibble — los_ra_index_summary_tbl","text":".data data going analyze. .max_los can give maximum LOS value. Lets say typically see los 15 days, set .max_los 15 values greater .max_los grouped .max_los .alos_col Average Length Stay column .elos_col Expected Length Stay column .readmit_rate Actual Readmit Rate column .readmit_bench Expected Readmit Rate column","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/los_ra_index_summary_tbl.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Make LOS and Readmit Index Summary Tibble — los_ra_index_summary_tbl","text":"tibble","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/los_ra_index_summary_tbl.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Make LOS and Readmit Index Summary Tibble — los_ra_index_summary_tbl","text":"Expects tibble Expects following columns 4 Length Stay Actual - integer Length Stacy Benchmark - integer Readmit Rate Actual - 0/1 record, 1 = readmitted, 0 . Readmit Rate Benchmark - percentage benchmark file. add column called visits count records per length stay 1 .max_los .max_los param can left blank function default 15. good default know set 75 percentile stats::quantile() function using defaults, like .max_los = stats::quantile(data_tbl$alos)[[4]] Uses data compute variance, want particular time frame filter data goes .data argument. suggested use timetk::filter_by_time() index computed excess length stay readmit rates respective expectations.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/los_ra_index_summary_tbl.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Make LOS and Readmit Index Summary Tibble — los_ra_index_summary_tbl","text":"Steven P. Sanderson II, MPH","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/los_ra_index_summary_tbl.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Make LOS and Readmit Index Summary Tibble — los_ra_index_summary_tbl","text":"","code":"suppressPackageStartupMessages(library(dplyr)) data_tbl <- tibble( \"alos\" = runif(186, 1, 20) , \"elos\" = runif(186, 1, 17) , \"readmit_rate\" = runif(186, 0, .25) , \"readmit_bench\" = runif(186, 0, .2) ) los_ra_index_summary_tbl( .data = data_tbl , .max_los = 15 , .alos_col = alos , .elos_col = elos , .readmit_rate = readmit_rate , .readmit_bench = readmit_bench ) #> # A tibble: 15 × 4 #> los_group los_index rar_index los_ra_var #> #> 1 1 0.114 0.833 1.05 #> 2 2 0.264 1.08 0.820 #> 3 3 0.327 2.14 1.82 #> 4 4 0.382 1.2 0.818 #> 5 5 0.590 1.5 0.910 #> 6 6 0.527 0.818 0.655 #> 7 7 0.704 1.27 0.569 #> 8 8 0.698 1.33 0.635 #> 9 9 1.01 0.917 0.0951 #> 10 10 1.38 1 0.384 #> 11 11 1.12 1.62 0.749 #> 12 12 1.54 1.4 0.942 #> 13 13 1.13 0.833 0.298 #> 14 14 1.49 0.667 0.823 #> 15 15 2.11 1.09 1.20 los_ra_index_summary_tbl( .data = data_tbl , .max_los = 10 , .alos_col = alos , .elos_col = elos , .readmit_rate = readmit_rate , .readmit_bench = readmit_bench ) #> # A tibble: 10 × 4 #> los_group los_index rar_index los_ra_var #> #> 1 1 0.114 0.833 1.05 #> 2 2 0.264 1.08 0.820 #> 3 3 0.327 2.14 1.82 #> 4 4 0.382 1.2 0.818 #> 5 5 0.590 1.5 0.910 #> 6 6 0.527 0.818 0.655 #> 7 7 0.704 1.27 0.569 #> 8 8 0.698 1.33 0.635 #> 9 9 1.01 0.917 0.0951 #> 10 10 1.67 1 0.673"},{"path":"https://www.spsanderson.com/healthyR/reference/named_item_list.html","id":null,"dir":"Reference","previous_headings":"","what":"Tibble to named list — named_item_list","title":"Tibble to named list — named_item_list","text":"Takes data.frame/tibble creates named list supplied grouping variable. Can used conjunction save_to_excel() create new sheet group data.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/named_item_list.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Tibble to named list — named_item_list","text":"","code":"named_item_list(.data, .group_col)"},{"path":"https://www.spsanderson.com/healthyR/reference/named_item_list.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Tibble to named list — named_item_list","text":".data data.frame/tibble. .group_col column contains groupings.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/named_item_list.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Tibble to named list — named_item_list","text":"Requires data.frame/tibble grouping column.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/named_item_list.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Tibble to named list — named_item_list","text":"Steven P. Sanderson II, MPH","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/named_item_list.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Tibble to named list — named_item_list","text":"","code":"library(healthyR.data) df <- healthyR_data df_list <- named_item_list(.data = df, .group_col = service_line) df_list #> tbl_df< #> mrn : character #> visit_id : character #> visit_start_date_time : datetime #> visit_end_date_time : datetime #> total_charge_amount : double #> total_amount_due : double #> total_adjustment_amount : double #> payer_grouping : character #> total_payment_amount : double #> ip_op_flag : character #> service_line : character #> length_of_stay : double #> expected_length_of_stay : logical #> length_of_stay_threshold: logical #> los_outlier_flag : double #> readmit_flag : double #> readmit_expectation : logical #> > #> >[29]> #> $`Alcohol Abuse` #> # A tibble: 1,904 × 17 #> mrn visit_id visit_start_date_time visit_end_date_time total_charge_amount #> #> 1 66681… 1027422… 2011-09-18 18:45:00 2011-09-21 15:24:00 20650. #> 2 85712… 1715006… 2011-09-24 14:23:00 2011-09-27 22:54:00 19632. #> 3 45086… 1463793… 2011-09-25 17:22:00 2011-09-30 18:48:00 27028. #> 4 53136… 1087046… 2011-10-01 08:58:00 2011-10-03 11:10:00 12214. #> 5 79908… 1933551… 2011-10-02 00:04:00 2011-10-06 13:51:00 30124. #> 6 29323… 1651882… 2011-10-06 15:08:00 2011-10-07 16:00:00 8571. #> 7 97809… 1375044… 2011-10-06 17:23:00 2011-10-08 14:19:00 13139. #> 8 88765… 1040286… 2011-10-09 00:36:00 2011-10-09 15:29:00 37944. #> 9 13303… 1814203… 2011-09-26 20:00:00 2011-10-10 11:59:00 110695. #> 10 50646… 1177441… 2011-10-11 01:00:00 2011-10-13 10:16:00 18791. #> # ℹ 1,894 more rows #> # ℹ 12 more variables: total_amount_due , total_adjustment_amount , #> # payer_grouping , total_payment_amount , ip_op_flag , #> # service_line , length_of_stay , expected_length_of_stay , #> # length_of_stay_threshold , los_outlier_flag , readmit_flag , #> # readmit_expectation #> #> $`Bariatric Surgery For Obesity` #> # A tibble: 309 × 17 #> mrn visit_id visit_start_date_time visit_end_date_time total_charge_amount #> #> 1 33197… 1959572… 2012-12-03 13:35:00 2012-12-05 14:42:00 42533. #> 2 85747… 1935901… 2012-12-03 07:30:00 2012-12-06 13:48:00 47450. #> 3 89559… 1250962… 2012-12-03 08:39:00 2012-12-06 16:18:00 50382. #> 4 31228… 1482137… 2013-01-16 06:32:00 2013-01-18 16:07:00 43665. #> 5 15445… 1953192… 2013-01-16 09:18:00 2013-01-20 18:33:00 52763. #> 6 22630… 1950977… 2013-02-19 10:28:00 2013-02-21 15:25:00 36038. #> 7 37398… 1518672… 2013-02-26 06:53:00 2013-03-01 12:38:00 56381. #> 8 14268… 1903948… 2013-04-09 06:45:00 2013-04-11 18:12:00 43263. #> 9 78338… 1196711… 2013-04-23 07:16:00 2013-04-26 16:41:00 52300. #> 10 80152… 1595499… 2013-05-21 06:15:00 2013-05-24 15:59:00 44746. #> # ℹ 299 more rows #> # ℹ 12 more variables: total_amount_due , total_adjustment_amount , #> # payer_grouping , total_payment_amount , ip_op_flag , #> # service_line , length_of_stay , expected_length_of_stay , #> # length_of_stay_threshold , los_outlier_flag , readmit_flag , #> # readmit_expectation #> #> $`Bariatric Surgery for Obesity Outpatient` #> # A tibble: 19 × 17 #> mrn visit_id visit_start_date_time visit_end_date_time total_charge_amount #> #> 1 77785… 3780939… 2011-05-23 05:00:00 2011-05-24 00:00:00 37167. #> 2 68458… 3778860… 2011-07-18 05:00:00 2011-07-19 00:00:00 26037. #> 3 47955… 3675064… 2011-07-18 05:00:00 2011-07-19 00:00:00 41552. #> 4 92298… 3218733… 2011-08-15 05:00:00 2011-08-16 00:00:00 34332. #> 5 29160… 3547868… 2011-08-30 05:00:00 2011-08-31 00:00:00 37992. #> 6 45420… 3189581… 2011-09-12 05:00:00 2011-09-13 00:00:00 32744. #> 7 59818… 3834855… 2011-09-19 05:00:00 2011-09-20 00:00:00 34354. #> 8 57649… 3921176… 2011-10-17 05:00:00 2011-10-18 00:00:00 31338 #> 9 11995… 3411333… 2011-11-07 05:00:00 2011-11-08 00:00:00 34795 #> 10 62541… 3554137… 2011-11-08 05:00:00 2011-11-08 00:00:00 33251. #> 11 83600… 3562481… 2011-11-15 05:00:00 2011-11-15 00:00:00 33955. #> 12 10604… 3411030… 2011-11-28 05:00:00 2011-11-29 00:00:00 35638. #> 13 84084… 3342120… 2012-03-12 05:00:00 2012-03-12 00:00:00 33758. #> 14 37253… 3461965… 2012-04-23 05:00:00 2012-04-24 00:00:00 36768. #> 15 85288… 3078841… 2012-06-12 05:00:00 2012-06-13 00:00:00 39139. #> 16 73239… 3350427… 2012-07-09 05:00:00 2012-07-10 00:00:00 35642. #> 17 52577… 3074630… 2012-08-20 05:00:00 2012-08-21 00:00:00 37140. #> 18 62286… 3659346… 2012-08-27 05:00:00 2012-08-28 00:00:00 35030. #> 19 39164… 3146567… 2012-12-18 05:00:00 2012-12-19 00:00:00 36899. #> # ℹ 12 more variables: total_amount_due , total_adjustment_amount , #> # payer_grouping , total_payment_amount , ip_op_flag , #> # service_line , length_of_stay , expected_length_of_stay , #> # length_of_stay_threshold , los_outlier_flag , readmit_flag , #> # readmit_expectation #> #> $CHF #> # A tibble: 3,871 × 17 #> mrn visit_id visit_start_date_time visit_end_date_time total_charge_amount #> #> 1 51458… 1759626… 2011-09-19 09:17:00 2011-09-22 12:32:00 24021. #> 2 66595… 1901836… 2011-09-19 07:06:00 2011-09-22 18:58:00 33724. #> 3 21445… 1913857… 2011-09-22 00:21:00 2011-09-27 16:49:00 47369. #> 4 33735… 1710022… 2011-09-15 12:48:00 2011-09-27 19:52:00 76611. #> 5 67542… 1377329… 2011-09-17 13:49:00 2011-09-28 13:45:00 81523. #> 6 69492… 1811099… 2011-09-24 20:33:00 2011-09-29 11:59:00 37112. #> 7 93559… 1609237… 2011-09-22 04:23:00 2011-10-03 14:21:00 84470. #> 8 14723… 1713302… 2011-09-15 11:50:00 2011-10-04 19:34:00 158923. #> 9 49842… 1052618… 2011-09-29 10:40:00 2011-10-05 14:20:00 50061. #> 10 98654… 1022864… 2011-10-01 01:47:00 2011-10-05 18:50:00 42312. #> # ℹ 3,861 more rows #> # ℹ 12 more variables: total_amount_due , total_adjustment_amount , #> # payer_grouping , total_payment_amount , ip_op_flag , #> # service_line , length_of_stay , expected_length_of_stay , #> # length_of_stay_threshold , los_outlier_flag , readmit_flag , #> # readmit_expectation #> #> $COPD #> # A tibble: 4,398 × 17 #> mrn visit_id visit_start_date_time visit_end_date_time total_charge_amount #> #> 1 53222… 1698106… 2011-09-23 00:18:00 2011-09-25 14:18:00 21843. #> 2 54515… 1461588… 2011-09-18 17:22:00 2011-09-28 17:20:00 98014. #> 3 91474… 1437392… 2011-09-19 09:01:00 2011-09-30 14:44:00 96463. #> 4 38370… 1452507… 2011-09-25 18:44:00 2011-09-30 20:42:00 31050. #> 5 30712… 1117831… 2011-09-26 19:26:00 2011-10-01 09:46:00 33841. #> 6 11184… 1308449… 2011-09-30 17:41:00 2011-10-01 16:32:00 13971. #> 7 88190… 1670417… 2011-09-27 22:58:00 2011-10-01 17:03:00 44981. #> 8 33840… 1957228… 2011-09-26 08:08:00 2011-10-02 15:53:00 44635. #> 9 20960… 1168285… 2011-09-28 11:09:00 2011-10-03 15:53:00 36926. #> 10 95644… 1711510… 2011-09-24 23:59:00 2011-10-03 18:10:00 69779. #> # ℹ 4,388 more rows #> # ℹ 12 more variables: total_amount_due , total_adjustment_amount , #> # payer_grouping , total_payment_amount , ip_op_flag , #> # service_line , length_of_stay , expected_length_of_stay , #> # length_of_stay_threshold , los_outlier_flag , readmit_flag , #> # readmit_expectation #> #> $CVA #> # A tibble: 1,876 × 17 #> mrn visit_id visit_start_date_time visit_end_date_time total_charge_amount #> #> 1 41238… 1543704… 2011-09-19 15:31:00 2011-09-27 13:11:00 103948. #> 2 80514… 1330628… 2011-09-21 14:52:00 2011-09-29 17:38:00 94170. #> 3 12307… 1747094… 2011-09-24 16:34:00 2011-09-30 17:21:00 66481. #> 4 20903… 1777797… 2011-09-26 12:19:00 2011-10-04 15:38:00 79281. #> 5 54938… 1173347… 2011-09-30 17:47:00 2011-10-05 16:50:00 49108. #> 6 93886… 1877891… 2011-09-19 17:47:00 2011-10-05 17:25:00 105698. #> 7 42704… 1654264… 2011-09-28 22:00:00 2011-10-06 17:08:00 65041. #> 8 40653… 1576434… 2011-10-05 15:31:00 2011-10-11 14:26:00 81910. #> 9 26260… 1818390… 2011-09-27 13:43:00 2011-10-13 14:14:00 86323. #> 10 28646… 1984495… 2011-10-12 10:10:00 2011-10-14 15:15:00 82165. #> # ℹ 1,866 more rows #> # ℹ 12 more variables: total_amount_due , total_adjustment_amount , #> # payer_grouping , total_payment_amount , ip_op_flag , #> # service_line , length_of_stay , expected_length_of_stay , #> # length_of_stay_threshold , los_outlier_flag , readmit_flag , #> # readmit_expectation #> #> $`Cardiac Catheterization` #> # A tibble: 2,339 × 17 #> mrn visit_id visit_start_date_time visit_end_date_time total_charge_amount #> #> 1 66583… 3578143… 2011-01-04 05:00:00 2011-01-04 00:00:00 20852 #> 2 10022… 3911589… 2011-01-04 05:00:00 2011-01-04 00:00:00 18334 #> 3 28724… 3226717… 2011-01-05 05:00:00 2011-01-05 00:00:00 19353 #> 4 54076… 3773686… 2011-01-05 05:00:00 2011-01-05 00:00:00 18334 #> 5 89111… 3082518… 2011-01-13 05:00:00 2011-01-11 00:00:00 1377 #> 6 91877… 3385295… 2011-01-13 05:00:00 2011-01-13 00:00:00 18405 #> 7 89111… 3040689… 2011-01-13 05:00:00 2011-01-13 00:00:00 18587 #> 8 75773… 3380647… 2011-01-14 05:00:00 2011-01-14 00:00:00 20069 #> 9 22385… 3740963… 2011-01-17 05:00:00 2011-01-17 00:00:00 18428 #> 10 91434… 3628134… 2011-01-17 05:00:00 2011-01-17 00:00:00 20056 #> # ℹ 2,329 more rows #> # ℹ 12 more variables: total_amount_due , total_adjustment_amount , #> # payer_grouping , total_payment_amount , ip_op_flag , #> # service_line , length_of_stay , expected_length_of_stay , #> # length_of_stay_threshold , los_outlier_flag , readmit_flag , #> # readmit_expectation #> #> $`Carotid Endarterectomy` #> # A tibble: 72 × 17 #> mrn visit_id visit_start_date_time visit_end_date_time total_charge_amount #> #> 1 91886… 1012723… 2011-12-02 11:51:00 2011-12-04 15:32:00 29553. #> 2 84879… 1998441… 2012-02-02 06:37:00 2012-02-05 19:38:00 35181. #> 3 35685… 1235700… 2012-03-16 16:26:00 2012-03-23 11:22:00 87273. #> 4 84879… 1412023… 2012-03-30 09:31:00 2012-04-02 17:57:00 36213. #> 5 76802… 1501987… 2012-04-03 09:43:00 2012-04-05 13:11:00 27293. #> 6 21571… 1253613… 2012-03-29 21:26:00 2012-04-05 14:53:00 82206. #> 7 88958… 1446390… 2012-03-27 19:35:00 2012-04-05 16:35:00 89350. #> 8 25304… 1257726… 2012-05-29 08:52:00 2012-06-04 11:53:00 57470. #> 9 85997… 1406791… 2012-05-29 06:40:00 2012-06-04 12:40:00 52616. #> 10 19040… 1247816… 2012-05-31 06:57:00 2012-06-04 14:30:00 37105. #> # ℹ 62 more rows #> # ℹ 12 more variables: total_amount_due , total_adjustment_amount , #> # payer_grouping , total_payment_amount , ip_op_flag , #> # service_line , length_of_stay , expected_length_of_stay , #> # length_of_stay_threshold , los_outlier_flag , readmit_flag , #> # readmit_expectation #> #> $`Cataract Removal` #> # A tibble: 4,930 × 17 #> mrn visit_id visit_start_date_time visit_end_date_time total_charge_amount #> #> 1 24432… 3904707… 2010-01-05 05:00:00 2010-01-05 00:00:00 31283. #> 2 42767… 3950850… 2010-01-05 05:00:00 2010-01-05 00:00:00 12833. #> 3 27436… 3391956… 2010-01-05 05:00:00 2010-01-05 00:00:00 11770. #> 4 16795… 3399694… 2010-01-05 05:00:00 2010-01-05 00:00:00 12729. #> 5 26318… 3554661… 2010-01-05 05:00:00 2010-01-05 00:00:00 12833. #> 6 61280… 3763722… 2010-01-06 05:00:00 2010-01-06 00:00:00 15748. #> 7 80833… 3967666… 2010-01-06 05:00:00 2010-01-06 00:00:00 14165. #> 8 11824… 3033075… 2010-01-06 05:00:00 2010-01-06 00:00:00 13065. #> 9 87504… 3162148… 2010-01-06 05:00:00 2010-01-06 00:00:00 12735. #> 10 87077… 3940813… 2010-01-07 05:00:00 2010-01-07 00:00:00 11514. #> # ℹ 4,920 more rows #> # ℹ 12 more variables: total_amount_due , total_adjustment_amount , #> # payer_grouping , total_payment_amount , ip_op_flag , #> # service_line , length_of_stay , expected_length_of_stay , #> # length_of_stay_threshold , los_outlier_flag , readmit_flag , #> # readmit_expectation #> #> $Cellulitis #> # A tibble: 3,311 × 17 #> mrn visit_id visit_start_date_time visit_end_date_time total_charge_amount #> #> 1 91937… 1963079… 2011-09-21 16:35:00 2011-09-23 13:42:00 20322. #> 2 14415… 1523695… 2011-09-23 13:59:00 2011-09-23 18:00:00 6860. #> 3 30115… 1278133… 2011-09-21 05:31:00 2011-09-24 10:50:00 28990. #> 4 11190… 1462795… 2011-09-22 16:32:00 2011-09-25 16:47:00 17947. #> 5 20122… 1114115… 2011-09-25 23:58:00 2011-09-26 13:30:00 8604. #> 6 66023… 1101427… 2011-09-25 02:04:00 2011-09-27 14:18:00 26726. #> 7 36903… 1842522… 2011-09-25 16:14:00 2011-09-27 18:10:00 13143. #> 8 94675… 1694578… 2011-09-28 19:23:00 2011-09-29 10:40:00 12203 #> 9 64313… 1204713… 2011-09-19 21:06:00 2011-09-30 16:54:00 95473. #> 10 81980… 1108154… 2011-09-30 22:52:00 2011-10-01 12:28:00 8901. #> # ℹ 3,301 more rows #> # ℹ 12 more variables: total_amount_due , total_adjustment_amount , #> # payer_grouping , total_payment_amount , ip_op_flag , #> # service_line , length_of_stay , expected_length_of_stay , #> # length_of_stay_threshold , los_outlier_flag , readmit_flag , #> # readmit_expectation #> #> $`Chest Pain` #> # A tibble: 2,766 × 17 #> mrn visit_id visit_start_date_time visit_end_date_time total_charge_amount #> #> 1 62048… 1900262… 2011-09-19 16:53:00 2011-09-20 19:20:00 10426. #> 2 24825… 1518935… 2011-09-19 21:51:00 2011-09-21 10:55:00 19261. #> 3 98859… 1774049… 2011-09-19 18:47:00 2011-09-22 12:50:00 27736. #> 4 60653… 1933930… 2011-09-21 23:51:00 2011-09-22 18:03:00 12116. #> 5 55103… 1113333… 2011-09-22 04:39:00 2011-09-23 14:54:00 18740. #> 6 95431… 1167648… 2011-09-22 20:11:00 2011-09-24 16:30:00 17625. #> 7 87695… 1365338… 2011-09-25 21:52:00 2011-09-26 01:47:00 8509. #> 8 36204… 1460612… 2011-09-24 20:00:00 2011-09-26 21:47:00 31526. #> 9 60438… 1812202… 2011-09-27 22:31:00 2011-09-28 11:10:00 11644. #> 10 84478… 1030571… 2011-09-28 16:29:00 2011-09-28 19:28:00 7463. #> # ℹ 2,756 more rows #> # ℹ 12 more variables: total_amount_due , total_adjustment_amount , #> # payer_grouping , total_payment_amount , ip_op_flag , #> # service_line , length_of_stay , expected_length_of_stay , #> # length_of_stay_threshold , los_outlier_flag , readmit_flag , #> # readmit_expectation #> #> $`Colonoscopy/Endoscopy` #> # A tibble: 11,486 × 17 #> mrn visit_id visit_start_date_time visit_end_date_time total_charge_amount #> #> 1 55897… 3869688… 2010-01-04 05:00:00 2010-01-04 00:00:00 8788. #> 2 13463… 3990577… 2010-01-05 05:00:00 2010-01-05 00:00:00 7607. #> 3 80092… 3361584… 2010-01-06 05:00:00 2010-01-06 00:00:00 9567. #> 4 53897… 3961488… 2010-01-06 05:00:00 2010-01-06 00:00:00 8671. #> 5 51791… 3022697… 2010-01-07 05:00:00 2010-01-07 00:00:00 7966. #> 6 94563… 3247268… 2010-01-08 05:00:00 2010-01-08 00:00:00 8695. #> 7 97321… 3978227… 2010-01-08 05:00:00 2010-01-08 00:00:00 7277. #> 8 10341… 3542481… 2010-01-08 05:00:00 2010-01-08 00:00:00 8783. #> 9 40727… 3471312… 2010-01-08 05:00:00 2010-01-08 00:00:00 8988. #> 10 96631… 3784146… 2010-01-10 20:54:00 2010-01-10 00:00:00 7656. #> # ℹ 11,476 more rows #> # ℹ 12 more variables: total_amount_due , total_adjustment_amount , #> # payer_grouping , total_payment_amount , ip_op_flag , #> # service_line , length_of_stay , expected_length_of_stay , #> # length_of_stay_threshold , los_outlier_flag , readmit_flag , #> # readmit_expectation #> #> $`GI Hemorrhage` #> # A tibble: 2,404 × 17 #> mrn visit_id visit_start_date_time visit_end_date_time total_charge_amount #> #> 1 45079… 1076298… 2011-09-24 07:08:00 2011-09-26 18:00:00 18964. #> 2 78632… 1595472… 2011-09-24 15:09:00 2011-09-27 12:06:00 27776. #> 3 80547… 1555948… 2011-09-20 01:23:00 2011-09-27 21:20:00 87188. #> 4 21014… 1246530… 2011-09-25 20:58:00 2011-09-28 15:50:00 36404. #> 5 53480… 1976271… 2011-09-20 02:55:00 2011-09-30 19:32:00 115091. #> 6 84440… 1899305… 2011-09-28 20:00:00 2011-10-01 12:06:00 26018. #> 7 55748… 1658072… 2011-09-28 23:44:00 2011-10-02 13:23:00 64608. #> 8 22340… 1938596… 2011-09-30 20:00:00 2011-10-03 14:00:00 25310. #> 9 80292… 1911753… 2011-09-30 09:09:00 2011-10-05 15:34:00 55967. #> 10 33494… 1977982… 2011-08-25 13:20:00 2011-10-05 16:38:00 301838. #> # ℹ 2,394 more rows #> # ℹ 12 more variables: total_amount_due , total_adjustment_amount , #> # payer_grouping , total_payment_amount , ip_op_flag , #> # service_line , length_of_stay , expected_length_of_stay , #> # length_of_stay_threshold , los_outlier_flag , readmit_flag , #> # readmit_expectation #> #> $`General Outpatient` #> # A tibble: 50,526 × 17 #> mrn visit_id visit_start_date_time visit_end_date_time total_charge_amount #> #> 1 86069… 3519249… 2010-01-04 05:00:00 2010-01-04 00:00:00 25984. #> 2 60856… 3602225… 2010-01-04 05:00:00 2010-01-04 00:00:00 22774. #> 3 80673… 3125290… 2010-01-04 05:00:00 2010-01-04 00:00:00 10690. #> 4 99766… 3372388… 2010-01-04 05:00:00 2010-01-04 00:00:00 7325. #> 5 23979… 3139267… 2010-01-04 05:00:00 2010-01-04 00:00:00 9119. #> 6 56640… 3346223… 2010-01-04 05:00:00 2010-01-04 00:00:00 10628 #> 7 43395… 3323331… 2010-01-04 05:00:00 2010-01-04 00:00:00 8677. #> 8 54736… 3159812… 2010-01-05 05:00:00 2010-01-05 00:00:00 9604. #> 9 71143… 3070269… 2010-01-05 05:00:00 2010-01-05 00:00:00 8839. #> 10 27377… 3185100… 2010-01-05 05:00:00 2010-01-05 00:00:00 10185. #> # ℹ 50,516 more rows #> # ℹ 12 more variables: total_amount_due , total_adjustment_amount , #> # payer_grouping , total_payment_amount , ip_op_flag , #> # service_line , length_of_stay , expected_length_of_stay , #> # length_of_stay_threshold , los_outlier_flag , readmit_flag , #> # readmit_expectation #> #> $`Joint Replacement` #> # A tibble: 447 × 17 #> mrn visit_id visit_start_date_time visit_end_date_time total_charge_amount #> #> 1 35741… 1963731… 2011-09-20 06:42:00 2011-09-23 18:27:00 70655. #> 2 45785… 1385680… 2011-09-27 07:51:00 2011-09-30 17:30:00 76480. #> 3 96001… 1647184… 2011-09-27 05:30:00 2011-09-30 18:20:00 90495. #> 4 78560… 1955538… 2011-09-22 09:00:00 2011-10-04 17:05:00 128587. #> 5 24244… 1536456… 2011-10-04 11:09:00 2011-10-07 15:13:00 80185. #> 6 45372… 1900289… 2011-10-04 06:33:00 2011-10-07 17:15:00 73753. #> 7 68583… 1223451… 2011-10-04 05:00:00 2011-10-07 17:15:00 86199. #> 8 76901… 1228116… 2011-10-04 08:25:00 2011-10-07 17:20:00 70719. #> 9 84765… 1344408… 2011-10-13 05:25:00 2011-10-18 20:21:00 82033. #> 10 13510… 1879596… 2011-10-18 05:00:00 2011-10-21 16:18:00 97454. #> # ℹ 437 more rows #> # ℹ 12 more variables: total_amount_due , total_adjustment_amount , #> # payer_grouping , total_payment_amount , ip_op_flag , #> # service_line , length_of_stay , expected_length_of_stay , #> # length_of_stay_threshold , los_outlier_flag , readmit_flag , #> # readmit_expectation #> #> $`Laparoscopic Cholecystectomy` #> # A tibble: 2,456 × 17 #> mrn visit_id visit_start_date_time visit_end_date_time total_charge_amount #> #> 1 44174… 3094545… 2010-01-05 05:00:00 2010-01-05 00:00:00 13263. #> 2 42989… 3855977… 2010-01-12 05:00:00 2010-01-13 00:00:00 13717. #> 3 80834… 3647383… 2010-01-19 05:00:00 2010-01-20 00:00:00 13915. #> 4 24888… 3164824… 2010-01-28 05:00:00 2010-01-29 00:00:00 12403. #> 5 25026… 3107332… 2010-01-28 05:00:00 2010-01-29 00:00:00 13995. #> 6 43792… 3606774… 2010-01-29 05:00:00 2010-01-30 00:00:00 13725. #> 7 31761… 3103216… 2010-02-02 05:00:00 2010-02-02 00:00:00 13763. #> 8 12868… 3439301… 2010-02-04 05:00:00 2010-02-05 00:00:00 13602. #> 9 86010… 3136153… 2010-02-05 05:00:00 2010-02-06 00:00:00 15136. #> 10 40209… 3923213… 2010-02-11 05:00:00 2010-02-11 00:00:00 12798. #> # ℹ 2,446 more rows #> # ℹ 12 more variables: total_amount_due , total_adjustment_amount , #> # payer_grouping , total_payment_amount , ip_op_flag , #> # service_line , length_of_stay , expected_length_of_stay , #> # length_of_stay_threshold , los_outlier_flag , readmit_flag , #> # readmit_expectation #> #> $MI #> # A tibble: 2,253 × 17 #> mrn visit_id visit_start_date_time visit_end_date_time total_charge_amount #> #> 1 13778… 1779125… 2011-09-22 15:44:00 2011-09-23 12:48:00 13819. #> 2 75904… 1290112… 2011-09-29 11:57:00 2011-09-29 15:15:00 23384. #> 3 56932… 1127730… 2011-09-29 21:58:00 2011-09-30 16:37:00 11806. #> 4 33544… 1537839… 2011-09-18 13:21:00 2011-10-04 15:52:00 165563. #> 5 80141… 1426155… 2011-09-18 15:50:00 2011-10-06 15:25:00 137769. #> 6 44194… 1588054… 2011-09-30 09:14:00 2011-10-07 09:00:00 64195 #> 7 15917… 1023432… 2011-10-07 04:19:00 2011-10-08 16:30:00 29082. #> 8 45753… 1636854… 2011-10-02 02:37:00 2011-10-11 14:40:00 89552. #> 9 15982… 1131846… 2011-10-09 07:14:00 2011-10-16 15:50:00 46561. #> 10 75745… 1816201… 2011-10-16 16:39:00 2011-10-17 19:56:00 10487. #> # ℹ 2,243 more rows #> # ℹ 12 more variables: total_amount_due , total_adjustment_amount , #> # payer_grouping , total_payment_amount , ip_op_flag , #> # service_line , length_of_stay , expected_length_of_stay , #> # length_of_stay_threshold , los_outlier_flag , readmit_flag , #> # readmit_expectation #> #> $`Major Depression/Bipolar Affective Disorders` #> # A tibble: 2,866 × 17 #> mrn visit_id visit_start_date_time visit_end_date_time total_charge_amount #> #> 1 83028… 1773215… 2011-09-19 16:52:00 2011-09-22 13:18:00 12668. #> 2 52413… 1344738… 2011-09-17 15:46:00 2011-09-28 15:13:00 41043. #> 3 76863… 1963121… 2011-09-20 20:26:00 2011-09-28 17:11:00 30736. #> 4 31780… 1094724… 2011-09-26 00:15:00 2011-09-30 13:55:00 17790. #> 5 51449… 1225742… 2011-09-28 22:44:00 2011-10-03 14:35:00 19806. #> 6 16347… 1925531… 2011-09-30 16:55:00 2011-10-03 15:06:00 13748. #> 7 95753… 1886595… 2011-09-24 20:06:00 2011-10-03 15:07:00 34606. #> 8 52126… 1594861… 2011-09-22 19:56:00 2011-10-03 15:21:00 40757. #> 9 75670… 1235696… 2011-09-27 16:18:00 2011-10-03 15:26:00 24597. #> 10 42724… 1433227… 2011-09-19 10:39:00 2011-10-04 12:40:00 55108. #> # ℹ 2,856 more rows #> # ℹ 12 more variables: total_amount_due , total_adjustment_amount , #> # payer_grouping , total_payment_amount , ip_op_flag , #> # service_line , length_of_stay , expected_length_of_stay , #> # length_of_stay_threshold , los_outlier_flag , readmit_flag , #> # readmit_expectation #> #> $Mastectomy #> # A tibble: 58 × 17 #> mrn visit_id visit_start_date_time visit_end_date_time total_charge_amount #> #> 1 80731… 1129236… 2011-11-07 04:43:00 2011-11-09 13:05:00 33908. #> 2 37638… 1018182… 2011-11-14 06:43:00 2011-11-15 14:20:00 28817. #> 3 57062… 1503680… 2011-11-28 04:49:00 2011-11-29 15:00:00 29532. #> 4 57598… 1330344… 2011-12-12 09:22:00 2011-12-13 18:00:00 22163. #> 5 67748… 1066637… 2011-12-12 05:32:00 2011-12-14 14:00:00 36931. #> 6 81680… 1751336… 2012-01-16 06:00:00 2012-01-16 11:25:00 19637. #> 7 26174… 1748684… 2012-01-30 05:15:00 2012-01-31 18:30:00 25352. #> 8 59559… 1265426… 2012-02-06 05:00:00 2012-02-07 16:51:00 58899. #> 9 79465… 1419822… 2012-04-02 05:45:00 2012-04-03 13:50:00 104772. #> 10 27380… 1719685… 2012-04-16 05:57:00 2012-04-17 14:35:00 86889. #> # ℹ 48 more rows #> # ℹ 12 more variables: total_amount_due , total_adjustment_amount , #> # payer_grouping , total_payment_amount , ip_op_flag , #> # service_line , length_of_stay , expected_length_of_stay , #> # length_of_stay_threshold , los_outlier_flag , readmit_flag , #> # readmit_expectation #> #> $Medical #> # A tibble: 64,435 × 17 #> mrn visit_id visit_start_date_time visit_end_date_time total_charge_amount #> #> 1 15915… 1588023… 2011-09-11 19:55:00 2011-09-13 16:01:00 23983. #> 2 24790… 1351333… 2011-09-18 22:00:00 2011-09-21 14:10:00 29385. #> 3 40945… 1350530… 2011-09-20 22:23:00 2011-09-21 16:15:00 12161. #> 4 67359… 1906290… 2011-09-19 23:09:00 2011-09-21 17:27:00 16550. #> 5 36661… 1162679… 2011-09-21 03:14:00 2011-09-21 17:30:00 17444. #> 6 59649… 1179016… 2011-09-20 22:57:00 2011-09-21 22:30:00 27419 #> 7 65736… 1669246… 2011-09-21 09:45:00 2011-09-22 11:35:00 38719. #> 8 27099… 1828863… 2011-09-21 20:19:00 2011-09-22 11:35:00 9612. #> 9 78487… 1754195… 2011-09-20 15:47:00 2011-09-22 12:30:00 21077. #> 10 17896… 1716209… 2011-09-21 15:44:00 2011-09-22 12:42:00 11714. #> # ℹ 64,425 more rows #> # ℹ 12 more variables: total_amount_due , total_adjustment_amount , #> # payer_grouping , total_payment_amount , ip_op_flag , #> # service_line , length_of_stay , expected_length_of_stay , #> # length_of_stay_threshold , los_outlier_flag , readmit_flag , #> # readmit_expectation #> #> $PTCA #> # A tibble: 1,343 × 17 #> mrn visit_id visit_start_date_time visit_end_date_time total_charge_amount #> #> 1 65802… 1922614… 2013-12-16 18:42:00 2013-12-18 15:54:00 95300. #> 2 47960… 1712037… 2013-12-17 09:24:00 2013-12-20 11:44:00 126548. #> 3 88081… 1416143… 2013-12-16 15:57:00 2013-12-21 18:29:00 165931. #> 4 47327… 1242762… 2013-12-20 23:49:00 2013-12-24 16:27:00 72849. #> 5 68288… 1687746… 2013-12-08 13:12:00 2013-12-24 18:40:00 277715. #> 6 65853… 1602546… 2013-12-24 12:16:00 2013-12-27 17:21:00 129947. #> 7 22470… 1919563… 2014-01-02 22:02:00 2014-01-05 12:45:00 122591. #> 8 70383… 1542050… 2014-01-02 17:37:00 2014-01-08 15:18:00 155744. #> 9 30699… 1996197… 2014-01-07 15:17:00 2014-01-14 15:51:00 280973. #> 10 15526… 1350260… 2014-01-11 22:29:00 2014-01-15 12:13:00 100158. #> # ℹ 1,333 more rows #> # ℹ 12 more variables: total_amount_due , total_adjustment_amount , #> # payer_grouping , total_payment_amount , ip_op_flag , #> # service_line , length_of_stay , expected_length_of_stay , #> # length_of_stay_threshold , los_outlier_flag , readmit_flag , #> # readmit_expectation #> #> $`PTCA Outpatient` #> # A tibble: 369 × 17 #> mrn visit_id visit_start_date_time visit_end_date_time total_charge_amount #> #> 1 40037… 3514125… 2013-12-18 05:00:00 2013-12-19 00:00:00 107785. #> 2 65938… 3525540… 2013-12-19 05:00:00 2013-12-20 00:00:00 99169. #> 3 64137… 3456566… 2013-12-19 05:00:00 2013-12-20 00:00:00 104680. #> 4 32157… 3927503… 2013-12-20 05:00:00 2013-12-20 00:00:00 85622. #> 5 97406… 3404098… 2014-01-08 05:00:00 2014-01-08 00:00:00 54834. #> 6 52799… 3644914… 2014-01-09 05:00:00 2014-01-10 00:00:00 38735. #> 7 31448… 3922625… 2014-01-28 05:00:00 2014-01-28 00:00:00 73034. #> 8 69180… 3654599… 2014-01-29 05:00:00 2014-01-30 00:00:00 69213. #> 9 79461… 3382468… 2014-01-30 05:00:00 2014-01-31 00:00:00 73589. #> 10 35852… 3344079… 2014-02-18 05:00:00 2014-02-18 00:00:00 73071. #> # ℹ 359 more rows #> # ℹ 12 more variables: total_amount_due , total_adjustment_amount , #> # payer_grouping , total_payment_amount , ip_op_flag , #> # service_line , length_of_stay , expected_length_of_stay , #> # length_of_stay_threshold , los_outlier_flag , readmit_flag , #> # readmit_expectation #> #> $Pneumonia #> # A tibble: 3,323 × 17 #> mrn visit_id visit_start_date_time visit_end_date_time total_charge_amount #> #> 1 41168… 1339933… 2011-09-19 00:15:00 2011-09-20 18:15:00 13585. #> 2 87344… 1581344… 2011-09-21 09:39:00 2011-09-24 18:21:00 38143. #> 3 64810… 1511895… 2011-09-23 20:30:00 2011-09-26 12:45:00 23686. #> 4 23339… 1813741… 2011-09-23 15:18:00 2011-09-26 13:23:00 26700. #> 5 43861… 1935030… 2011-09-22 14:03:00 2011-09-26 20:03:00 32690. #> 6 35356… 1551465… 2011-09-21 20:50:00 2011-09-27 16:34:00 45089. #> 7 49815… 1349707… 2011-09-23 02:48:00 2011-09-30 18:10:00 50528. #> 8 77558… 1443601… 2011-09-30 15:42:00 2011-10-01 11:28:00 12873. #> 9 72612… 1249400… 2011-09-30 19:05:00 2011-10-03 18:47:00 18688. #> 10 36317… 1539295… 2011-10-01 10:44:00 2011-10-04 13:59:00 24887. #> # ℹ 3,313 more rows #> # ℹ 12 more variables: total_amount_due , total_adjustment_amount , #> # payer_grouping , total_payment_amount , ip_op_flag , #> # service_line , length_of_stay , expected_length_of_stay , #> # length_of_stay_threshold , los_outlier_flag , readmit_flag , #> # readmit_expectation #> #> $Schizophrenia #> # A tibble: 1,681 × 17 #> mrn visit_id visit_start_date_time visit_end_date_time total_charge_amount #> #> 1 78864… 1578423… 2011-09-10 10:37:00 2011-09-16 14:08:00 25230. #> 2 90780… 1948172… 2011-09-12 20:18:00 2011-09-22 13:19:00 37537. #> 3 24439… 1541902… 2011-09-17 20:52:00 2011-09-23 14:34:00 24523. #> 4 17550… 1239946… 2011-09-15 19:56:00 2011-10-04 10:50:00 70223. #> 5 90449… 1067597… 2011-09-26 10:16:00 2011-10-06 15:08:00 40697. #> 6 21252… 1222746… 2011-10-05 10:32:00 2011-10-11 14:28:00 25232. #> 7 47554… 1507806… 2011-09-24 19:18:00 2011-10-12 15:41:00 62677. #> 8 34234… 1699816… 2011-10-06 19:05:00 2011-10-13 12:57:00 34400. #> 9 70046… 1132874… 2011-10-07 20:28:00 2011-10-14 15:26:00 26578. #> 10 74820… 1025221… 2011-10-11 20:57:00 2011-10-19 13:46:00 30806. #> # ℹ 1,671 more rows #> # ℹ 12 more variables: total_amount_due , total_adjustment_amount , #> # payer_grouping , total_payment_amount , ip_op_flag , #> # service_line , length_of_stay , expected_length_of_stay , #> # length_of_stay_threshold , los_outlier_flag , readmit_flag , #> # readmit_expectation #> #> $Surgical #> # A tibble: 14,916 × 17 #> mrn visit_id visit_start_date_time visit_end_date_time total_charge_amount #> #> 1 58762… 1957238… 2011-09-19 20:12:00 2011-09-21 11:17:00 33911. #> 2 66908… 1572987… 2011-09-20 09:09:00 2011-09-22 10:27:00 16933. #> 3 55391… 1020021… 2011-09-21 23:20:00 2011-09-22 15:44:00 13050. #> 4 28900… 1121152… 2011-09-20 05:00:00 2011-09-22 17:51:00 24769. #> 5 46455… 1937756… 2011-09-22 20:09:00 2011-09-23 18:07:00 32807. #> 6 86883… 1781570… 2011-09-23 05:00:00 2011-09-24 11:44:00 20214. #> 7 74525… 1390406… 2011-09-25 07:23:00 2011-09-26 17:45:00 37743. #> 8 91913… 1827659… 2011-09-23 13:36:00 2011-09-27 11:47:00 53769. #> 9 95797… 1767983… 2011-09-11 20:12:00 2011-09-27 15:47:00 161126. #> 10 68422… 1124488… 2011-09-26 07:18:00 2011-09-28 14:42:00 105689. #> # ℹ 14,906 more rows #> # ℹ 12 more variables: total_amount_due , total_adjustment_amount , #> # payer_grouping , total_payment_amount , ip_op_flag , #> # service_line , length_of_stay , expected_length_of_stay , #> # length_of_stay_threshold , los_outlier_flag , readmit_flag , #> # readmit_expectation #> #> $Syncope #> # A tibble: 1,854 × 17 #> mrn visit_id visit_start_date_time visit_end_date_time total_charge_amount #> #> 1 23076… 1461398… 2011-09-20 01:18:00 2011-09-20 10:38:00 13422. #> 2 84855… 1170655… 2011-09-19 18:23:00 2011-09-21 15:51:00 21865. #> 3 47360… 1041458… 2011-09-20 23:24:00 2011-09-22 13:34:00 17635 #> 4 29909… 1798395… 2011-09-22 15:38:00 2011-09-25 15:12:00 33088. #> 5 86969… 1347663… 2011-09-25 15:28:00 2011-09-26 16:43:00 14623. #> 6 16815… 1367750… 2011-09-23 17:02:00 2011-09-26 18:51:00 27595. #> 7 74671… 1467173… 2011-09-25 02:07:00 2011-09-26 22:00:00 34697. #> 8 58540… 1224109… 2011-09-22 23:12:00 2011-09-27 18:47:00 29705. #> 9 44743… 1018572… 2011-09-27 18:07:00 2011-09-28 18:40:00 16385. #> 10 69830… 1136058… 2011-09-27 10:55:00 2011-09-28 21:16:00 5867. #> # ℹ 1,844 more rows #> # ℹ 12 more variables: total_amount_due , total_adjustment_amount , #> # payer_grouping , total_payment_amount , ip_op_flag , #> # service_line , length_of_stay , expected_length_of_stay , #> # length_of_stay_threshold , los_outlier_flag , readmit_flag , #> # readmit_expectation #> #> $TIA #> # A tibble: 1,490 × 17 #> mrn visit_id visit_start_date_time visit_end_date_time total_charge_amount #> #> 1 11900… 1817373… 2011-09-26 20:51:00 2011-09-27 14:07:00 15764. #> 2 40157… 1365680… 2011-09-26 22:49:00 2011-09-29 18:35:00 27759. #> 3 81648… 1909292… 2011-10-08 15:57:00 2011-10-11 16:46:00 44648. #> 4 35853… 1358966… 2011-10-06 19:41:00 2011-10-13 11:24:00 66200. #> 5 35309… 1512759… 2011-10-10 17:33:00 2011-10-13 15:46:00 32168. #> 6 60037… 1754357… 2011-10-09 21:27:00 2011-10-13 16:03:00 37201. #> 7 24439… 1805134… 2011-10-12 14:56:00 2011-10-17 14:21:00 56238. #> 8 95326… 1662410… 2011-10-13 14:44:00 2011-10-20 16:27:00 85644. #> 9 97257… 1096965… 2011-10-19 23:02:00 2011-10-23 14:11:00 37159. #> 10 19835… 1741208… 2011-10-16 19:00:00 2011-10-24 16:56:00 65126. #> # ℹ 1,480 more rows #> # ℹ 12 more variables: total_amount_due , total_adjustment_amount , #> # payer_grouping , total_payment_amount , ip_op_flag , #> # service_line , length_of_stay , expected_length_of_stay , #> # length_of_stay_threshold , los_outlier_flag , readmit_flag , #> # readmit_expectation #> #> $`Vaginal Delivery` #> # A tibble: 11 × 17 #> mrn visit_id visit_start_date_time visit_end_date_time total_charge_amount #> #> 1 97356… 1473544… 2011-12-14 15:30:00 2011-12-14 17:37:00 5707 #> 2 54205… 1412111… 2012-01-31 07:10:00 2012-01-31 09:00:00 7885. #> 3 78836… 1257448… 2012-03-05 13:51:00 2012-03-05 16:40:00 11019. #> 4 51141… 1989466… 2012-06-12 12:02:00 2012-06-12 13:17:00 7702 #> 5 63911… 1743794… 2012-07-06 08:59:00 2012-07-06 11:07:00 7386. #> 6 16156… 1997707… 2012-07-13 09:15:00 2012-07-13 11:59:00 15250. #> 7 25535… 1161988… 2012-09-22 18:35:00 2012-09-22 22:00:00 8301. #> 8 88987… 1605284… 2012-11-04 00:50:00 2012-11-11 14:14:00 46743. #> 9 88866… 1936904… 2012-12-14 07:10:00 2012-12-15 20:37:00 12017. #> 10 93192… 1506189… 2013-03-06 12:01:00 2013-03-06 13:31:00 8192. #> 11 79312… 1724518… 2013-09-08 22:32:00 2013-09-08 23:21:00 6599. #> # ℹ 12 more variables: total_amount_due , total_adjustment_amount , #> # payer_grouping , total_payment_amount , ip_op_flag , #> # service_line , length_of_stay , expected_length_of_stay , #> # length_of_stay_threshold , los_outlier_flag , readmit_flag , #> # readmit_expectation #> #> $`Valve Procedure` #> # A tibble: 8 × 17 #> mrn visit_id visit_start_date_time visit_end_date_time total_charge_amount #> #> 1 698201… 1919502… 2014-10-01 02:44:00 2014-10-01 10:30:00 61967. #> 2 825784… 1181134… 2014-11-19 15:29:00 2014-11-20 22:42:00 95348. #> 3 697728… 1925626… 2015-06-12 22:07:00 2015-06-13 02:00:00 210729. #> 4 497633… 1911039… 2016-01-12 02:12:00 2016-01-13 12:25:00 209630. #> 5 586969… 1572755… 2016-01-12 09:06:00 2016-01-14 14:55:00 244695. #> 6 729922… 1565557… 2016-04-06 10:38:00 2016-04-15 16:33:00 215360. #> 7 507774… 1715639… 2018-06-05 00:37:00 2018-06-05 13:58:00 295358. #> 8 444943… 1920905… 2020-07-13 10:21:00 2020-07-13 15:00:00 341798. #> # ℹ 12 more variables: total_amount_due , total_adjustment_amount , #> # payer_grouping , total_payment_amount , ip_op_flag , #> # service_line , length_of_stay , expected_length_of_stay , #> # length_of_stay_threshold , los_outlier_flag , readmit_flag , #> # readmit_expectation #>"},{"path":"https://www.spsanderson.com/healthyR/reference/opt_bin.html","id":null,"dir":"Reference","previous_headings":"","what":"Get the optimal binwidth for a histogram — opt_bin","title":"Get the optimal binwidth for a histogram — opt_bin","text":"Gives optimal binwidth histogram given data set, value desired amount bins","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/opt_bin.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get the optimal binwidth for a histogram — opt_bin","text":"","code":"opt_bin(.data, .value_col, .iters = 30)"},{"path":"https://www.spsanderson.com/healthyR/reference/opt_bin.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get the optimal binwidth for a histogram — opt_bin","text":".data data set question .value_col column holds values .iters many times cost function loop run","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/opt_bin.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get the optimal binwidth for a histogram — opt_bin","text":"tibble histogram breakpoints","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/opt_bin.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Get the optimal binwidth for a histogram — opt_bin","text":"Modified Hideaki Shimazaki Department Physics, Kyoto University shimazaki ton.scphys.kyoto-u.ac.jp Feel free modify/distribute program. Supply data.frame/tibble value column. optimal binwidth computed amount binds desired","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/opt_bin.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get the optimal binwidth for a histogram — opt_bin","text":"","code":"suppressPackageStartupMessages(library(purrr)) suppressPackageStartupMessages(library(dplyr)) df_tbl <- rnorm(n = 1000, mean = 0, sd = 1) df_tbl <- df_tbl %>% as_tibble() %>% set_names(\"value\") df_tbl %>% opt_bin( .value_col = value , .iters = 100 ) #> # A tibble: 10 × 1 #> value #> #> 1 -3.46 #> 2 -2.62 #> 3 -1.78 #> 4 -0.939 #> 5 -0.0995 #> 6 0.740 #> 7 1.58 #> 8 2.42 #> 9 3.26 #> 10 4.10"},{"path":"https://www.spsanderson.com/healthyR/reference/pipe.html","id":null,"dir":"Reference","previous_headings":"","what":"Pipe operator — %>%","title":"Pipe operator — %>%","text":"See magrittr::%>% details.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/pipe.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Pipe operator — %>%","text":"","code":"lhs %>% rhs"},{"path":"https://www.spsanderson.com/healthyR/reference/px_cc_mapping.html","id":null,"dir":"Reference","previous_headings":"","what":"Procedure to Condition Code Mapping file — px_cc_mapping","title":"Procedure to Condition Code Mapping file — px_cc_mapping","text":"dataset containing Procedure Code AHRQ Condition Code Mapping used helping define servce lines inpatient discharges.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/px_cc_mapping.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Procedure to Condition Code Mapping file — px_cc_mapping","text":"","code":"data(px_cc_mapping)"},{"path":"https://www.spsanderson.com/healthyR/reference/px_cc_mapping.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Procedure to Condition Code Mapping file — px_cc_mapping","text":"data frame 79721 rows 5 variables","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/px_cc_mapping.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Procedure to Condition Code Mapping file — px_cc_mapping","text":"CC_Code. PX_1, PX_2, ..., PX_n CC_Desc. PX_1 = Genitourinary incontinence procedures ICD_Ver_Flag. 10 9 ICDCode. ICD-9 ICD-10 Code Procedure. Inject Implant Urethra","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/save_to_excel.html","id":null,"dir":"Reference","previous_headings":"","what":"Save a file to Excel — save_to_excel","title":"Save a file to Excel — save_to_excel","text":"Save tibble/data.frame excel .xlsx file. file automatically save_dtime format 20201109_132416 November 11th, 2020 1:24:16PM.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/save_to_excel.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Save a file to Excel — save_to_excel","text":"","code":"save_to_excel(.data, .file_name)"},{"path":"https://www.spsanderson.com/healthyR/reference/save_to_excel.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Save a file to Excel — save_to_excel","text":".data tibble/data.frame want save .xlsx file. .file_name name want give file.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/save_to_excel.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Save a file to Excel — save_to_excel","text":"saved excel file","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/save_to_excel.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Save a file to Excel — save_to_excel","text":"Requires tibble/data.frame passed .","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/save_to_excel.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Save a file to Excel — save_to_excel","text":"Steven P. Sanderson II, MPH","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/service_line_augment.html","id":null,"dir":"Reference","previous_headings":"","what":"Service Line Grouper Augment Function — service_line_augment","title":"Service Line Grouper Augment Function — service_line_augment","text":"Takes arguments data.frame/tibble returns service line augmented data.frame/tibble set patients.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/service_line_augment.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Service Line Grouper Augment Function — service_line_augment","text":"","code":"service_line_augment(.data, .dx_col, .px_col, .drg_col)"},{"path":"https://www.spsanderson.com/healthyR/reference/service_line_augment.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Service Line Grouper Augment Function — service_line_augment","text":".data data passed augmented function. .dx_col column containing Principal Diagnosis discharge. .px_col column containing Principal Coded Procedure discharge. possible blank. .drg_col DRG Number coded inpatient discharge.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/service_line_augment.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Service Line Grouper Augment Function — service_line_augment","text":"augmented data.frame/tibble service line appended new column.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/service_line_augment.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Service Line Grouper Augment Function — service_line_augment","text":"augment function appends vector data.frame/tibble passed .data parameter. data.frame/tibble required, along principal diagnosis column, principal procedure column, column DRG number. needed function can join dx_cc_mapping px_cc_mapping columns provide service line. function works visits coded using ICD Version 10 . Lets take example discharge, DRG 896 Principal Diagnosis code maps DX_660, visit get grouped alcohol_abuse DRG 896: ALCOHOL, DRUG ABUSE DEPENDENCE WITHOUT REHABILITATION THERAPY MAJOR COMPLICATION COMORBIDITY (MCC) DX_660 Maps following ICD-10 Codes ie F1010 Alcohol abuse, uncomplicated:","code":"library(healthyR) dx_cc_mapping %>% filter(CC_Code == \"DX_660\", ICD_Ver_Flag == \"10\")"},{"path":"https://www.spsanderson.com/healthyR/reference/service_line_augment.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Service Line Grouper Augment Function — service_line_augment","text":"Steven P. Sanderson II, MPH","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/service_line_augment.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Service Line Grouper Augment Function — service_line_augment","text":"","code":"df <- data.frame( dx_col = \"F10.10\", px_col = NA, drg_col = \"896\" ) service_line_augment( .data = df, .dx_col = dx_col, .px_col = px_col, .drg_col = drg_col ) #> # A tibble: 1 × 4 #> dx_col px_col drg_col service_line #> #> 1 F10.10 NA 896 alcohol_abuse"},{"path":"https://www.spsanderson.com/healthyR/reference/service_line_vec.html","id":null,"dir":"Reference","previous_headings":"","what":"Service Line Grouper Vectorized Function — service_line_vec","title":"Service Line Grouper Vectorized Function — service_line_vec","text":"Takes arguments data.frame/tibble returns service line vector set patients.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/service_line_vec.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Service Line Grouper Vectorized Function — service_line_vec","text":"","code":"service_line_vec(.data, .dx_col, .px_col, .drg_col)"},{"path":"https://www.spsanderson.com/healthyR/reference/service_line_vec.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Service Line Grouper Vectorized Function — service_line_vec","text":".data data passed augmented function. .dx_col column containing Principal Diagnosis discharge. .px_col column containing Principal Coded Procedure discharge. possible blank. .drg_col DRG Number coded inpatient discharge.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/service_line_vec.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Service Line Grouper Vectorized Function — service_line_vec","text":"vector service line assignments.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/service_line_vec.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Service Line Grouper Vectorized Function — service_line_vec","text":"vectorized function returns vector. can applied inside mutate statement using dplyr desired. data.frame/tibble required, along principal diagnosis column, principal procedure column, column DRG number. needed function can join dx_cc_mapping px_cc_mapping columns provide service line. function works visits coded using ICD Version 10 . Lets take example discharge, DRG 896 Principal Diagnosis code maps DX_660, visit get grouped alcohol_abuse DRG 896: ALCOHOL, DRUG ABUSE DEPENDENCE WITHOUT REHABILITATION THERAPY MAJOR COMPLICATION COMORBIDITY (MCC) DX_660 Maps following ICD-10 Codes ie F1010 Alcohol abuse, uncomplicated:","code":"library(healthyR) dx_cc_mapping %>% filter(CC_Code == \"DX_660\", ICD_Ver_Flag == \"10\")"},{"path":"https://www.spsanderson.com/healthyR/reference/service_line_vec.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Service Line Grouper Vectorized Function — service_line_vec","text":"Steven P. Sanderson II, MPH","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/service_line_vec.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Service Line Grouper Vectorized Function — service_line_vec","text":"","code":"df <- data.frame( dx_col = \"F10.10\", px_col = NA, drg_col = \"896\" ) service_line_vec( .data = df, .dx_col = dx_col, .px_col = px_col, .drg_col = drg_col ) #> [1] \"alcohol_abuse\""},{"path":"https://www.spsanderson.com/healthyR/reference/sql_left.html","id":null,"dir":"Reference","previous_headings":"","what":"Use SQL LEFT type function — sql_left","title":"Use SQL LEFT type function — sql_left","text":"Perform SQL LEFT() type function piece text","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/sql_left.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Use SQL LEFT type function — sql_left","text":"","code":"sql_left(.text, .num_char)"},{"path":"https://www.spsanderson.com/healthyR/reference/sql_left.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Use SQL LEFT type function — sql_left","text":".text piece text/string manipulated .num_char many characters want grab","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/sql_left.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Use SQL LEFT type function — sql_left","text":"must supply data want manipulate.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/sql_left.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Use SQL LEFT type function — sql_left","text":"","code":"sql_left(\"text\", 3) #> [1] \"tex\""},{"path":"https://www.spsanderson.com/healthyR/reference/sql_mid.html","id":null,"dir":"Reference","previous_headings":"","what":"Use SQL MID type function — sql_mid","title":"Use SQL MID type function — sql_mid","text":"Perform SQL SUBSTRING type function","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/sql_mid.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Use SQL MID type function — sql_mid","text":"","code":"sql_mid(.text, .start_num, .num_char)"},{"path":"https://www.spsanderson.com/healthyR/reference/sql_mid.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Use SQL MID type function — sql_mid","text":".text piece text/string manipulated .start_num place start .num_char many characters want grab","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/sql_mid.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Use SQL MID type function — sql_mid","text":"must supply data want manipulate.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/sql_mid.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Use SQL MID type function — sql_mid","text":"","code":"sql_mid(\"this is some text\", 6, 2) #> [1] \"is\""},{"path":"https://www.spsanderson.com/healthyR/reference/sql_right.html","id":null,"dir":"Reference","previous_headings":"","what":"Use SQL RIGHT type functions — sql_right","title":"Use SQL RIGHT type functions — sql_right","text":"Perform SQL RIGHT type function","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/sql_right.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Use SQL RIGHT type functions — sql_right","text":"","code":"sql_right(.text, .num_char)"},{"path":"https://www.spsanderson.com/healthyR/reference/sql_right.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Use SQL RIGHT type functions — sql_right","text":".text piece text/string manipulated .num_char many characters want grab","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/sql_right.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Use SQL RIGHT type functions — sql_right","text":"must supply data want manipulate.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/sql_right.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Use SQL RIGHT type functions — sql_right","text":"","code":"sql_right(\"this is some more text\", 3) #> [1] \"ext\""},{"path":"https://www.spsanderson.com/healthyR/reference/tidyeval.html","id":null,"dir":"Reference","previous_headings":"","what":"Tidy eval helpers — tidyeval","title":"Tidy eval helpers — tidyeval","text":"sym() creates symbol string syms() creates list symbols character vector. enquo() enquos() delay execution one several function arguments. enquo() returns single quoted expression, like blueprint delayed computation. enquos() returns list quoted expressions. expr() quotes new expression locally. mostly useful build new expressions around arguments captured enquo() enquos(): expr(mean(!!enquo(arg), na.rm = TRUE)). as_name() transforms quoted variable name string. Supplying something else quoted variable name error. unlike as_label() also returns single string supports kind R object input, including quoted function calls vectors. purpose summarise object single label. label often suitable default name. know quoted expression contains (instance expressions captured enquo() variable name, call function, unquoted constant), use as_label(). know quoted simple variable name, like enforce , use as_name(). learn tidy eval use tools, visit Metaprogramming section Advanced R.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/top_n_tbl.html","id":null,"dir":"Reference","previous_headings":"","what":"Top N tibble — top_n_tbl","title":"Top N tibble — top_n_tbl","text":"Get tibble returned n records sorted either descending order (default) ascending order.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/top_n_tbl.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Top N tibble — top_n_tbl","text":"","code":"top_n_tbl(.data, .n_records, .arrange_value = TRUE, ...)"},{"path":"https://www.spsanderson.com/healthyR/reference/top_n_tbl.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Top N tibble — top_n_tbl","text":".data data want pass function .n_records many records want returned .arrange_value boolean TRUE default. TRUE sorts data descending order ... columns want pass function.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/top_n_tbl.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Top N tibble — top_n_tbl","text":"Requires data.frame/tibble Requires least one column chosen inside ... return tibble sorted order chosen descending default","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/top_n_tbl.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Top N tibble — top_n_tbl","text":"Steven P. Sanderson II, MPH","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/top_n_tbl.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Top N tibble — top_n_tbl","text":"","code":"library(healthyR.data) df <- healthyR_data df_tbl <- top_n_tbl( .data = df , .n_records = 3 , .arrange_value = TRUE , service_line , payer_grouping ) print(df_tbl) #> # A tibble: 3 × 3 #> service_line payer_grouping n #> #> 1 Medical Medicare A 30250 #> 2 General Outpatient Medicare B 13646 #> 3 General Outpatient Blue Cross 10607"},{"path":"https://www.spsanderson.com/healthyR/reference/ts_alos_plt.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot ALOS - Average Length of Stay — ts_alos_plt","title":"Plot ALOS - Average Length of Stay — ts_alos_plt","text":"Plot ALOS - Average Length Stay","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/ts_alos_plt.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot ALOS - Average Length of Stay — ts_alos_plt","text":"","code":"ts_alos_plt(.data, .date_col, .value_col, .by_grouping, .interactive)"},{"path":"https://www.spsanderson.com/healthyR/reference/ts_alos_plt.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot ALOS - Average Length of Stay — ts_alos_plt","text":".data time series data need pass .date_col date column .value_col value column .by_grouping want data summarized - \"sec\", \"min\", \"hour\", \"day\", \"week\", \"month\", \"quarter\" \"year\" .interactive TRUE FALSE. TRUE returns plotly plot FALSE returns static ggplot2 plot","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/ts_alos_plt.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot ALOS - Average Length of Stay — ts_alos_plt","text":"timetk time series plot","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/ts_alos_plt.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Plot ALOS - Average Length of Stay — ts_alos_plt","text":"Expects tibble date time column value column Uses timetk underlying sumarization plot .by_grouping missing default \"day\" static ggplot2 object return .interactive function FALSE otherwise plotly plot returned.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/ts_alos_plt.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Plot ALOS - Average Length of Stay — ts_alos_plt","text":"Steven P. Sanderson II, MPH","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/ts_alos_plt.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot ALOS - Average Length of Stay — ts_alos_plt","text":"","code":"library(healthyR) library(healthyR.data) library(timetk) library(dplyr) library(purrr) # Make A Series of Dates ---- data_tbl <- healthyR_data df_tbl <- data_tbl %>% filter(ip_op_flag == \"I\") %>% select(visit_end_date_time, length_of_stay) %>% summarise_by_time( .date_var = visit_end_date_time , .by = \"day\" , visits = mean(length_of_stay, na.rm = TRUE) ) %>% filter_by_time( .date_var = visit_end_date_time , .start_date = \"2012\" , .end_date = \"2019\" ) %>% set_names(\"Date\",\"Values\") ts_alos_plt( .data = df_tbl , .date_col = Date , .value_col = Values , .by = \"month\" , .interactive = FALSE )"},{"path":"https://www.spsanderson.com/healthyR/reference/ts_census_los_daily_tbl.html","id":null,"dir":"Reference","previous_headings":"","what":"Time Series - Census and LOS by Day — ts_census_los_daily_tbl","title":"Time Series - Census and LOS by Day — ts_census_los_daily_tbl","text":"Sometimes important know census given day, average length stay given day, including patients yet discharged. can easily achieved. return one record every account data still need summarized. multiple entries per day records show therefore multiple entries column date resulting tibble. want aggregate able easily. record .start_date_col filled corresponding end_date null end date set equal Sys.Date() record start_date NA discarded. function can take little bit time run join comparison runs.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/ts_census_los_daily_tbl.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Time Series - Census and LOS by Day — ts_census_los_daily_tbl","text":"","code":"ts_census_los_daily_tbl( .data, .keep_nulls_only = FALSE, .start_date_col, .end_date_col, .by_time = \"day\" )"},{"path":"https://www.spsanderson.com/healthyR/reference/ts_census_los_daily_tbl.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Time Series - Census and LOS by Day — ts_census_los_daily_tbl","text":".data data want pass function .keep_nulls_only boolean keep records NULL end date, meaning patient still admitted. default FALSE brings back records. .start_date_col column containing start date record .end_date_col column containing end date record. .by_time want data presented, defaults day remain way unless need granular data.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/ts_census_los_daily_tbl.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Time Series - Census and LOS by Day — ts_census_los_daily_tbl","text":"tibble object","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/ts_census_los_daily_tbl.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Time Series - Census and LOS by Day — ts_census_los_daily_tbl","text":"Requires dataset least start date column end date column Takes single boolean parameter","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/ts_census_los_daily_tbl.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Time Series - Census and LOS by Day — ts_census_los_daily_tbl","text":"Steven P. Sanderson II, MPH","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/ts_census_los_daily_tbl.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Time Series - Census and LOS by Day — ts_census_los_daily_tbl","text":"","code":"library(healthyR) library(healthyR.data) library(dplyr) df <- healthyR_data df_tbl <- df %>% filter(ip_op_flag == \"I\") %>% select(visit_start_date_time, visit_end_date_time) %>% timetk::filter_by_time(.date_var = visit_start_date_time, .start_date = \"2020\") ts_census_los_daily_tbl( .data = df_tbl , .keep_nulls_only = FALSE , .start_date_col = visit_start_date_time , .end_date_col = visit_end_date_time ) #> # A tibble: 45,572 × 5 #> date visit_start_date_time visit_end_date_time los census #> #> 1 2020-01-01 2020-01-01 2020-01-02 1 1 #> 2 2020-01-01 2020-01-01 2020-01-02 1 1 #> 3 2020-01-01 2020-01-01 2020-01-02 1 1 #> 4 2020-01-01 2020-01-01 2020-01-03 2 1 #> 5 2020-01-01 2020-01-01 2020-01-03 2 1 #> 6 2020-01-01 2020-01-01 2020-01-03 2 1 #> 7 2020-01-01 2020-01-01 2020-01-04 3 1 #> 8 2020-01-01 2020-01-01 2020-01-04 3 1 #> 9 2020-01-01 2020-01-01 2020-01-04 3 1 #> 10 2020-01-01 2020-01-01 2020-01-05 4 1 #> # ℹ 45,562 more rows"},{"path":"https://www.spsanderson.com/healthyR/reference/ts_median_excess_plt.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a plot showing the excess of the median value — ts_median_excess_plt","title":"Create a plot showing the excess of the median value — ts_median_excess_plt","text":"Plot excess +/- median value grouped certain time parameters.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/ts_median_excess_plt.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a plot showing the excess of the median value — ts_median_excess_plt","text":"","code":"ts_median_excess_plt( .data, .date_col, .value_col, .x_axis, .ggplot_group_var, .years_back )"},{"path":"https://www.spsanderson.com/healthyR/reference/ts_median_excess_plt.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a plot showing the excess of the median value — ts_median_excess_plt","text":".data data analyzed, data must tibble/data.frame. .date_col column tibble holds date. .value_col column holds value interest. .x_axis x-axis, day, week, etc. .ggplot_group_var variable group ggplot . .years_back many yeas back want go order compute median value.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/ts_median_excess_plt.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create a plot showing the excess of the median value — ts_median_excess_plt","text":"ggplot2 plot","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/ts_median_excess_plt.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Create a plot showing the excess of the median value — ts_median_excess_plt","text":"Supply data want view see excess +/- median values specified time series tibble.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/ts_median_excess_plt.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create a plot showing the excess of the median value — ts_median_excess_plt","text":"","code":"suppressPackageStartupMessages(library(timetk)) ts_signature_tbl( .data = m4_daily , .date_col = date ) %>% ts_median_excess_plt( .date_col = date , .value_col = value , .x_axis = month , .ggplot_group_var = year , .years_back = 1 ) #> pad applied on the interval: day #> Joining with `by = join_by(month)` #> Warning: The `` argument of `guides()` cannot be `FALSE`. Use \"none\" instead as #> of ggplot2 3.3.4. #> ℹ The deprecated feature was likely used in the healthyR package. #> Please report the issue at . #> Warning: Removed 261 rows containing missing values (`geom_line()`)."},{"path":"https://www.spsanderson.com/healthyR/reference/ts_plt.html","id":null,"dir":"Reference","previous_headings":"","what":"Time Series Plot — ts_plt","title":"Time Series Plot — ts_plt","text":"warpper function timetk::plot_time_series() function limited functionality parameter set. see full reference please visit timetk package site.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/ts_plt.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Time Series Plot — ts_plt","text":"","code":"ts_plt( .data, .date_col, .value_col, .color_col = NULL, .facet_col = NULL, .facet_ncol = NULL, .interactive = FALSE )"},{"path":"https://www.spsanderson.com/healthyR/reference/ts_plt.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Time Series Plot — ts_plt","text":".data data pass function, must tibble/data.frame. .date_col column holding date. .value_col column holding value. .color_col column holding variable color. .facet_col column holding variable faceting. .facet_ncol many columns want. .interactive Return plotly plot set TRUE static ggplot2 plot set FALSE. default FALSE.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/ts_plt.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Time Series Plot — ts_plt","text":"plotly plot ggplot2 static plot","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/ts_plt.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Time Series Plot — ts_plt","text":"function takes arguments function presets others choosing defaults others. smoother functionality turned .","code":""},{"path":[]},{"path":"https://www.spsanderson.com/healthyR/reference/ts_plt.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Time Series Plot — ts_plt","text":"Steven P. Sanderson II, MPH","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/ts_plt.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Time Series Plot — ts_plt","text":"","code":"suppressPackageStartupMessages(library(dplyr)) library(timetk) library(healthyR.data) healthyR.data::healthyR_data %>% filter(ip_op_flag == \"I\") %>% select(visit_end_date_time, service_line) %>% filter_by_time( .date_var = visit_end_date_time , .start_date = \"2020\" ) %>% group_by(service_line) %>% summarize_by_time( .date_var = visit_end_date_time , .by = \"month\" , visits = n() ) %>% ungroup() %>% ts_plt( .date_col = visit_end_date_time , .value_col = visits , .color_col = service_line )"},{"path":"https://www.spsanderson.com/healthyR/reference/ts_readmit_rate_plt.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot Readmit Rate — ts_readmit_rate_plt","title":"Plot Readmit Rate — ts_readmit_rate_plt","text":"Plot Readmit Rate","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/ts_readmit_rate_plt.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot Readmit Rate — ts_readmit_rate_plt","text":"","code":"ts_readmit_rate_plt(.data, .date_col, .value_col, .by_grouping, .interactive)"},{"path":"https://www.spsanderson.com/healthyR/reference/ts_readmit_rate_plt.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot Readmit Rate — ts_readmit_rate_plt","text":".data data need pass. .date_col date column. .value_col value column. .by_grouping want data summarized - \"sec\", \"min\", \"hour\", \"day\", \"week\", \"month\", \"quarter\" \"year\". .interactive TRUE FALSE. TRUE returns plotly plot FALSE returns static ggplot2 plot.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/ts_readmit_rate_plt.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot Readmit Rate — ts_readmit_rate_plt","text":"timetk time series plot interactive","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/ts_readmit_rate_plt.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Plot Readmit Rate — ts_readmit_rate_plt","text":"Expects tibble date time column value column Uses timetk underlying sumarization plot .by_grouping missing default \"day\"","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/ts_readmit_rate_plt.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Plot Readmit Rate — ts_readmit_rate_plt","text":"Steven P. Sanderson II, MPH","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/ts_readmit_rate_plt.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot Readmit Rate — ts_readmit_rate_plt","text":"","code":"set.seed(123) suppressPackageStartupMessages(library(timetk)) suppressPackageStartupMessages(library(purrr)) suppressPackageStartupMessages(library(dplyr)) ts_tbl <- tk_make_timeseries( start = \"2019-01-01\" , by = \"day\" , length_out = \"1 year 6 months\" ) values <- arima.sim( model = list( order = c(0, 1, 0)) , n = 547 , mean = 1 , sd = 5 ) df_tbl <- tibble( x = ts_tbl , y = values ) %>% set_names(\"Date\",\"Values\") ts_readmit_rate_plt( .data = df_tbl , .date_col = Date , .value_col = Values , .by = \"month\" , .interactive = FALSE )"},{"path":"https://www.spsanderson.com/healthyR/reference/ts_signature_tbl.html","id":null,"dir":"Reference","previous_headings":"","what":"Make a Time Enhanced Tibble — ts_signature_tbl","title":"Make a Time Enhanced Tibble — ts_signature_tbl","text":"Returns tibble adds time series signature timetk::tk_augment_timeseries_signature() function. added chosen date column defined .date_col parameter.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/ts_signature_tbl.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Make a Time Enhanced Tibble — ts_signature_tbl","text":"","code":"ts_signature_tbl(.data, .date_col, .pad_time = TRUE, ...)"},{"path":"https://www.spsanderson.com/healthyR/reference/ts_signature_tbl.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Make a Time Enhanced Tibble — ts_signature_tbl","text":".data data analyzed. .date_col column holds date. .pad_time Boolean TRUE/FALSE. TRUE timetk::pad_by_time() function called used data.frame modification. default TRUE. ... Grouping variables used dplyr::group_by() using timetk::pad_by_time()","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/ts_signature_tbl.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Make a Time Enhanced Tibble — ts_signature_tbl","text":"tibble","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/ts_signature_tbl.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Make a Time Enhanced Tibble — ts_signature_tbl","text":"Supply data date column add year, month, week, week day hour tibble. original date column kept. Returns time-series signature tibble. must know data going function certain columns dropped kept using functions","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/ts_signature_tbl.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Make a Time Enhanced Tibble — ts_signature_tbl","text":"","code":"library(timetk) ts_signature_tbl( .data = m4_daily , .date_col = date , .pad_time = TRUE , id ) #> pad applied on the interval: day #> # A tibble: 9,743 × 31 #> id date value index.num diff year year.iso half quarter month #> #> 1 D410 1978-06-23 9109. 267408000 NA 1978 1978 1 2 6 #> 2 D410 1978-06-24 9103. 267494400 86400 1978 1978 1 2 6 #> 3 D410 1978-06-25 9116. 267580800 86400 1978 1978 1 2 6 #> 4 D410 1978-06-26 9116. 267667200 86400 1978 1978 1 2 6 #> 5 D410 1978-06-27 9106. 267753600 86400 1978 1978 1 2 6 #> 6 D410 1978-06-28 9094. 267840000 86400 1978 1978 1 2 6 #> 7 D410 1978-06-29 9094. 267926400 86400 1978 1978 1 2 6 #> 8 D410 1978-06-30 9084. 268012800 86400 1978 1978 1 2 6 #> 9 D410 1978-07-01 9081. 268099200 86400 1978 1978 2 3 7 #> 10 D410 1978-07-02 9047. 268185600 86400 1978 1978 2 3 7 #> # ℹ 9,733 more rows #> # ℹ 21 more variables: month.xts , month.lbl , day , hour , #> # minute , second , hour12 , am.pm , wday , #> # wday.xts , wday.lbl , mday , qday , yday , #> # mweek , week , week.iso , week2 , week3 , #> # week4 , mday7 "},{"path":"https://www.spsanderson.com/healthyR/reference/umap_list.html","id":null,"dir":"Reference","previous_headings":"","what":"UMAP Projection — umap_list","title":"UMAP Projection — umap_list","text":"Create umap object uwot::umap() function.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/umap_list.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"UMAP Projection — umap_list","text":"","code":"umap_list(.data, .kmeans_map_tbl, .k_cluster = 5)"},{"path":"https://www.spsanderson.com/healthyR/reference/umap_list.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"UMAP Projection — umap_list","text":".data data kmeans_user_item_tbl() function. .kmeans_map_tbl data kmeans_mapped_tbl(). .k_cluster Pick desired amount clusters analysis scree plot.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/umap_list.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"UMAP Projection — umap_list","text":"list tibbles umap object","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/umap_list.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"UMAP Projection — umap_list","text":"takes user item table/matix produced kmeans_user_item_tbl() function. function uses defaults uwot::umap().","code":""},{"path":[]},{"path":"https://www.spsanderson.com/healthyR/reference/umap_list.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"UMAP Projection — umap_list","text":"Steven P. Sanderson II, MPH","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/umap_list.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"UMAP Projection — umap_list","text":"","code":"library(healthyR.data) library(healthyR) library(dplyr) library(broom) data_tbl <- healthyR_data %>% filter(ip_op_flag == \"I\") %>% filter(payer_grouping != \"Medicare B\") %>% filter(payer_grouping != \"?\") %>% select(service_line, payer_grouping) %>% mutate(record = 1) %>% as_tibble() uit_tbl <- kmeans_user_item_tbl( .data = data_tbl , .row_input = service_line , .col_input = payer_grouping , .record_input = record ) kmm_tbl <- kmeans_mapped_tbl(uit_tbl) umap_list(.data = uit_tbl, kmm_tbl, 3) #> Warning: The `x` argument of `as_tibble.matrix()` must have unique column names if `.name_repair` is omitted as of tibble 2.0.0. #> Using compatibility `.name_repair`. #> This warning is displayed once every 8 hours. #> Call `lifecycle::last_lifecycle_warnings()` to see where this warning was generated. #> Joining, by = \"service_line\" #> $umap_obj #> [,1] [,2] #> [1,] -1.20154126 -1.47929355 #> [2,] -1.85642035 -0.92673132 #> [3,] 2.06673794 0.43277195 #> [4,] 0.50777595 0.88411787 #> [5,] 1.39594083 0.91600016 #> [6,] 2.07423394 0.07035807 #> [7,] -1.58056147 0.54257897 #> [8,] -1.28963168 -0.07908270 #> [9,] 1.64515095 0.56890276 #> [10,] 0.51813190 0.06985691 #> [11,] -1.65750105 -0.38041183 #> [12,] 1.28338330 -0.23311302 #> [13,] -1.14359362 -0.99453851 #> [14,] -1.57960684 0.21351746 #> [15,] 0.07514446 0.57518891 #> [16,] -0.79473717 0.35539225 #> [17,] 1.41217868 0.20038059 #> [18,] -0.87235720 -0.62273332 #> [19,] -1.12270386 0.55439070 #> [20,] 0.89454477 0.56136778 #> [21,] 0.92169182 0.11029461 #> [22,] -1.39727528 -1.20793316 #> [23,] 1.70101528 -0.13128158 #> attr(,\"scaled:center\") #> [1] -3.380066 5.532106 #> #> $umap_results_tbl #> # A tibble: 23 × 3 #> x y service_line #> #> 1 -1.20 -1.48 Alcohol Abuse #> 2 -1.86 -0.927 Bariatric Surgery For Obesity #> 3 2.07 0.433 CHF #> 4 0.508 0.884 COPD #> 5 1.40 0.916 CVA #> 6 2.07 0.0704 Carotid Endarterectomy #> 7 -1.58 0.543 Cellulitis #> 8 -1.29 -0.0791 Chest Pain #> 9 1.65 0.569 GI Hemorrhage #> 10 0.518 0.0699 Joint Replacement #> # … with 13 more rows #> # ℹ Use `print(n = ...)` to see more rows #> #> $kmeans_obj #> K-means clustering with 3 clusters of sizes 6, 12, 5 #> #> Cluster means: #> Blue Cross Commercial Compensation Exchange Plans HMO Medicaid #> 1 0.1170278 0.03141187 0.0101665392 0.013865190 0.09822472 0.08557952 #> 2 0.0783745 0.02182129 0.0043244347 0.006202137 0.04493860 0.03684344 #> 3 0.1495475 0.03679700 0.0003066332 0.020729565 0.16252855 0.13072521 #> Medicaid HMO Medicare A Medicare HMO No Fault Self Pay #> 1 0.14652195 0.3535395 0.10524131 0.007067791 0.031353724 #> 2 0.08001653 0.5625037 0.15152338 0.003475542 0.009976485 #> 3 0.31446157 0.1318675 0.03192357 0.001364577 0.019748398 #> #> Clustering vector: #> [1] 3 3 2 2 2 2 1 1 2 2 3 2 3 1 2 1 2 1 1 2 2 3 2 #> #> Within cluster sum of squares by cluster: #> [1] 0.08456928 0.09625399 0.19152559 #> (between_SS / total_SS = 73.6 %) #> #> Available components: #> #> [1] \"cluster\" \"centers\" \"totss\" \"withinss\" \"tot.withinss\" #> [6] \"betweenss\" \"size\" \"iter\" \"ifault\" #> #> $kmeans_cluster_tbl #> # A tibble: 23 × 2 #> service_line .cluster #> #> 1 Alcohol Abuse 3 #> 2 Bariatric Surgery For Obesity 3 #> 3 CHF 2 #> 4 COPD 2 #> 5 CVA 2 #> 6 Carotid Endarterectomy 2 #> 7 Cellulitis 1 #> 8 Chest Pain 1 #> 9 GI Hemorrhage 2 #> 10 Joint Replacement 2 #> # … with 13 more rows #> # ℹ Use `print(n = ...)` to see more rows #> #> $umap_kmeans_cluster_results_tbl #> # A tibble: 23 × 4 #> x y service_line .cluster #> #> 1 -1.20 -1.48 Alcohol Abuse 3 #> 2 -1.86 -0.927 Bariatric Surgery For Obesity 3 #> 3 2.07 0.433 CHF 2 #> 4 0.508 0.884 COPD 2 #> 5 1.40 0.916 CVA 2 #> 6 2.07 0.0704 Carotid Endarterectomy 2 #> 7 -1.58 0.543 Cellulitis 1 #> 8 -1.29 -0.0791 Chest Pain 1 #> 9 1.65 0.569 GI Hemorrhage 2 #> 10 0.518 0.0699 Joint Replacement 2 #> # … with 13 more rows #> # ℹ Use `print(n = ...)` to see more rows #>"},{"path":"https://www.spsanderson.com/healthyR/reference/umap_plt.html","id":null,"dir":"Reference","previous_headings":"","what":"UMAP and K-Means Cluster Visualization — umap_plt","title":"UMAP and K-Means Cluster Visualization — umap_plt","text":"Create UMAP Projection plot.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/umap_plt.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"UMAP and K-Means Cluster Visualization — umap_plt","text":"","code":"umap_plt(.data, .point_size = 2, .label = TRUE)"},{"path":"https://www.spsanderson.com/healthyR/reference/umap_plt.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"UMAP and K-Means Cluster Visualization — umap_plt","text":".data data umap_list() function. .point_size desired size points plot. .label ggrepel::geom_label_repel() used display cluster user labels.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/umap_plt.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"UMAP and K-Means Cluster Visualization — umap_plt","text":"ggplot2 UMAP Projection clusters represented colors.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/umap_plt.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"UMAP and K-Means Cluster Visualization — umap_plt","text":"takes umap_kmeans_cluster_results_tbl umap_list() function output.","code":""},{"path":[]},{"path":"https://www.spsanderson.com/healthyR/reference/umap_plt.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"UMAP and K-Means Cluster Visualization — umap_plt","text":"Steven P. Sanderson II, MPH","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/umap_plt.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"UMAP and K-Means Cluster Visualization — umap_plt","text":"","code":"library(healthyR.data) library(healthyR) library(dplyr) library(broom) library(ggplot2) data_tbl <- healthyR_data %>% filter(ip_op_flag == \"I\") %>% filter(payer_grouping != \"Medicare B\") %>% filter(payer_grouping != \"?\") %>% select(service_line, payer_grouping) %>% mutate(record = 1) %>% as_tibble() uit_tbl <- kmeans_user_item_tbl( .data = data_tbl , .row_input = service_line , .col_input = payer_grouping , .record_input = record ) kmm_tbl <- kmeans_mapped_tbl(uit_tbl) ump_lst <- umap_list(.data = uit_tbl, kmm_tbl, 3) #> Joining, by = \"service_line\" umap_plt(.data = ump_lst, .point_size = 3)"},{"path":[]},{"path":"https://www.spsanderson.com/healthyR/news/index.html","id":"healthyr-021","dir":"Changelog","previous_headings":"","what":"healthyR 0.2.1","title":"healthyR 0.2.1","text":"CRAN release: 2023-04-06","code":""},{"path":"https://www.spsanderson.com/healthyR/news/index.html","id":"breaking-changes-0-2-1","dir":"Changelog","previous_headings":"","what":"Breaking Changes","title":"healthyR 0.2.1","text":"Fix #141 - Drop support kmeans functions umap functions moved healthyR.ai Fix #152 - Updated Depends R >= 3.3","code":""},{"path":"https://www.spsanderson.com/healthyR/news/index.html","id":"new-features-0-2-1","dir":"Changelog","previous_headings":"","what":"New Features","title":"healthyR 0.2.1","text":"None","code":""},{"path":"https://www.spsanderson.com/healthyR/news/index.html","id":"minor-fixes-and-improvements-0-2-1","dir":"Changelog","previous_headings":"","what":"Minor Fixes and Improvements","title":"healthyR 0.2.1","text":"None","code":""},{"path":"https://www.spsanderson.com/healthyR/news/index.html","id":"healthyr-020","dir":"Changelog","previous_headings":"","what":"healthyR 0.2.0","title":"healthyR 0.2.0","text":"CRAN release: 2022-07-18","code":""},{"path":"https://www.spsanderson.com/healthyR/news/index.html","id":"breaking-changes-0-2-0","dir":"Changelog","previous_headings":"","what":"Breaking Changes","title":"healthyR 0.2.0","text":"None","code":""},{"path":"https://www.spsanderson.com/healthyR/news/index.html","id":"new-features-0-2-0","dir":"Changelog","previous_headings":"","what":"New Features","title":"healthyR 0.2.0","text":"Fix #139 - Add functions color_blind() hr_scale_fill_colorblind() hr_scale_color_colorblind() Fix #138 - Add parameter gartner_magic_chart_plt() function order size points accoring column data.frame/tibble.","code":""},{"path":"https://www.spsanderson.com/healthyR/news/index.html","id":"minor-fixes-and-improvements-0-2-0","dir":"Changelog","previous_headings":"","what":"Minor Fixes and Improvements","title":"healthyR 0.2.0","text":"None","code":""},{"path":"https://www.spsanderson.com/healthyR/news/index.html","id":"healthyr-019","dir":"Changelog","previous_headings":"","what":"healthyR 0.1.9","title":"healthyR 0.1.9","text":"CRAN release: 2022-04-25","code":""},{"path":"https://www.spsanderson.com/healthyR/news/index.html","id":"breaking-changes-0-1-9","dir":"Changelog","previous_headings":"","what":"Breaking Changes","title":"healthyR 0.1.9","text":"None","code":""},{"path":"https://www.spsanderson.com/healthyR/news/index.html","id":"new-features-0-1-9","dir":"Changelog","previous_headings":"","what":"New Features","title":"healthyR 0.1.9","text":"None","code":""},{"path":"https://www.spsanderson.com/healthyR/news/index.html","id":"minor-fixes-and-improvements-0-1-9","dir":"Changelog","previous_headings":"","what":"Minor Fixes and Improvements","title":"healthyR 0.1.9","text":"Fix #129 - Default ggplot2::theme_minimal() plots.","code":""},{"path":"https://www.spsanderson.com/healthyR/news/index.html","id":"healthyr-018","dir":"Changelog","previous_headings":"","what":"healthyR 0.1.8","title":"healthyR 0.1.8","text":"CRAN release: 2022-02-27","code":""},{"path":"https://www.spsanderson.com/healthyR/news/index.html","id":"breaking-changes-0-1-8","dir":"Changelog","previous_headings":"","what":"Breaking Changes","title":"healthyR 0.1.8","text":"None","code":""},{"path":"https://www.spsanderson.com/healthyR/news/index.html","id":"new-features-0-1-8","dir":"Changelog","previous_headings":"","what":"New Features","title":"healthyR 0.1.8","text":"None","code":""},{"path":"https://www.spsanderson.com/healthyR/news/index.html","id":"minor-fixes-and-improvements-0-1-8","dir":"Changelog","previous_headings":"","what":"Minor Fixes and Improvements","title":"healthyR 0.1.8","text":"Fix #116 - Drop need cli, crayon, rstudioapi F-x #105 - correct code make minor updates ts_census_los_daily_tbl()","code":""},{"path":"https://www.spsanderson.com/healthyR/news/index.html","id":"healthyr-017","dir":"Changelog","previous_headings":"","what":"healthyR 0.1.7","title":"healthyR 0.1.7","text":"CRAN release: 2022-01-05","code":""},{"path":"https://www.spsanderson.com/healthyR/news/index.html","id":"breaking-changes-0-1-7","dir":"Changelog","previous_headings":"","what":"Breaking Changes","title":"healthyR 0.1.7","text":"None","code":""},{"path":"https://www.spsanderson.com/healthyR/news/index.html","id":"new-features-0-1-7","dir":"Changelog","previous_headings":"","what":"New Features","title":"healthyR 0.1.7","text":"Fix #107 - Add service_line_vec() Fix #108 - Add service_line_augment()","code":""},{"path":"https://www.spsanderson.com/healthyR/news/index.html","id":"minor-fixes-and-improvements-0-1-7","dir":"Changelog","previous_headings":"","what":"Minor Fixes and Improvements","title":"healthyR 0.1.7","text":"None","code":""},{"path":"https://www.spsanderson.com/healthyR/news/index.html","id":"healthyr-016","dir":"Changelog","previous_headings":"","what":"healthyR 0.1.6","title":"healthyR 0.1.6","text":"CRAN release: 2021-08-20","code":""},{"path":"https://www.spsanderson.com/healthyR/news/index.html","id":"breaking-changes-0-1-6","dir":"Changelog","previous_headings":"","what":"Breaking Changes","title":"healthyR 0.1.6","text":"None","code":""},{"path":"https://www.spsanderson.com/healthyR/news/index.html","id":"new-features-0-1-6","dir":"Changelog","previous_headings":"","what":"New Features","title":"healthyR 0.1.6","text":"Fix #92 - Add diverging_lollipop_plt Fix #93 - Add diverging_bar_plt","code":""},{"path":"https://www.spsanderson.com/healthyR/news/index.html","id":"minor-fixes-and-improvements-0-1-6","dir":"Changelog","previous_headings":"","what":"Minor Fixes and Improvements","title":"healthyR 0.1.6","text":"Fix #90 - Add startup message library attachment.","code":""},{"path":"https://www.spsanderson.com/healthyR/news/index.html","id":"healthyr-015","dir":"Changelog","previous_headings":"","what":"healthyR 0.1.5","title":"healthyR 0.1.5","text":"CRAN release: 2021-06-22","code":""},{"path":"https://www.spsanderson.com/healthyR/news/index.html","id":"breaking-changes-0-1-5","dir":"Changelog","previous_headings":"","what":"Breaking Changes","title":"healthyR 0.1.5","text":"Fix #70 - ts_ymwdh_tbl() renamed ts_signature_tbl()","code":""},{"path":"https://www.spsanderson.com/healthyR/news/index.html","id":"new-features-0-1-5","dir":"Changelog","previous_headings":"","what":"New Features","title":"healthyR 0.1.5","text":"Fix #70 - Add timetk::tk_augment_time_series_signature() tibble gets returned. Fix #59 - Add boolean ts_signature_tbl() timetk::pad_by_time() functionality. Fix #55 - Add uwot::umap() functionality umap_list(). Fix #56 - Add umap_plt() functionality plot UMAP Projection K-Means cluster assignments.","code":""},{"path":"https://www.spsanderson.com/healthyR/news/index.html","id":"minor-fixes-and-improvments-0-1-5","dir":"Changelog","previous_headings":"","what":"Minor Fixes and Improvments","title":"healthyR 0.1.5","text":"Fix #76 - Require user select column aggregated normalized kmeans_user_item_tbl() function. Fix #62 - Add lifecycle project.","code":""},{"path":"https://www.spsanderson.com/healthyR/news/index.html","id":"healthyr-014","dir":"Changelog","previous_headings":"","what":"healthyR 0.1.4","title":"healthyR 0.1.4","text":"CRAN release: 2021-06-13","code":""},{"path":"https://www.spsanderson.com/healthyR/news/index.html","id":"breaking-changes-0-1-4","dir":"Changelog","previous_headings":"","what":"Breaking Changes","title":"healthyR 0.1.4","text":"None","code":""},{"path":"https://www.spsanderson.com/healthyR/news/index.html","id":"new-features-0-1-4","dir":"Changelog","previous_headings":"","what":"New Features","title":"healthyR 0.1.4","text":"Added Functions kmeans_tidy_tbl() Fix #40 - broom style function get tidy, augment glance kmeans_obj() output kmeans_scree_data_tbl() Fix #41 - Creates tibble data underlies kmeans_scree_plot() kmeans_scree_plt() Fix #42 - ggplot2 plot Scree data help find optimal elbow. Otherwise known elbow plot. kmeans_mapped_tbl() - Fix #43 - generates data help create elbow ploat data. maps kmeans_obj() function across stated amount centers. default set 15.","code":""},{"path":"https://www.spsanderson.com/healthyR/news/index.html","id":"minor-fixes-and-improvments-0-1-4","dir":"Changelog","previous_headings":"","what":"Minor Fixes and Improvments","title":"healthyR 0.1.4","text":"Fix #45 - drop .row_col parameter kmeans_tidy_tbl() function needed, saves user needing remember selected user column.","code":""},{"path":"https://www.spsanderson.com/healthyR/news/index.html","id":"healthyr-013","dir":"Changelog","previous_headings":"","what":"healthyR 0.1.3","title":"healthyR 0.1.3","text":"CRAN release: 2021-06-03","code":""},{"path":"https://www.spsanderson.com/healthyR/news/index.html","id":"breaking-changes-0-1-3","dir":"Changelog","previous_headings":"","what":"Breaking Changes","title":"healthyR 0.1.3","text":"None","code":""},{"path":"https://www.spsanderson.com/healthyR/news/index.html","id":"new-features-0-1-3","dir":"Changelog","previous_headings":"","what":"New Features","title":"healthyR 0.1.3","text":"Added functions kmeans_user_item_tbl() Fix #37 - Creates user item tibble preprocessed data. kmeans_obj() Fix #37 - Creates stats kmeans object, simple wrapper.","code":""},{"path":"https://www.spsanderson.com/healthyR/news/index.html","id":"minor-fixes-and-improvments-0-1-3","dir":"Changelog","previous_headings":"","what":"Minor Fixes and Improvments","title":"healthyR 0.1.3","text":"Minor fixes improvements ts_census_los_daily_tbl() Fix #37 - Correctly arranges date gets correct counts date column.","code":""},{"path":"https://www.spsanderson.com/healthyR/news/index.html","id":"healthyr-0-1-3","dir":"Changelog","previous_headings":"","what":"healthyR 0.1.2","title":"healthyR 0.1.3","text":"Add function ts_census_los_daily_tbl - Can get census length stay given just two columns data, admit/arrival date discharge/departure date","code":""},{"path":"https://www.spsanderson.com/healthyR/news/index.html","id":"healthyr-0-1-3-1","dir":"Changelog","previous_headings":"","what":"healthyR 0.1.1","title":"healthyR 0.1.3","text":"Add function(s) category_counts_tbl - Get counts specified column user specified grouping provided named_item_list - Good saving tibble many groups different sheets excel file top_n_tbl - Good getting tibble n records column selection ts_census_los_daily_tbl - Can compute alos census data given simply Admit Date Discharge Date (discharge date can null). Sometimes want see average length stay patients currently admitted","code":""},{"path":"https://www.spsanderson.com/healthyR/news/index.html","id":"healthyr-0-1-3-2","dir":"Changelog","previous_headings":"","what":"healthyR 0.1.0","title":"healthyR 0.1.3","text":"Released CRAN 12-03-2020","code":""},{"path":"https://www.spsanderson.com/healthyR/news/index.html","id":"healthyr-0-1-3-3","dir":"Changelog","previous_headings":"","what":"healthyR 0.0.0.9006","title":"healthyR 0.1.3","text":"Add data files dx_cc_mapping px_cc_mapping Added fucntion(s) save_to_excel() los_ra_index_summary_tbl los_ra_index_plt","code":""},{"path":"https://www.spsanderson.com/healthyR/news/index.html","id":"healthyr-0-1-3-4","dir":"Changelog","previous_headings":"","what":"healthyR 0.0.0.9005","title":"healthyR 0.1.3","text":"Add parameters gartner magic chart interior lables","code":""},{"path":"https://www.spsanderson.com/healthyR/news/index.html","id":"healthyr-0-1-3-5","dir":"Changelog","previous_headings":"","what":"healthyR 0.0.0.9004","title":"healthyR 0.1.3","text":"Update sql substring ike functions","code":""},{"path":"https://www.spsanderson.com/healthyR/news/index.html","id":"healthyr-0-1-3-6","dir":"Changelog","previous_headings":"","what":"healthyR 0.0.0.9003","title":"healthyR 0.1.3","text":"Added plt_gartner_magic_chart()","code":""},{"path":"https://www.spsanderson.com/healthyR/news/index.html","id":"healthyr-0-1-3-7","dir":"Changelog","previous_headings":"","what":"healthyR 0.0.0.9002","title":"healthyR 0.1.3","text":"Added function opt_bin()","code":""},{"path":"https://www.spsanderson.com/healthyR/news/index.html","id":"healthyr-0-1-3-8","dir":"Changelog","previous_headings":"","what":"healthyR 0.0.0.9001","title":"healthyR 0.1.3","text":"Added function ts_ymwdh_tbl()","code":""},{"path":"https://www.spsanderson.com/healthyR/news/index.html","id":"healthyr-0-1-3-9","dir":"Changelog","previous_headings":"","what":"healthyR 0.0.0.9000","title":"healthyR 0.1.3","text":"Added NEWS.md file track changes package.","code":""}] +[{"path":"https://www.spsanderson.com/healthyR/articles/getting-started.html","id":"libaray-load","dir":"Articles","previous_headings":"","what":"Libaray Load","title":"Getting Started with healthyR","text":"First things first, lets load library:","code":"library(healthyR) library(healthyR.data) library(timetk) library(dplyr) library(purrr)"},{"path":"https://www.spsanderson.com/healthyR/articles/getting-started.html","id":"generate-sample-data","dir":"Articles","previous_headings":"","what":"Generate Sample Data","title":"Getting Started with healthyR","text":"First going take look time series plotting functions. fairly straight forward therefore seem intuitive. going generate random numbers simulate different daily average length stay data. set seed reproducibility.","code":"# Get Length of Stay Data data_tbl <- healthyR_data df_tbl <- data_tbl %>% filter(ip_op_flag == \"I\") %>% select(visit_end_date_time, length_of_stay) %>% summarise_by_time( .date_var = visit_end_date_time , .by = \"day\" , visits = mean(length_of_stay, na.rm = TRUE) ) %>% filter_by_time( .date_var = visit_end_date_time , .start_date = \"2012\" , .end_date = \"2019\" ) %>% set_names(\"Date\",\"Values\")"},{"path":"https://www.spsanderson.com/healthyR/articles/getting-started.html","id":"plot-the-time-series","dir":"Articles","previous_headings":"","what":"Plot the Time Series","title":"Getting Started with healthyR","text":"Now data lets see easy generate ALOS chart: .interactive option set TRUE: can see, function ability return either static plot interactive plot. hood using timetk::plot_time_series function. can find timetk function . end first quick tutorial ts_alos_plt function.","code":"ts_alos_plt( .data = df_tbl , .date_col = Date , .value_col = Values , .by = \"month\" , .interactive = FALSE ) ts_alos_plt( .data = df_tbl , .date_col = Date , .value_col = Values , .by = \"month\" , .interactive = TRUE )"},{"path":"https://www.spsanderson.com/healthyR/articles/kmeans-umap.html","id":"libaray-load","dir":"Articles","previous_headings":"","what":"Libaray Load","title":"Clustering with K-Means and UMAP","text":"First things first, lets load library:","code":"library(healthyR)"},{"path":"https://www.spsanderson.com/healthyR/articles/kmeans-umap.html","id":"information","dir":"Articles","previous_headings":"","what":"Information","title":"Clustering with K-Means and UMAP","text":"K-Means partion algorithm initially designed signal processing. goal partition n observations k clusters n k. unsupervised k-means algorithm loose relationship k-nearest neighbor classifier, popular supervised machine learning technique classification often confused k-means due name. Applying 1-nearest neighbor classifier cluster centers obtained k-means classifies new data existing clusters. aim vignette showcase use healthyR wrapper kmeans function wrapper plot uwot::umap projection function. go entire workflow getting data getting fina UMAP plot.","code":""},{"path":"https://www.spsanderson.com/healthyR/articles/kmeans-umap.html","id":"generate-some-data","dir":"Articles","previous_headings":"","what":"Generate some data","title":"Clustering with K-Means and UMAP","text":"Now data need generate called user item table. use function kmeans_user_item_tbl takes just arguments. purpose user item table aggregate normalize data users items. data generated going look clustering amongst service_lines (user) payer_grouping (item) columns. Lets now create user item table.","code":"library(healthyR.data) library(dplyr) library(broom) library(ggplot2) data_tbl <- healthyR_data %>% filter(ip_op_flag == \"I\") %>% filter(payer_grouping != \"Medicare B\") %>% filter(payer_grouping != \"?\") %>% select(service_line, payer_grouping) %>% mutate(record = 1) %>% as_tibble() data_tbl %>% glimpse() #> Rows: 116,823 #> Columns: 3 #> $ service_line \"Medical\", \"Schizophrenia\", \"Syncope\", \"Pneumonia\", \"Ch… #> $ payer_grouping \"Blue Cross\", \"Medicare A\", \"Medicare A\", \"Medicare A\",… #> $ record 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1…"},{"path":"https://www.spsanderson.com/healthyR/articles/kmeans-umap.html","id":"user-item-tibble","dir":"Articles","previous_headings":"","what":"User Item Tibble","title":"Clustering with K-Means and UMAP","text":"table aggregated item various users algorithm applied. Now data need find optimal k (clusters). need generate table data column k k apply k-means function data k return total within sum squares. convienent function called kmeans_mapped_tbl takes sole argument output kmeans_user_item_tbl. argument .centers default set 15.","code":"uit_tbl <- kmeans_user_item_tbl(data_tbl, service_line, payer_grouping, record) uit_tbl #> # A tibble: 23 × 12 #> service_line Blue …¹ Comme…² Compe…³ Excha…⁴ HMO Medic…⁵ Medic…⁶ Medic…⁷ #> #> 1 Alcohol Abuse 0.0941 0.0321 5.25e-4 0.0116 0.0788 0.158 0.367 0.173 #> 2 Bariatric Sur… 0.317 0.0583 0 0.0518 0.168 0.00324 0.343 0.0485 #> 3 Carotid Endar… 0.0845 0.0282 0 0 0.0141 0 0.0282 0.648 #> 4 Cellulitis 0.110 0.0339 1.18e-2 0.00847 0.0805 0.0869 0.192 0.355 #> 5 Chest Pain 0.144 0.0391 2.90e-3 0.00543 0.112 0.0522 0.159 0.324 #> 6 CHF 0.0295 0.00958 5.18e-4 0.00414 0.0205 0.0197 0.0596 0.657 #> 7 COPD 0.0493 0.0228 2.28e-4 0.00548 0.0342 0.0461 0.172 0.520 #> 8 CVA 0.0647 0.0246 1.07e-3 0.0107 0.0524 0.0289 0.0764 0.555 #> 9 GI Hemorrhage 0.0542 0.0175 1.25e-3 0.00834 0.0480 0.0350 0.0855 0.588 #> 10 Joint Replace… 0.139 0.0179 3.36e-2 0.00673 0.0516 0 0.0874 0.5 #> # … with 13 more rows, 3 more variables: `Medicare HMO` , #> # `No Fault` , `Self Pay` , and abbreviated variable names #> # ¹​`Blue Cross`, ²​Commercial, ³​Compensation, ⁴​`Exchange Plans`, ⁵​Medicaid, #> # ⁶​`Medicaid HMO`, ⁷​`Medicare A` #> # ℹ Use `print(n = ...)` to see more rows, and `colnames()` to see all variable names"},{"path":"https://www.spsanderson.com/healthyR/articles/kmeans-umap.html","id":"k-means-mapped-tibble","dir":"Articles","previous_headings":"","what":"K-Means Mapped Tibble","title":"Clustering with K-Means and UMAP","text":"see three columns, centers, k_means glance. k_means column k_means list object glance tibble returned broom::glance function. stated use tot.withinss decide become k, easy way visualize Scree Plot, also known elbow plot. done ploting x-axis centers y-axis tot.withinss.","code":"kmm_tbl <- kmeans_mapped_tbl(uit_tbl) kmm_tbl #> # A tibble: 15 × 3 #> centers k_means glance #> #> 1 1 #> 2 2 #> 3 3 #> 4 4 #> 5 5 #> 6 6 #> 7 7 #> 8 8 #> 9 9 #> 10 10 #> 11 11 #> 12 12 #> 13 13 #> 14 14 #> 15 15 kmm_tbl %>% tidyr::unnest(glance) #> # A tibble: 15 × 6 #> centers k_means totss tot.withinss betweenss iter #> #> 1 1 1.41 1.41 1.33e-15 1 #> 2 2 1.41 0.592 8.17e- 1 1 #> 3 3 1.41 0.372 1.04e+ 0 2 #> 4 4 1.41 0.276 1.13e+ 0 2 #> 5 5 1.41 0.202 1.21e+ 0 2 #> 6 6 1.41 0.159 1.25e+ 0 4 #> 7 7 1.41 0.124 1.28e+ 0 3 #> 8 8 1.41 0.0884 1.32e+ 0 2 #> 9 9 1.41 0.0745 1.33e+ 0 3 #> 10 10 1.41 0.0576 1.35e+ 0 3 #> 11 11 1.41 0.0460 1.36e+ 0 2 #> 12 12 1.41 0.0363 1.37e+ 0 3 #> 13 13 1.41 0.0272 1.38e+ 0 2 #> 14 14 1.41 0.0202 1.39e+ 0 3 #> 15 15 1.41 0.0164 1.39e+ 0 2"},{"path":"https://www.spsanderson.com/healthyR/articles/kmeans-umap.html","id":"scree-plot-and-data","dir":"Articles","previous_headings":"","what":"Scree Plot and Data","title":"Clustering with K-Means and UMAP","text":"want see scree plot data creates plot can use another function kmeans_scree_data_tbl. pieces information can decide upon value k, instance going use 3. Now can go ahead creating umap list object can take look great many things associated data.","code":"kmeans_scree_plt(.data = kmm_tbl) kmeans_scree_data_tbl(kmm_tbl) #> # A tibble: 15 × 2 #> centers tot.withinss #> #> 1 1 1.41 #> 2 2 0.592 #> 3 3 0.372 #> 4 4 0.276 #> 5 5 0.202 #> 6 6 0.159 #> 7 7 0.124 #> 8 8 0.0884 #> 9 9 0.0745 #> 10 10 0.0576 #> 11 11 0.0460 #> 12 12 0.0363 #> 13 13 0.0272 #> 14 14 0.0202 #> 15 15 0.0164"},{"path":"https://www.spsanderson.com/healthyR/articles/kmeans-umap.html","id":"umap-list-object","dir":"Articles","previous_headings":"","what":"UMAP List Object","title":"Clustering with K-Means and UMAP","text":"Now lets go ahead create UMAP list object. Now created, lets take look item list. umap_list function returns list 5 items. umap_obj umap_results_tbl kmeans_obj kmeans_cluster_tbl umap_kmeans_cluster_results_tbl Since list object can now inspect kmeans_obj, first thing use kmeans_tidy_tbl function inspect things.","code":"ump_lst <- umap_list(.data = uit_tbl, kmm_tbl, 3) km_obj <- ump_lst$kmeans_obj kmeans_tidy_tbl(.kmeans_obj = km_obj, .data = uit_tbl, .tidy_type = \"glance\") #> # A tibble: 1 × 4 #> totss tot.withinss betweenss iter #> #> 1 1.41 0.372 1.04 2 kmeans_tidy_tbl(km_obj, uit_tbl, \"augment\") #> # A tibble: 23 × 2 #> service_line cluster #> #> 1 Alcohol Abuse 3 #> 2 Bariatric Surgery For Obesity 3 #> 3 Carotid Endarterectomy 1 #> 4 Cellulitis 2 #> 5 Chest Pain 2 #> 6 CHF 1 #> 7 COPD 1 #> 8 CVA 1 #> 9 GI Hemorrhage 1 #> 10 Joint Replacement 1 #> # … with 13 more rows #> # ℹ Use `print(n = ...)` to see more rows kmeans_tidy_tbl(km_obj, uit_tbl, \"tidy\") #> # A tibble: 3 × 14 #> Blue …¹ Comme…² Compe…³ Excha…⁴ HMO Medic…⁵ Medic…⁶ Medic…⁷ Medic…⁸ No Fa…⁹ #> #> 1 0.0784 0.0218 4.32e-3 0.00620 0.0449 0.0368 0.0800 0.563 0.152 0.00348 #> 2 0.117 0.0314 1.02e-2 0.0139 0.0982 0.0856 0.147 0.354 0.105 0.00707 #> 3 0.150 0.0368 3.07e-4 0.0207 0.163 0.131 0.314 0.132 0.0319 0.00136 #> # … with 4 more variables: `Self Pay` , size , withinss , #> # cluster , and abbreviated variable names ¹​`Blue Cross`, ²​Commercial, #> # ³​Compensation, ⁴​`Exchange Plans`, ⁵​Medicaid, ⁶​`Medicaid HMO`, #> # ⁷​`Medicare A`, ⁸​`Medicare HMO`, ⁹​`No Fault` #> # ℹ Use `colnames()` to see all variable names"},{"path":"https://www.spsanderson.com/healthyR/articles/kmeans-umap.html","id":"umap-plot","dir":"Articles","previous_headings":"","what":"UMAP Plot","title":"Clustering with K-Means and UMAP","text":"Now data can visualize clusters colored cluster number.","code":"umap_plt(.data = ump_lst, .point_size = 3, TRUE)"},{"path":"https://www.spsanderson.com/healthyR/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Steven Sanderson. Author, maintainer, copyright holder.","code":""},{"path":"https://www.spsanderson.com/healthyR/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Sanderson S (2023). healthyR: Hospital Data Analysis Workflow Tools. R package version 0.2.1.9000, https://github.com/spsanderson/healthyR.","code":"@Manual{, title = {healthyR: Hospital Data Analysis Workflow Tools}, author = {Steven Sanderson}, year = {2023}, note = {R package version 0.2.1.9000}, url = {https://github.com/spsanderson/healthyR}, }"},{"path":[]},{"path":"https://www.spsanderson.com/healthyR/CODE_OF_CONDUCT.html","id":"our-pledge","dir":"","previous_headings":"","what":"Our Pledge","title":"Contributor Covenant Code of Conduct","text":"interest fostering open welcoming environment, contributors maintainers pledge making participation project community harassment-free experience everyone, regardless age, body size, disability, ethnicity, sex characteristics, gender identity expression, level experience, education, socio-economic status, nationality, personal appearance, race, religion, sexual identity orientation.","code":""},{"path":"https://www.spsanderson.com/healthyR/CODE_OF_CONDUCT.html","id":"our-standards","dir":"","previous_headings":"","what":"Our Standards","title":"Contributor Covenant Code of Conduct","text":"Examples behavior contributes creating positive environment include: Using welcoming inclusive language respectful differing viewpoints experiences Gracefully accepting constructive criticism Focusing best community Showing empathy towards community members Examples unacceptable behavior participants include: use sexualized language imagery unwelcome sexual attention advances Trolling, insulting/derogatory comments, personal political attacks Public private harassment Publishing others’ private information, physical electronic address, without explicit permission conduct reasonably considered inappropriate professional setting","code":""},{"path":"https://www.spsanderson.com/healthyR/CODE_OF_CONDUCT.html","id":"our-responsibilities","dir":"","previous_headings":"","what":"Our Responsibilities","title":"Contributor Covenant Code of Conduct","text":"Project maintainers responsible clarifying standards acceptable behavior expected take appropriate fair corrective action response instances unacceptable behavior. Project maintainers right responsibility remove, edit, reject comments, commits, code, wiki edits, issues, contributions aligned Code Conduct, ban temporarily permanently contributor behaviors deem inappropriate, threatening, offensive, harmful.","code":""},{"path":"https://www.spsanderson.com/healthyR/CODE_OF_CONDUCT.html","id":"scope","dir":"","previous_headings":"","what":"Scope","title":"Contributor Covenant Code of Conduct","text":"Code Conduct applies within project spaces public spaces individual representing project community. Examples representing project community include using official project e-mail address, posting via official social media account, acting appointed representative online offline event. Representation project may defined clarified project maintainers.","code":""},{"path":"https://www.spsanderson.com/healthyR/CODE_OF_CONDUCT.html","id":"enforcement","dir":"","previous_headings":"","what":"Enforcement","title":"Contributor Covenant Code of Conduct","text":"Instances abusive, harassing, otherwise unacceptable behavior may reported contacting project team support@spsanderson.com. complaints reviewed investigated result response deemed necessary appropriate circumstances. project team obligated maintain confidentiality regard reporter incident. details specific enforcement policies may posted separately. Project maintainers follow enforce Code Conduct good faith may face temporary permanent repercussions determined members project’s leadership.","code":""},{"path":"https://www.spsanderson.com/healthyR/CODE_OF_CONDUCT.html","id":"attribution","dir":"","previous_headings":"","what":"Attribution","title":"Contributor Covenant Code of Conduct","text":"Code Conduct adapted Contributor Covenant, version 1.4, available https://www.contributor-covenant.org/version/1/4/code--conduct.html answers common questions code conduct, see https://www.contributor-covenant.org/faq","code":""},{"path":"https://www.spsanderson.com/healthyR/index.html","id":"healthyr-","dir":"","previous_headings":"","what":"Hospital Data Analysis Workflow Tools","title":"Hospital Data Analysis Workflow Tools","text":"goal healthyR help quickly analyze common data problems Administrative Clincial spaces.","code":""},{"path":"https://www.spsanderson.com/healthyR/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Hospital Data Analysis Workflow Tools","text":"can install released version healthyR CRAN : development version GitHub :","code":"install.packages(\"healthyR\") # install.packages(\"devtools\") devtools::install_github(\"spsanderson/healthyR\")"},{"path":"https://www.spsanderson.com/healthyR/index.html","id":"example","dir":"","previous_headings":"","what":"Example","title":"Hospital Data Analysis Workflow Tools","text":"basic example using ts_median_excess_plt() function`: simple example using ts_signature_tbl() function: simple example using plt_gartner_magic_chart() function:","code":"library(healthyR) library(timetk) library(dplyr) ts_signature_tbl(.data = m4_daily, .date_col = date, .pad_time = TRUE, id) %>% ts_median_excess_plt( .date_col = date , .value_col = value , .x_axis = week , .ggplot_group_var = year , .years_back = 5 ) library(healthyR) library(timetk) ts_signature_tbl(.data = m4_daily, .date_col = date) #> # A tibble: 17,578 × 31 #> id date value index.num diff year year.iso half quarter month #> #> 1 D410 1978-06-23 9109. 267408000 NA 1978 1978 1 2 6 #> 2 D410 1978-06-24 9103. 267494400 86400 1978 1978 1 2 6 #> 3 D410 1978-06-25 9116. 267580800 86400 1978 1978 1 2 6 #> 4 D410 1978-06-26 9116. 267667200 86400 1978 1978 1 2 6 #> 5 D410 1978-06-27 9106. 267753600 86400 1978 1978 1 2 6 #> 6 D410 1978-06-28 9094. 267840000 86400 1978 1978 1 2 6 #> 7 D410 1978-06-29 9094. 267926400 86400 1978 1978 1 2 6 #> 8 D410 1978-06-30 9084. 268012800 86400 1978 1978 1 2 6 #> 9 D410 1978-07-01 9081. 268099200 86400 1978 1978 2 3 7 #> 10 D410 1978-07-02 9047. 268185600 86400 1978 1978 2 3 7 #> # ℹ 17,568 more rows #> # ℹ 21 more variables: month.xts , month.lbl , day , hour , #> # minute , second , hour12 , am.pm , wday , #> # wday.xts , wday.lbl , mday , qday , yday , #> # mweek , week , week.iso , week2 , week3 , #> # week4 , mday7 suppressPackageStartupMessages(library(healthyR)) suppressPackageStartupMessages(library(tibble)) suppressPackageStartupMessages(library(dplyr)) gartner_magic_chart_plt( .data = tibble(x = rnorm(100, 0, 1), y = rnorm(100, 0, 1)) , .x_col = x , .y_col = y , .y_lab = \"los\" , .x_lab = \"RA\" , .plt_title = \"Test Title\" , .tl_lbl = \"Top Left lbl\" , .tr_lbl = \"Top Right lbl\" , .bl_lbl = \"Bottom Left lbl\" , .br_lbl = \"Bottom Right lbl\" )"},{"path":"https://www.spsanderson.com/healthyR/LICENSE.html","id":null,"dir":"","previous_headings":"","what":"MIT License","title":"MIT License","text":"Copyright (c) 2020 Steven Paul Sanderson II Permission hereby granted, free charge, person obtaining copy software associated documentation files (“Software”), deal Software without restriction, including without limitation rights use, copy, modify, merge, publish, distribute, sublicense, /sell copies Software, permit persons Software furnished , subject following conditions: copyright notice permission notice shall included copies substantial portions Software. SOFTWARE PROVIDED “”, WITHOUT WARRANTY KIND, EXPRESS IMPLIED, INCLUDING LIMITED WARRANTIES MERCHANTABILITY, FITNESS PARTICULAR PURPOSE NONINFRINGEMENT. EVENT SHALL AUTHORS COPYRIGHT HOLDERS LIABLE CLAIM, DAMAGES LIABILITY, WHETHER ACTION CONTRACT, TORT OTHERWISE, ARISING , CONNECTION SOFTWARE USE DEALINGS SOFTWARE.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/category_counts_tbl.html","id":null,"dir":"Reference","previous_headings":"","what":"Counts by Category — category_counts_tbl","title":"Counts by Category — category_counts_tbl","text":"Get counts column particular grouping supplied, otherwise just get counts column.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/category_counts_tbl.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Counts by Category — category_counts_tbl","text":"","code":"category_counts_tbl(.data, .count_col, .arrange_value = TRUE, ...)"},{"path":"https://www.spsanderson.com/healthyR/reference/category_counts_tbl.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Counts by Category — category_counts_tbl","text":".data data.frame/tibble supplied. .count_col column values want count. .arrange_value Defaults true, arrange resulting tibble descending order .count_col ... Place values want pass grouping .","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/category_counts_tbl.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Counts by Category — category_counts_tbl","text":"Requires data.frame/tibble. Requires value column, column going counted.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/category_counts_tbl.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Counts by Category — category_counts_tbl","text":"Steven P. Sanderson II, MPH","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/category_counts_tbl.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Counts by Category — category_counts_tbl","text":"","code":"library(healthyR.data) #> #> == Welcome to healthyR.data =========================================================================== #> If you find this package useful, please leave a star: #> https://github.com/spsanderson/healthyR.data' #> #> If you encounter a bug or want to request an enhancement please file an issue at: #> https://github.com/spsanderson/healthyR.data/issues #> #> Thank you for using healthyR.data library(dplyr) #> Warning: package 'dplyr' was built under R version 4.2.3 #> #> Attaching package: 'dplyr' #> The following objects are masked from 'package:stats': #> #> filter, lag #> The following objects are masked from 'package:base': #> #> intersect, setdiff, setequal, union healthyR_data %>% category_counts_tbl( .count_col = payer_grouping , .arrange = TRUE , ip_op_flag ) #> # A tibble: 25 × 3 #> ip_op_flag payer_grouping n #> #> 1 I Medicare A 52621 #> 2 O Medicare B 22270 #> 3 I Medicaid HMO 15466 #> 4 I Medicare HMO 13572 #> 5 O Blue Cross 13560 #> 6 I Blue Cross 10797 #> 7 O Medicaid HMO 10018 #> 8 O HMO 9331 #> 9 I HMO 8113 #> 10 I Medicaid 7131 #> # ℹ 15 more rows healthyR_data %>% category_counts_tbl( .count_col = ip_op_flag , .arrange_value = TRUE , service_line ) #> # A tibble: 30 × 3 #> service_line ip_op_flag n #> #> 1 Medical I 64435 #> 2 General Outpatient O 50526 #> 3 Surgical I 14916 #> 4 Colonoscopy/Endoscopy O 11486 #> 5 Cataract Removal O 4930 #> 6 COPD I 4398 #> 7 CHF I 3871 #> 8 Pneumonia I 3323 #> 9 Cellulitis I 3311 #> 10 Major Depression/Bipolar Affective Disorders I 2866 #> # ℹ 20 more rows"},{"path":"https://www.spsanderson.com/healthyR/reference/color_blind.html","id":null,"dir":"Reference","previous_headings":"","what":"Provide Colorblind Compliant Colors — color_blind","title":"Provide Colorblind Compliant Colors — color_blind","text":"8 Hex RGB color definitions suitable charts colorblind people.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/color_blind.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Provide Colorblind Compliant Colors — color_blind","text":"","code":"color_blind()"},{"path":"https://www.spsanderson.com/healthyR/reference/color_blind.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Provide Colorblind Compliant Colors — color_blind","text":"vector 8 Hex RGB definitions.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/color_blind.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Provide Colorblind Compliant Colors — color_blind","text":"function used others order help render plots color blind.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/color_blind.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Provide Colorblind Compliant Colors — color_blind","text":"Steven P. Sanderson II, MPH","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/color_blind.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Provide Colorblind Compliant Colors — color_blind","text":"","code":"color_blind() #> [1] \"#000000\" \"#E69F00\" \"#56B4E9\" \"#009E73\" \"#F0E442\" \"#0072B2\" \"#D55E00\" #> [8] \"#CC79A7\""},{"path":"https://www.spsanderson.com/healthyR/reference/diverging_bar_plt.html","id":null,"dir":"Reference","previous_headings":"","what":"Diverging Bar Chart — diverging_bar_plt","title":"Diverging Bar Chart — diverging_bar_plt","text":"Diverging Bars bar chart can handle negative positive values. can implemented smart tweak geom_bar(). usage geom_bar() can quite confusing. , can used make bar chart well histogram. Let explain. default, geom_bar() stat set count. means, provide just continuous X variable (Y variable), tries make histogram data. order make bar chart create bars instead histogram, need two things. Set stat = identity provide x y inside aes() , x either character factor y numeric. order make sure get diverging bars instead just bars, make sure, categorical variable 2 categories changes values certain threshold continuous variable. example, mpg mtcars data set normalized computing z score. vehicles mpg zero marked green marked red.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/diverging_bar_plt.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Diverging Bar Chart — diverging_bar_plt","text":"","code":"diverging_bar_plt( .data, .x_axis, .y_axis, .fill_col, .plot_title = NULL, .plot_subtitle = NULL, .plot_caption = NULL, .interactive = FALSE )"},{"path":"https://www.spsanderson.com/healthyR/reference/diverging_bar_plt.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Diverging Bar Chart — diverging_bar_plt","text":".data data pass function, must tibble/data.frame. .x_axis data passed x-axis. .y_axis data passed y-axis. also equal parameter label .fill_col column used fill color bars. .plot_title Default NULL .plot_subtitle Default NULL .plot_caption Default NULL .interactive Default FALSE. TRUE returns plotly plot","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/diverging_bar_plt.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Diverging Bar Chart — diverging_bar_plt","text":"plotly plot ggplot2 static plot","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/diverging_bar_plt.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Diverging Bar Chart — diverging_bar_plt","text":"function takes arguments returns ggplot2 object.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/diverging_bar_plt.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Diverging Bar Chart — diverging_bar_plt","text":"Steven P. Sanderson II, MPH","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/diverging_bar_plt.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Diverging Bar Chart — diverging_bar_plt","text":"","code":"suppressPackageStartupMessages(library(ggplot2)) data(\"mtcars\") mtcars$car_name <- rownames(mtcars) mtcars$mpg_z <- round((mtcars$mpg - mean(mtcars$mpg))/sd(mtcars$mpg), 2) mtcars$mpg_type <- ifelse(mtcars$mpg_z < 0, \"below\", \"above\") mtcars <- mtcars[order(mtcars$mpg_z), ] # sort mtcars$car_name <- factor(mtcars$car_name, levels = mtcars$car_name) diverging_bar_plt( .data = mtcars , .x_axis = car_name , .y_axis = mpg_z , .fill_col = mpg_type , .interactive = FALSE )"},{"path":"https://www.spsanderson.com/healthyR/reference/diverging_lollipop_plt.html","id":null,"dir":"Reference","previous_headings":"","what":"Diverging Lollipop Chart — diverging_lollipop_plt","title":"Diverging Lollipop Chart — diverging_lollipop_plt","text":"diverging lollipop function. Lollipop chart conveys information bar chart diverging bar. Except looks modern. Instead geom_bar, use geom_point geom_segment get lollipops right. Let’s draw lollipop using data prepared previous example diverging bars.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/diverging_lollipop_plt.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Diverging Lollipop Chart — diverging_lollipop_plt","text":"","code":"diverging_lollipop_plt( .data, .x_axis, .y_axis, .plot_title = NULL, .plot_subtitle = NULL, .plot_caption = NULL, .interactive = FALSE )"},{"path":"https://www.spsanderson.com/healthyR/reference/diverging_lollipop_plt.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Diverging Lollipop Chart — diverging_lollipop_plt","text":".data data pass function, must tibble/data.frame. .x_axis data passed x-axis. also x xend parameters geom_segment .y_axis data passed y-axis. also equal parameters yend label .plot_title Default NULL .plot_subtitle Default NULL .plot_caption Default NULL .interactive Default FALSE. TRUE returns plotly plot","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/diverging_lollipop_plt.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Diverging Lollipop Chart — diverging_lollipop_plt","text":"plotly plot ggplot2 static plot","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/diverging_lollipop_plt.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Diverging Lollipop Chart — diverging_lollipop_plt","text":"function takes arguments returns ggplot2 object.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/diverging_lollipop_plt.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Diverging Lollipop Chart — diverging_lollipop_plt","text":"Steven P. Sanderson II, MPH","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/diverging_lollipop_plt.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Diverging Lollipop Chart — diverging_lollipop_plt","text":"","code":"suppressPackageStartupMessages(library(ggplot2)) data(\"mtcars\") mtcars$car_name <- rownames(mtcars) mtcars$mpg_z <- round((mtcars$mpg - mean(mtcars$mpg))/sd(mtcars$mpg), 2) mtcars$mpg_type <- ifelse(mtcars$mpg_z < 0, \"below\", \"above\") mtcars <- mtcars[order(mtcars$mpg_z), ] # sort mtcars$car_name <- factor(mtcars$car_name, levels = mtcars$car_name) diverging_lollipop_plt(.data = mtcars, .x_axis = car_name , .y_axis = mpg_z)"},{"path":"https://www.spsanderson.com/healthyR/reference/dx_cc_mapping.html","id":null,"dir":"Reference","previous_headings":"","what":"Diagnosis to Condition Code Mapping file — dx_cc_mapping","title":"Diagnosis to Condition Code Mapping file — dx_cc_mapping","text":"dataset containing Diagnosis Code AHRQ Condition Code Mapping used helping define service lines inpatient discharges.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/dx_cc_mapping.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Diagnosis to Condition Code Mapping file — dx_cc_mapping","text":"","code":"data(dx_cc_mapping)"},{"path":"https://www.spsanderson.com/healthyR/reference/dx_cc_mapping.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Diagnosis to Condition Code Mapping file — dx_cc_mapping","text":"data frame 86852 rows 5 variables","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/dx_cc_mapping.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Diagnosis to Condition Code Mapping file — dx_cc_mapping","text":"CC_Code. DX_1, DX_2, ..., DX_n CC_Desc. DX_1 = Conduction disorders, DX_n = description ICD_Ver_Flag. ICD Version 10 9 ICDCode. ICD-9 ro ICD-10 Code Diagnosis. Long QT Syndrome","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/gartner_magic_chart_plt.html","id":null,"dir":"Reference","previous_headings":"","what":"Gartner Magic Chart - Plotting of two continuous variables — gartner_magic_chart_plt","title":"Gartner Magic Chart - Plotting of two continuous variables — gartner_magic_chart_plt","text":"Plot Gartner Magic Chart two continuous variables","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/gartner_magic_chart_plt.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Gartner Magic Chart - Plotting of two continuous variables — gartner_magic_chart_plt","text":"","code":"gartner_magic_chart_plt( .data, .x_col, .y_col, .point_size_col = NULL, .y_lab, .x_lab, .plt_title, .tl_lbl, .tr_lbl, .br_lbl, .bl_lbl )"},{"path":"https://www.spsanderson.com/healthyR/reference/gartner_magic_chart_plt.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Gartner Magic Chart - Plotting of two continuous variables — gartner_magic_chart_plt","text":".data data set want plot .x_col x-axis plot .y_col y-axis plot .point_size_col default NULL, want size dots column data.frame/tibble enter column name . .y_lab y-axis label .x_lab x-axis label .plt_title title plot .tl_lbl top left label .tr_lbl top right label .br_lbl bottom right label .bl_lbl bottom left label","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/gartner_magic_chart_plt.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Gartner Magic Chart - Plotting of two continuous variables — gartner_magic_chart_plt","text":"ggplot plot","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/gartner_magic_chart_plt.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Gartner Magic Chart - Plotting of two continuous variables — gartner_magic_chart_plt","text":"Supply data frame least two continuous variables plot ","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/gartner_magic_chart_plt.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Gartner Magic Chart - Plotting of two continuous variables — gartner_magic_chart_plt","text":"Steven P. Sanderson II, MPH","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/gartner_magic_chart_plt.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Gartner Magic Chart - Plotting of two continuous variables — gartner_magic_chart_plt","text":"","code":"library(dplyr) data_tbl <- tibble( x = rnorm(100, 0, 1), y = rnorm(100, 0, 1), z = abs(x) + abs(y) ) gartner_magic_chart_plt( .data = data_tbl, .x_col = x, .y_col = y, .point_size = z, .x_lab = \"los\", .y_lab = \"ra\", .plt_title = \"tst\", .tr_lbl = \"High RA-LOS\", .tl_lbl = \"High RA\", .bl_lbl = \"Leader\", .br_lbl = \"High LOS\" ) gartner_magic_chart_plt( .data = data_tbl, .x_col = x, .y_col = y, .point_size = NULL, .x_lab = \"los\", .y_lab = \"ra\", .plt_title = \"tst\", .tr_lbl = \"High RA-LOS\", .tl_lbl = \"High RA\", .bl_lbl = \"Leader\", .br_lbl = \"High LOS\" )"},{"path":"https://www.spsanderson.com/healthyR/reference/hr_scale_color_colorblind.html","id":null,"dir":"Reference","previous_headings":"","what":"Provide Colorblind Compliant Colors — hr_scale_color_colorblind","title":"Provide Colorblind Compliant Colors — hr_scale_color_colorblind","text":"8 Hex RGB color definitions suitable charts colorblind people.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/hr_scale_color_colorblind.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Provide Colorblind Compliant Colors — hr_scale_color_colorblind","text":"","code":"hr_scale_color_colorblind(..., theme = \"hr\")"},{"path":"https://www.spsanderson.com/healthyR/reference/hr_scale_color_colorblind.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Provide Colorblind Compliant Colors — hr_scale_color_colorblind","text":"... Data passed ggplot object theme Right now hr . Anything else render error.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/hr_scale_color_colorblind.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Provide Colorblind Compliant Colors — hr_scale_color_colorblind","text":"gggplot layer","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/hr_scale_color_colorblind.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Provide Colorblind Compliant Colors — hr_scale_color_colorblind","text":"function used others order help render plots color blind.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/hr_scale_color_colorblind.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Provide Colorblind Compliant Colors — hr_scale_color_colorblind","text":"Steven P. Sanderson II, MPH","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/hr_scale_fill_colorblind.html","id":null,"dir":"Reference","previous_headings":"","what":"Provide Colorblind Compliant Colors — hr_scale_fill_colorblind","title":"Provide Colorblind Compliant Colors — hr_scale_fill_colorblind","text":"8 Hex RGB color definitions suitable charts colorblind people.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/hr_scale_fill_colorblind.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Provide Colorblind Compliant Colors — hr_scale_fill_colorblind","text":"","code":"hr_scale_fill_colorblind(..., theme = \"hr\")"},{"path":"https://www.spsanderson.com/healthyR/reference/hr_scale_fill_colorblind.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Provide Colorblind Compliant Colors — hr_scale_fill_colorblind","text":"... Data passed ggplot object theme Right now hr . Anything else render error.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/hr_scale_fill_colorblind.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Provide Colorblind Compliant Colors — hr_scale_fill_colorblind","text":"gggplot layer","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/hr_scale_fill_colorblind.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Provide Colorblind Compliant Colors — hr_scale_fill_colorblind","text":"function used others order help render plots color blind.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/hr_scale_fill_colorblind.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Provide Colorblind Compliant Colors — hr_scale_fill_colorblind","text":"Steven P. Sanderson II, MPH","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/kmeans_mapped_tbl.html","id":null,"dir":"Reference","previous_headings":"","what":"K-Means Mapper — kmeans_mapped_tbl","title":"K-Means Mapper — kmeans_mapped_tbl","text":"Create tibble maps kmeans_obj() using purrr::map() create nested data.frame/tibble holds n centers. tibble used help create scree plot.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/kmeans_mapped_tbl.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"K-Means Mapper — kmeans_mapped_tbl","text":"","code":"kmeans_mapped_tbl(.data, .centers = 15)"},{"path":"https://www.spsanderson.com/healthyR/reference/kmeans_mapped_tbl.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"K-Means Mapper — kmeans_mapped_tbl","text":".data must tibble working environment kmeans_user_item_tbl() .centers many different centers want try","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/kmeans_mapped_tbl.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"K-Means Mapper — kmeans_mapped_tbl","text":"nested tibble","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/kmeans_mapped_tbl.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"K-Means Mapper — kmeans_mapped_tbl","text":"Takes single parameter .centers. used create tibble map kmeans_obj() function list creating nested tibble.","code":""},{"path":[]},{"path":"https://www.spsanderson.com/healthyR/reference/kmeans_mapped_tbl.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"K-Means Mapper — kmeans_mapped_tbl","text":"Steven P. Sanderson II, MPH","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/kmeans_mapped_tbl.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"K-Means Mapper — kmeans_mapped_tbl","text":"","code":"library(healthyR.data) library(dplyr) data_tbl <- healthyR_data%>% filter(ip_op_flag == \"I\") %>% filter(payer_grouping != \"Medicare B\") %>% filter(payer_grouping != \"?\") %>% select(service_line, payer_grouping) %>% mutate(record = 1) %>% as_tibble() ui_tbl <- kmeans_user_item_tbl( .data = data_tbl , .row_input = service_line , .col_input = payer_grouping , .record_input = record ) kmeans_mapped_tbl(ui_tbl) #> # A tibble: 15 × 3 #> centers k_means glance #> #> 1 1 #> 2 2 #> 3 3 #> 4 4 #> 5 5 #> 6 6 #> 7 7 #> 8 8 #> 9 9 #> 10 10 #> 11 11 #> 12 12 #> 13 13 #> 14 14 #> 15 15 "},{"path":"https://www.spsanderson.com/healthyR/reference/kmeans_obj.html","id":null,"dir":"Reference","previous_headings":"","what":"K-Means Functions — kmeans_obj","title":"K-Means Functions — kmeans_obj","text":"Takes output kmeans_user_item_tbl() function applies k-means algorithm using stats::kmeans()","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/kmeans_obj.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"K-Means Functions — kmeans_obj","text":"","code":"kmeans_obj(.data, .centers = 5)"},{"path":"https://www.spsanderson.com/healthyR/reference/kmeans_obj.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"K-Means Functions — kmeans_obj","text":".data data gets passed kmeans_user_item_tbl() .centers many initial centers start ","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/kmeans_obj.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"K-Means Functions — kmeans_obj","text":"stats k-means object","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/kmeans_obj.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"K-Means Functions — kmeans_obj","text":"Uses stats::kmeans() function creates wrapper around .","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/kmeans_obj.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"K-Means Functions — kmeans_obj","text":"Steven P. Sanderson II, MPH","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/kmeans_obj.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"K-Means Functions — kmeans_obj","text":"","code":"library(healthyR.data) library(dplyr) data_tbl <- healthyR_data%>% filter(ip_op_flag == \"I\") %>% filter(payer_grouping != \"Medicare B\") %>% filter(payer_grouping != \"?\") %>% select(service_line, payer_grouping) %>% mutate(record = 1) %>% as_tibble() kmeans_user_item_tbl( .data = data_tbl , .row_input = service_line , .col_input = payer_grouping , .record_input = record ) %>% kmeans_obj() #> K-means clustering with 5 clusters of sizes 2, 5, 1, 3, 12 #> #> Cluster means: #> Blue Cross Commercial Compensation Exchange Plans HMO Medicaid #> 1 0.27188303 0.05712358 0.0003293808 0.039065198 0.18065096 0.04246134 #> 2 0.13375082 0.03542694 0.0121998471 0.016160901 0.10724914 0.05150211 #> 3 0.00000000 0.00000000 0.0000000000 0.000000000 0.27272727 0.18181818 #> 4 0.07912806 0.02702478 0.0002914681 0.009301354 0.07723873 0.21428392 #> 5 0.07837450 0.02182129 0.0043244347 0.006202137 0.04493860 0.03684344 #> Medicaid HMO Medicare A Medicare HMO No Fault Self Pay #> 1 0.24760799 0.10958146 0.03584494 0.000000000 0.015452115 #> 2 0.13107693 0.35217108 0.11769769 0.008242686 0.034521844 #> 3 0.45454545 0.09090909 0.00000000 0.000000000 0.000000000 #> 4 0.28209782 0.23654904 0.04362913 0.002672067 0.027783628 #> 5 0.08001653 0.56250366 0.15152338 0.003475542 0.009976485 #> #> Clustering vector: #> [1] 4 1 5 5 5 5 2 2 5 5 1 5 4 2 5 2 5 4 2 5 5 3 5 #> #> Within cluster sum of squares by cluster: #> [1] 0.03549821 0.02592247 0.00000000 0.04450884 0.09625399 #> (between_SS / total_SS = 85.6 %) #> #> Available components: #> #> [1] \"cluster\" \"centers\" \"totss\" \"withinss\" \"tot.withinss\" #> [6] \"betweenss\" \"size\" \"iter\" \"ifault\""},{"path":"https://www.spsanderson.com/healthyR/reference/kmeans_scree_data_tbl.html","id":null,"dir":"Reference","previous_headings":"","what":"K-Means Scree Plot Data Table — kmeans_scree_data_tbl","title":"K-Means Scree Plot Data Table — kmeans_scree_data_tbl","text":"Take data kmeans_mapped_tbl() unnest tibble inspection use kmeans_scree_plt() function.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/kmeans_scree_data_tbl.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"K-Means Scree Plot Data Table — kmeans_scree_data_tbl","text":"","code":"kmeans_scree_data_tbl(.data)"},{"path":"https://www.spsanderson.com/healthyR/reference/kmeans_scree_data_tbl.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"K-Means Scree Plot Data Table — kmeans_scree_data_tbl","text":".data must tibble working environment kmeans_mapped_tbl()","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/kmeans_scree_data_tbl.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"K-Means Scree Plot Data Table — kmeans_scree_data_tbl","text":"nested tibble","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/kmeans_scree_data_tbl.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"K-Means Scree Plot Data Table — kmeans_scree_data_tbl","text":"Takes single parameter .data kmeans_mapped_tbl() transforms tibble used kmeans_scree_plt(). show values (tot.withinss) center.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/kmeans_scree_data_tbl.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"K-Means Scree Plot Data Table — kmeans_scree_data_tbl","text":"Steven P. Sanderson II, MPH","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/kmeans_scree_data_tbl.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"K-Means Scree Plot Data Table — kmeans_scree_data_tbl","text":"","code":"library(healthyR.data) library(dplyr) data_tbl <- healthyR_data%>% filter(ip_op_flag == \"I\") %>% filter(payer_grouping != \"Medicare B\") %>% filter(payer_grouping != \"?\") %>% select(service_line, payer_grouping) %>% mutate(record = 1) %>% as_tibble() ui_tbl <- kmeans_user_item_tbl( .data = data_tbl , .row_input = service_line , .col_input = payer_grouping , .record_input = record ) kmm_tbl <- kmeans_mapped_tbl(ui_tbl) kmeans_scree_data_tbl(kmm_tbl) #> # A tibble: 15 × 2 #> centers tot.withinss #> #> 1 1 1.41 #> 2 2 0.592 #> 3 3 0.372 #> 4 4 0.276 #> 5 5 0.202 #> 6 6 0.159 #> 7 7 0.124 #> 8 8 0.0922 #> 9 9 0.0722 #> 10 10 0.0576 #> 11 11 0.0461 #> 12 12 0.0363 #> 13 13 0.0272 #> 14 14 0.0231 #> 15 15 0.0160"},{"path":"https://www.spsanderson.com/healthyR/reference/kmeans_scree_plt.html","id":null,"dir":"Reference","previous_headings":"","what":"K-Means Scree Plot — kmeans_scree_plt","title":"K-Means Scree Plot — kmeans_scree_plt","text":"Create scree-plot kmeans_mapped_tbl() function.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/kmeans_scree_plt.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"K-Means Scree Plot — kmeans_scree_plt","text":"","code":"kmeans_scree_plt(.data)"},{"path":"https://www.spsanderson.com/healthyR/reference/kmeans_scree_plt.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"K-Means Scree Plot — kmeans_scree_plt","text":".data data kmeans_mapped_tbl() function","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/kmeans_scree_plt.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"K-Means Scree Plot — kmeans_scree_plt","text":"ggplot2 plot","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/kmeans_scree_plt.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"K-Means Scree Plot — kmeans_scree_plt","text":"Outputs scree-plot","code":""},{"path":[]},{"path":"https://www.spsanderson.com/healthyR/reference/kmeans_scree_plt.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"K-Means Scree Plot — kmeans_scree_plt","text":"Steven P. Sanderson II, MPH","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/kmeans_scree_plt.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"K-Means Scree Plot — kmeans_scree_plt","text":"","code":"library(healthyR.data) library(dplyr) data_tbl <- healthyR_data%>% filter(ip_op_flag == \"I\") %>% filter(payer_grouping != \"Medicare B\") %>% filter(payer_grouping != \"?\") %>% select(service_line, payer_grouping) %>% mutate(record = 1) %>% as_tibble() ui_tbl <- kmeans_user_item_tbl( .data = data_tbl , .row_input = service_line , .col_input = payer_grouping , .record_input = record ) kmm_tbl <- kmeans_mapped_tbl(ui_tbl) kmeans_scree_plt(.data = kmm_tbl)"},{"path":"https://www.spsanderson.com/healthyR/reference/kmeans_tidy_tbl.html","id":null,"dir":"Reference","previous_headings":"","what":"K-Means tidy Functions — kmeans_tidy_tbl","title":"K-Means tidy Functions — kmeans_tidy_tbl","text":"K-Means tidy functions","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/kmeans_tidy_tbl.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"K-Means tidy Functions — kmeans_tidy_tbl","text":"","code":"kmeans_tidy_tbl(.kmeans_obj, .data, .tidy_type = \"tidy\")"},{"path":"https://www.spsanderson.com/healthyR/reference/kmeans_tidy_tbl.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"K-Means tidy Functions — kmeans_tidy_tbl","text":".kmeans_obj stats::kmeans() object .data user item tibble created kmeans_user_item_tbl() .tidy_type \"tidy\",\"glance\", \"augment\"","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/kmeans_tidy_tbl.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"K-Means tidy Functions — kmeans_tidy_tbl","text":"tibble","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/kmeans_tidy_tbl.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"K-Means tidy Functions — kmeans_tidy_tbl","text":"Takes k-means object associated user item tibble returns one items asked . Either: broom::tidy(), broom::glance() broom::augment(). function defaults broom::tidy().","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/kmeans_tidy_tbl.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"K-Means tidy Functions — kmeans_tidy_tbl","text":"Steven P. Sanderson II, MPH","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/kmeans_tidy_tbl.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"K-Means tidy Functions — kmeans_tidy_tbl","text":"","code":"library(healthyR.data) library(dplyr) library(broom) data_tbl <- healthyR_data%>% filter(ip_op_flag == \"I\") %>% filter(payer_grouping != \"Medicare B\") %>% filter(payer_grouping != \"?\") %>% select(service_line, payer_grouping) %>% mutate(record = 1) %>% as_tibble() uit_tbl <- kmeans_user_item_tbl( .data = data_tbl , .row_input = service_line , .col_input = payer_grouping , .record_input = record ) km_obj <- kmeans_obj(uit_tbl) kmeans_tidy_tbl( .kmeans_obj = km_obj , .data = uit_tbl , .tidy_type = \"augment\" ) #> # A tibble: 23 × 2 #> service_line cluster #> #> 1 Alcohol Abuse 5 #> 2 Bariatric Surgery For Obesity 1 #> 3 CHF 3 #> 4 COPD 3 #> 5 CVA 3 #> 6 Carotid Endarterectomy 3 #> 7 Cellulitis 4 #> 8 Chest Pain 4 #> 9 GI Hemorrhage 3 #> 10 Joint Replacement 3 #> # … with 13 more rows #> # ℹ Use `print(n = ...)` to see more rows kmeans_tidy_tbl( .kmeans_obj = km_obj , .data = uit_tbl , .tidy_type = \"glance\" ) #> # A tibble: 1 × 4 #> totss tot.withinss betweenss iter #> #> 1 1.41 0.202 1.21 2 kmeans_tidy_tbl( .kmeans_obj = km_obj , .data = uit_tbl , .tidy_type = \"tidy\" ) %>% glimpse() #> Rows: 5 #> Columns: 14 #> $ `Blue Cross` 0.27188303, 0.00000000, 0.07837450, 0.13375082, 0.079… #> $ Commercial 0.05712358, 0.00000000, 0.02182129, 0.03542694, 0.027… #> $ Compensation 0.0003293808, 0.0000000000, 0.0043244347, 0.012199847… #> $ `Exchange Plans` 0.039065198, 0.000000000, 0.006202137, 0.016160901, 0… #> $ HMO 0.18065096, 0.27272727, 0.04493860, 0.10724914, 0.077… #> $ Medicaid 0.04246134, 0.18181818, 0.03684344, 0.05150211, 0.214… #> $ `Medicaid HMO` 0.24760799, 0.45454545, 0.08001653, 0.13107693, 0.282… #> $ `Medicare A` 0.10958146, 0.09090909, 0.56250366, 0.35217108, 0.236… #> $ `Medicare HMO` 0.03584494, 0.00000000, 0.15152338, 0.11769769, 0.043… #> $ `No Fault` 0.000000000, 0.000000000, 0.003475542, 0.008242686, 0… #> $ `Self Pay` 0.015452115, 0.000000000, 0.009976485, 0.034521844, 0… #> $ size 2, 1, 12, 5, 3 #> $ withinss 0.03549821, 0.00000000, 0.09625399, 0.02592247, 0.044… #> $ cluster 1, 2, 3, 4, 5"},{"path":"https://www.spsanderson.com/healthyR/reference/kmeans_user_item_tbl.html","id":null,"dir":"Reference","previous_headings":"","what":"K-Means Functions — kmeans_user_item_tbl","title":"K-Means Functions — kmeans_user_item_tbl","text":"Takes data.frame/tibble transforms aggregated/normalized user-item tibble proportions. user need input parameters rows/user columns/items.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/kmeans_user_item_tbl.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"K-Means Functions — kmeans_user_item_tbl","text":"","code":"kmeans_user_item_tbl(.data, .row_input, .col_input, .record_input)"},{"path":"https://www.spsanderson.com/healthyR/reference/kmeans_user_item_tbl.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"K-Means Functions — kmeans_user_item_tbl","text":".data data want transform .row_input column going row (user) .col_input column going column (item) .record_input column going summed aggregattion normalization process.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/kmeans_user_item_tbl.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"K-Means Functions — kmeans_user_item_tbl","text":"aggregated/normalized user item tibble","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/kmeans_user_item_tbl.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"K-Means Functions — kmeans_user_item_tbl","text":"function used using k-mean model. commonly referred user item matrix \"users\" tend rows \"items\" (e.g. orders) columns. must supply column can summed aggregation normalization process occur.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/kmeans_user_item_tbl.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"K-Means Functions — kmeans_user_item_tbl","text":"Steven P. Sanderson II, MPH","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/kmeans_user_item_tbl.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"K-Means Functions — kmeans_user_item_tbl","text":"","code":"library(healthyR.data) library(dplyr) data_tbl <- healthyR_data%>% filter(ip_op_flag == \"I\") %>% filter(payer_grouping != \"Medicare B\") %>% filter(payer_grouping != \"?\") %>% select(service_line, payer_grouping) %>% mutate(record = 1) %>% as_tibble() kmeans_user_item_tbl( .data = data_tbl , .row_input = service_line , .col_input = payer_grouping , .record_input = record ) #> # A tibble: 23 × 12 #> service_line Blue …¹ Comme…² Compe…³ Excha…⁴ HMO Medic…⁵ Medic…⁶ Medic…⁷ #> #> 1 Alcohol Abuse 0.0941 0.0321 5.25e-4 0.0116 0.0788 0.158 0.367 0.173 #> 2 Bariatric Sur… 0.317 0.0583 0 0.0518 0.168 0.00324 0.343 0.0485 #> 3 CHF 0.0295 0.00958 5.18e-4 0.00414 0.0205 0.0197 0.0596 0.657 #> 4 COPD 0.0493 0.0228 2.28e-4 0.00548 0.0342 0.0461 0.172 0.520 #> 5 CVA 0.0647 0.0246 1.07e-3 0.0107 0.0524 0.0289 0.0764 0.555 #> 6 Carotid Endar… 0.0845 0.0282 0 0 0.0141 0 0.0282 0.648 #> 7 Cellulitis 0.110 0.0339 1.18e-2 0.00847 0.0805 0.0869 0.192 0.355 #> 8 Chest Pain 0.144 0.0391 2.90e-3 0.00543 0.112 0.0522 0.159 0.324 #> 9 GI Hemorrhage 0.0542 0.0175 1.25e-3 0.00834 0.0480 0.0350 0.0855 0.588 #> 10 Joint Replace… 0.139 0.0179 3.36e-2 0.00673 0.0516 0 0.0874 0.5 #> # … with 13 more rows, 3 more variables: `Medicare HMO` , #> # `No Fault` , `Self Pay` , and abbreviated variable names #> # ¹​`Blue Cross`, ²​Commercial, ³​Compensation, ⁴​`Exchange Plans`, ⁵​Medicaid, #> # ⁶​`Medicaid HMO`, ⁷​`Medicare A` #> # ℹ Use `print(n = ...)` to see more rows, and `colnames()` to see all variable names"},{"path":"https://www.spsanderson.com/healthyR/reference/los_ra_index_plt.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot LOS and Readmit Index with Variance — los_ra_index_plt","title":"Plot LOS and Readmit Index with Variance — los_ra_index_plt","text":"Plot index length stay readmit rate along variance","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/los_ra_index_plt.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot LOS and Readmit Index with Variance — los_ra_index_plt","text":"","code":"los_ra_index_plt(.data)"},{"path":"https://www.spsanderson.com/healthyR/reference/los_ra_index_plt.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot LOS and Readmit Index with Variance — los_ra_index_plt","text":".data data supplied los_ra_index_summary_tbl()","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/los_ra_index_plt.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot LOS and Readmit Index with Variance — los_ra_index_plt","text":"patchwork ggplot2 plot","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/los_ra_index_plt.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Plot LOS and Readmit Index with Variance — los_ra_index_plt","text":"Expects tibble Expects Length Stay Readmit column, must numeric Uses cowplot stack plots","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/los_ra_index_plt.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Plot LOS and Readmit Index with Variance — los_ra_index_plt","text":"Steven P. Sanderson II, MPH","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/los_ra_index_plt.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot LOS and Readmit Index with Variance — los_ra_index_plt","text":"","code":"suppressPackageStartupMessages(library(dplyr)) data_tbl <- tibble( \"alos\" = runif(186, 1, 20) , \"elos\" = runif(186, 1, 17) , \"readmit_rate\" = runif(186, 0, .25) , \"readmit_rate_bench\" = runif(186, 0, .2) ) los_ra_index_summary_tbl( .data = data_tbl , .max_los = 15 , .alos_col = alos , .elos_col = elos , .readmit_rate = readmit_rate , .readmit_bench = readmit_rate_bench ) %>% los_ra_index_plt() los_ra_index_summary_tbl( .data = data_tbl , .max_los = 10 , .alos_col = alos , .elos_col = elos , .readmit_rate = readmit_rate , .readmit_bench = readmit_rate_bench ) %>% los_ra_index_plt()"},{"path":"https://www.spsanderson.com/healthyR/reference/los_ra_index_summary_tbl.html","id":null,"dir":"Reference","previous_headings":"","what":"Make LOS and Readmit Index Summary Tibble — los_ra_index_summary_tbl","title":"Make LOS and Readmit Index Summary Tibble — los_ra_index_summary_tbl","text":"Create length stay readmit index summary tibble","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/los_ra_index_summary_tbl.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Make LOS and Readmit Index Summary Tibble — los_ra_index_summary_tbl","text":"","code":"los_ra_index_summary_tbl( .data, .max_los = 15, .alos_col, .elos_col, .readmit_rate, .readmit_bench )"},{"path":"https://www.spsanderson.com/healthyR/reference/los_ra_index_summary_tbl.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Make LOS and Readmit Index Summary Tibble — los_ra_index_summary_tbl","text":".data data going analyze. .max_los can give maximum LOS value. Lets say typically see los 15 days, set .max_los 15 values greater .max_los grouped .max_los .alos_col Average Length Stay column .elos_col Expected Length Stay column .readmit_rate Actual Readmit Rate column .readmit_bench Expected Readmit Rate column","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/los_ra_index_summary_tbl.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Make LOS and Readmit Index Summary Tibble — los_ra_index_summary_tbl","text":"tibble","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/los_ra_index_summary_tbl.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Make LOS and Readmit Index Summary Tibble — los_ra_index_summary_tbl","text":"Expects tibble Expects following columns 4 Length Stay Actual - integer Length Stacy Benchmark - integer Readmit Rate Actual - 0/1 record, 1 = readmitted, 0 . Readmit Rate Benchmark - percentage benchmark file. add column called visits count records per length stay 1 .max_los .max_los param can left blank function default 15. good default know set 75 percentile stats::quantile() function using defaults, like .max_los = stats::quantile(data_tbl$alos)[[4]] Uses data compute variance, want particular time frame filter data goes .data argument. suggested use timetk::filter_by_time() index computed excess length stay readmit rates respective expectations.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/los_ra_index_summary_tbl.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Make LOS and Readmit Index Summary Tibble — los_ra_index_summary_tbl","text":"Steven P. Sanderson II, MPH","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/los_ra_index_summary_tbl.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Make LOS and Readmit Index Summary Tibble — los_ra_index_summary_tbl","text":"","code":"suppressPackageStartupMessages(library(dplyr)) data_tbl <- tibble( \"alos\" = runif(186, 1, 20) , \"elos\" = runif(186, 1, 17) , \"readmit_rate\" = runif(186, 0, .25) , \"readmit_bench\" = runif(186, 0, .2) ) los_ra_index_summary_tbl( .data = data_tbl , .max_los = 15 , .alos_col = alos , .elos_col = elos , .readmit_rate = readmit_rate , .readmit_bench = readmit_bench ) #> # A tibble: 15 × 4 #> los_group los_index rar_index los_ra_var #> #> 1 1 0.0964 1.18 1.09 #> 2 2 0.208 1.08 0.875 #> 3 3 0.471 1.09 0.620 #> 4 4 0.368 1.25 0.882 #> 5 5 0.549 1.75 1.20 #> 6 6 0.643 2.14 1.50 #> 7 7 0.785 1 0.215 #> 8 8 0.828 1 0.172 #> 9 9 1.09 1.08 0.163 #> 10 10 0.858 1.33 0.475 #> 11 11 1.40 0.909 0.494 #> 12 12 1.41 1.33 0.739 #> 13 13 1.72 0.846 0.878 #> 14 14 1.25 1 0.254 #> 15 15 1.87 1.44 1.32 los_ra_index_summary_tbl( .data = data_tbl , .max_los = 10 , .alos_col = alos , .elos_col = elos , .readmit_rate = readmit_rate , .readmit_bench = readmit_bench ) #> # A tibble: 10 × 4 #> los_group los_index rar_index los_ra_var #> #> 1 1 0.0964 1.18 1.09 #> 2 2 0.208 1.08 0.875 #> 3 3 0.471 1.09 0.620 #> 4 4 0.368 1.25 0.882 #> 5 5 0.549 1.75 1.20 #> 6 6 0.643 2.14 1.50 #> 7 7 0.785 1 0.215 #> 8 8 0.828 1 0.172 #> 9 9 1.09 1.08 0.163 #> 10 10 1.53 1.2 0.729"},{"path":"https://www.spsanderson.com/healthyR/reference/named_item_list.html","id":null,"dir":"Reference","previous_headings":"","what":"Tibble to named list — named_item_list","title":"Tibble to named list — named_item_list","text":"Takes data.frame/tibble creates named list supplied grouping variable. Can used conjunction save_to_excel() create new sheet group data.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/named_item_list.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Tibble to named list — named_item_list","text":"","code":"named_item_list(.data, .group_col)"},{"path":"https://www.spsanderson.com/healthyR/reference/named_item_list.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Tibble to named list — named_item_list","text":".data data.frame/tibble. .group_col column contains groupings.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/named_item_list.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Tibble to named list — named_item_list","text":"Requires data.frame/tibble grouping column.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/named_item_list.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Tibble to named list — named_item_list","text":"Steven P. Sanderson II, MPH","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/named_item_list.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Tibble to named list — named_item_list","text":"","code":"library(healthyR.data) df <- healthyR_data df_list <- named_item_list(.data = df, .group_col = service_line) df_list #> tbl_df< #> mrn : character #> visit_id : character #> visit_start_date_time : datetime #> visit_end_date_time : datetime #> total_charge_amount : double #> total_amount_due : double #> total_adjustment_amount : double #> payer_grouping : character #> total_payment_amount : double #> ip_op_flag : character #> service_line : character #> length_of_stay : double #> expected_length_of_stay : logical #> length_of_stay_threshold: logical #> los_outlier_flag : double #> readmit_flag : double #> readmit_expectation : logical #> > #> >[29]> #> $`Alcohol Abuse` #> # A tibble: 1,904 × 17 #> mrn visit_id visit_start_date_time visit_end_date_time total_charge_amount #> #> 1 66681… 1027422… 2011-09-18 18:45:00 2011-09-21 15:24:00 20650. #> 2 85712… 1715006… 2011-09-24 14:23:00 2011-09-27 22:54:00 19632. #> 3 45086… 1463793… 2011-09-25 17:22:00 2011-09-30 18:48:00 27028. #> 4 53136… 1087046… 2011-10-01 08:58:00 2011-10-03 11:10:00 12214. #> 5 79908… 1933551… 2011-10-02 00:04:00 2011-10-06 13:51:00 30124. #> 6 29323… 1651882… 2011-10-06 15:08:00 2011-10-07 16:00:00 8571. #> 7 97809… 1375044… 2011-10-06 17:23:00 2011-10-08 14:19:00 13139. #> 8 88765… 1040286… 2011-10-09 00:36:00 2011-10-09 15:29:00 37944. #> 9 13303… 1814203… 2011-09-26 20:00:00 2011-10-10 11:59:00 110695. #> 10 50646… 1177441… 2011-10-11 01:00:00 2011-10-13 10:16:00 18791. #> # ℹ 1,894 more rows #> # ℹ 12 more variables: total_amount_due , total_adjustment_amount , #> # payer_grouping , total_payment_amount , ip_op_flag , #> # service_line , length_of_stay , expected_length_of_stay , #> # length_of_stay_threshold , los_outlier_flag , readmit_flag , #> # readmit_expectation #> #> $`Bariatric Surgery For Obesity` #> # A tibble: 309 × 17 #> mrn visit_id visit_start_date_time visit_end_date_time total_charge_amount #> #> 1 33197… 1959572… 2012-12-03 13:35:00 2012-12-05 14:42:00 42533. #> 2 85747… 1935901… 2012-12-03 07:30:00 2012-12-06 13:48:00 47450. #> 3 89559… 1250962… 2012-12-03 08:39:00 2012-12-06 16:18:00 50382. #> 4 31228… 1482137… 2013-01-16 06:32:00 2013-01-18 16:07:00 43665. #> 5 15445… 1953192… 2013-01-16 09:18:00 2013-01-20 18:33:00 52763. #> 6 22630… 1950977… 2013-02-19 10:28:00 2013-02-21 15:25:00 36038. #> 7 37398… 1518672… 2013-02-26 06:53:00 2013-03-01 12:38:00 56381. #> 8 14268… 1903948… 2013-04-09 06:45:00 2013-04-11 18:12:00 43263. #> 9 78338… 1196711… 2013-04-23 07:16:00 2013-04-26 16:41:00 52300. #> 10 80152… 1595499… 2013-05-21 06:15:00 2013-05-24 15:59:00 44746. #> # ℹ 299 more rows #> # ℹ 12 more variables: total_amount_due , total_adjustment_amount , #> # payer_grouping , total_payment_amount , ip_op_flag , #> # service_line , length_of_stay , expected_length_of_stay , #> # length_of_stay_threshold , los_outlier_flag , readmit_flag , #> # readmit_expectation #> #> $`Bariatric Surgery for Obesity Outpatient` #> # A tibble: 19 × 17 #> mrn visit_id visit_start_date_time visit_end_date_time total_charge_amount #> #> 1 77785… 3780939… 2011-05-23 05:00:00 2011-05-24 00:00:00 37167. #> 2 68458… 3778860… 2011-07-18 05:00:00 2011-07-19 00:00:00 26037. #> 3 47955… 3675064… 2011-07-18 05:00:00 2011-07-19 00:00:00 41552. #> 4 92298… 3218733… 2011-08-15 05:00:00 2011-08-16 00:00:00 34332. #> 5 29160… 3547868… 2011-08-30 05:00:00 2011-08-31 00:00:00 37992. #> 6 45420… 3189581… 2011-09-12 05:00:00 2011-09-13 00:00:00 32744. #> 7 59818… 3834855… 2011-09-19 05:00:00 2011-09-20 00:00:00 34354. #> 8 57649… 3921176… 2011-10-17 05:00:00 2011-10-18 00:00:00 31338 #> 9 11995… 3411333… 2011-11-07 05:00:00 2011-11-08 00:00:00 34795 #> 10 62541… 3554137… 2011-11-08 05:00:00 2011-11-08 00:00:00 33251. #> 11 83600… 3562481… 2011-11-15 05:00:00 2011-11-15 00:00:00 33955. #> 12 10604… 3411030… 2011-11-28 05:00:00 2011-11-29 00:00:00 35638. #> 13 84084… 3342120… 2012-03-12 05:00:00 2012-03-12 00:00:00 33758. #> 14 37253… 3461965… 2012-04-23 05:00:00 2012-04-24 00:00:00 36768. #> 15 85288… 3078841… 2012-06-12 05:00:00 2012-06-13 00:00:00 39139. #> 16 73239… 3350427… 2012-07-09 05:00:00 2012-07-10 00:00:00 35642. #> 17 52577… 3074630… 2012-08-20 05:00:00 2012-08-21 00:00:00 37140. #> 18 62286… 3659346… 2012-08-27 05:00:00 2012-08-28 00:00:00 35030. #> 19 39164… 3146567… 2012-12-18 05:00:00 2012-12-19 00:00:00 36899. #> # ℹ 12 more variables: total_amount_due , total_adjustment_amount , #> # payer_grouping , total_payment_amount , ip_op_flag , #> # service_line , length_of_stay , expected_length_of_stay , #> # length_of_stay_threshold , los_outlier_flag , readmit_flag , #> # readmit_expectation #> #> $CHF #> # A tibble: 3,871 × 17 #> mrn visit_id visit_start_date_time visit_end_date_time total_charge_amount #> #> 1 51458… 1759626… 2011-09-19 09:17:00 2011-09-22 12:32:00 24021. #> 2 66595… 1901836… 2011-09-19 07:06:00 2011-09-22 18:58:00 33724. #> 3 21445… 1913857… 2011-09-22 00:21:00 2011-09-27 16:49:00 47369. #> 4 33735… 1710022… 2011-09-15 12:48:00 2011-09-27 19:52:00 76611. #> 5 67542… 1377329… 2011-09-17 13:49:00 2011-09-28 13:45:00 81523. #> 6 69492… 1811099… 2011-09-24 20:33:00 2011-09-29 11:59:00 37112. #> 7 93559… 1609237… 2011-09-22 04:23:00 2011-10-03 14:21:00 84470. #> 8 14723… 1713302… 2011-09-15 11:50:00 2011-10-04 19:34:00 158923. #> 9 49842… 1052618… 2011-09-29 10:40:00 2011-10-05 14:20:00 50061. #> 10 98654… 1022864… 2011-10-01 01:47:00 2011-10-05 18:50:00 42312. #> # ℹ 3,861 more rows #> # ℹ 12 more variables: total_amount_due , total_adjustment_amount , #> # payer_grouping , total_payment_amount , ip_op_flag , #> # service_line , length_of_stay , expected_length_of_stay , #> # length_of_stay_threshold , los_outlier_flag , readmit_flag , #> # readmit_expectation #> #> $COPD #> # A tibble: 4,398 × 17 #> mrn visit_id visit_start_date_time visit_end_date_time total_charge_amount #> #> 1 53222… 1698106… 2011-09-23 00:18:00 2011-09-25 14:18:00 21843. #> 2 54515… 1461588… 2011-09-18 17:22:00 2011-09-28 17:20:00 98014. #> 3 91474… 1437392… 2011-09-19 09:01:00 2011-09-30 14:44:00 96463. #> 4 38370… 1452507… 2011-09-25 18:44:00 2011-09-30 20:42:00 31050. #> 5 30712… 1117831… 2011-09-26 19:26:00 2011-10-01 09:46:00 33841. #> 6 11184… 1308449… 2011-09-30 17:41:00 2011-10-01 16:32:00 13971. #> 7 88190… 1670417… 2011-09-27 22:58:00 2011-10-01 17:03:00 44981. #> 8 33840… 1957228… 2011-09-26 08:08:00 2011-10-02 15:53:00 44635. #> 9 20960… 1168285… 2011-09-28 11:09:00 2011-10-03 15:53:00 36926. #> 10 95644… 1711510… 2011-09-24 23:59:00 2011-10-03 18:10:00 69779. #> # ℹ 4,388 more rows #> # ℹ 12 more variables: total_amount_due , total_adjustment_amount , #> # payer_grouping , total_payment_amount , ip_op_flag , #> # service_line , length_of_stay , expected_length_of_stay , #> # length_of_stay_threshold , los_outlier_flag , readmit_flag , #> # readmit_expectation #> #> $CVA #> # A tibble: 1,876 × 17 #> mrn visit_id visit_start_date_time visit_end_date_time total_charge_amount #> #> 1 41238… 1543704… 2011-09-19 15:31:00 2011-09-27 13:11:00 103948. #> 2 80514… 1330628… 2011-09-21 14:52:00 2011-09-29 17:38:00 94170. #> 3 12307… 1747094… 2011-09-24 16:34:00 2011-09-30 17:21:00 66481. #> 4 20903… 1777797… 2011-09-26 12:19:00 2011-10-04 15:38:00 79281. #> 5 54938… 1173347… 2011-09-30 17:47:00 2011-10-05 16:50:00 49108. #> 6 93886… 1877891… 2011-09-19 17:47:00 2011-10-05 17:25:00 105698. #> 7 42704… 1654264… 2011-09-28 22:00:00 2011-10-06 17:08:00 65041. #> 8 40653… 1576434… 2011-10-05 15:31:00 2011-10-11 14:26:00 81910. #> 9 26260… 1818390… 2011-09-27 13:43:00 2011-10-13 14:14:00 86323. #> 10 28646… 1984495… 2011-10-12 10:10:00 2011-10-14 15:15:00 82165. #> # ℹ 1,866 more rows #> # ℹ 12 more variables: total_amount_due , total_adjustment_amount , #> # payer_grouping , total_payment_amount , ip_op_flag , #> # service_line , length_of_stay , expected_length_of_stay , #> # length_of_stay_threshold , los_outlier_flag , readmit_flag , #> # readmit_expectation #> #> $`Cardiac Catheterization` #> # A tibble: 2,339 × 17 #> mrn visit_id visit_start_date_time visit_end_date_time total_charge_amount #> #> 1 66583… 3578143… 2011-01-04 05:00:00 2011-01-04 00:00:00 20852 #> 2 10022… 3911589… 2011-01-04 05:00:00 2011-01-04 00:00:00 18334 #> 3 28724… 3226717… 2011-01-05 05:00:00 2011-01-05 00:00:00 19353 #> 4 54076… 3773686… 2011-01-05 05:00:00 2011-01-05 00:00:00 18334 #> 5 89111… 3082518… 2011-01-13 05:00:00 2011-01-11 00:00:00 1377 #> 6 91877… 3385295… 2011-01-13 05:00:00 2011-01-13 00:00:00 18405 #> 7 89111… 3040689… 2011-01-13 05:00:00 2011-01-13 00:00:00 18587 #> 8 75773… 3380647… 2011-01-14 05:00:00 2011-01-14 00:00:00 20069 #> 9 22385… 3740963… 2011-01-17 05:00:00 2011-01-17 00:00:00 18428 #> 10 91434… 3628134… 2011-01-17 05:00:00 2011-01-17 00:00:00 20056 #> # ℹ 2,329 more rows #> # ℹ 12 more variables: total_amount_due , total_adjustment_amount , #> # payer_grouping , total_payment_amount , ip_op_flag , #> # service_line , length_of_stay , expected_length_of_stay , #> # length_of_stay_threshold , los_outlier_flag , readmit_flag , #> # readmit_expectation #> #> $`Carotid Endarterectomy` #> # A tibble: 72 × 17 #> mrn visit_id visit_start_date_time visit_end_date_time total_charge_amount #> #> 1 91886… 1012723… 2011-12-02 11:51:00 2011-12-04 15:32:00 29553. #> 2 84879… 1998441… 2012-02-02 06:37:00 2012-02-05 19:38:00 35181. #> 3 35685… 1235700… 2012-03-16 16:26:00 2012-03-23 11:22:00 87273. #> 4 84879… 1412023… 2012-03-30 09:31:00 2012-04-02 17:57:00 36213. #> 5 76802… 1501987… 2012-04-03 09:43:00 2012-04-05 13:11:00 27293. #> 6 21571… 1253613… 2012-03-29 21:26:00 2012-04-05 14:53:00 82206. #> 7 88958… 1446390… 2012-03-27 19:35:00 2012-04-05 16:35:00 89350. #> 8 25304… 1257726… 2012-05-29 08:52:00 2012-06-04 11:53:00 57470. #> 9 85997… 1406791… 2012-05-29 06:40:00 2012-06-04 12:40:00 52616. #> 10 19040… 1247816… 2012-05-31 06:57:00 2012-06-04 14:30:00 37105. #> # ℹ 62 more rows #> # ℹ 12 more variables: total_amount_due , total_adjustment_amount , #> # payer_grouping , total_payment_amount , ip_op_flag , #> # service_line , length_of_stay , expected_length_of_stay , #> # length_of_stay_threshold , los_outlier_flag , readmit_flag , #> # readmit_expectation #> #> $`Cataract Removal` #> # A tibble: 4,930 × 17 #> mrn visit_id visit_start_date_time visit_end_date_time total_charge_amount #> #> 1 24432… 3904707… 2010-01-05 05:00:00 2010-01-05 00:00:00 31283. #> 2 42767… 3950850… 2010-01-05 05:00:00 2010-01-05 00:00:00 12833. #> 3 27436… 3391956… 2010-01-05 05:00:00 2010-01-05 00:00:00 11770. #> 4 16795… 3399694… 2010-01-05 05:00:00 2010-01-05 00:00:00 12729. #> 5 26318… 3554661… 2010-01-05 05:00:00 2010-01-05 00:00:00 12833. #> 6 61280… 3763722… 2010-01-06 05:00:00 2010-01-06 00:00:00 15748. #> 7 80833… 3967666… 2010-01-06 05:00:00 2010-01-06 00:00:00 14165. #> 8 11824… 3033075… 2010-01-06 05:00:00 2010-01-06 00:00:00 13065. #> 9 87504… 3162148… 2010-01-06 05:00:00 2010-01-06 00:00:00 12735. #> 10 87077… 3940813… 2010-01-07 05:00:00 2010-01-07 00:00:00 11514. #> # ℹ 4,920 more rows #> # ℹ 12 more variables: total_amount_due , total_adjustment_amount , #> # payer_grouping , total_payment_amount , ip_op_flag , #> # service_line , length_of_stay , expected_length_of_stay , #> # length_of_stay_threshold , los_outlier_flag , readmit_flag , #> # readmit_expectation #> #> $Cellulitis #> # A tibble: 3,311 × 17 #> mrn visit_id visit_start_date_time visit_end_date_time total_charge_amount #> #> 1 91937… 1963079… 2011-09-21 16:35:00 2011-09-23 13:42:00 20322. #> 2 14415… 1523695… 2011-09-23 13:59:00 2011-09-23 18:00:00 6860. #> 3 30115… 1278133… 2011-09-21 05:31:00 2011-09-24 10:50:00 28990. #> 4 11190… 1462795… 2011-09-22 16:32:00 2011-09-25 16:47:00 17947. #> 5 20122… 1114115… 2011-09-25 23:58:00 2011-09-26 13:30:00 8604. #> 6 66023… 1101427… 2011-09-25 02:04:00 2011-09-27 14:18:00 26726. #> 7 36903… 1842522… 2011-09-25 16:14:00 2011-09-27 18:10:00 13143. #> 8 94675… 1694578… 2011-09-28 19:23:00 2011-09-29 10:40:00 12203 #> 9 64313… 1204713… 2011-09-19 21:06:00 2011-09-30 16:54:00 95473. #> 10 81980… 1108154… 2011-09-30 22:52:00 2011-10-01 12:28:00 8901. #> # ℹ 3,301 more rows #> # ℹ 12 more variables: total_amount_due , total_adjustment_amount , #> # payer_grouping , total_payment_amount , ip_op_flag , #> # service_line , length_of_stay , expected_length_of_stay , #> # length_of_stay_threshold , los_outlier_flag , readmit_flag , #> # readmit_expectation #> #> $`Chest Pain` #> # A tibble: 2,766 × 17 #> mrn visit_id visit_start_date_time visit_end_date_time total_charge_amount #> #> 1 62048… 1900262… 2011-09-19 16:53:00 2011-09-20 19:20:00 10426. #> 2 24825… 1518935… 2011-09-19 21:51:00 2011-09-21 10:55:00 19261. #> 3 98859… 1774049… 2011-09-19 18:47:00 2011-09-22 12:50:00 27736. #> 4 60653… 1933930… 2011-09-21 23:51:00 2011-09-22 18:03:00 12116. #> 5 55103… 1113333… 2011-09-22 04:39:00 2011-09-23 14:54:00 18740. #> 6 95431… 1167648… 2011-09-22 20:11:00 2011-09-24 16:30:00 17625. #> 7 87695… 1365338… 2011-09-25 21:52:00 2011-09-26 01:47:00 8509. #> 8 36204… 1460612… 2011-09-24 20:00:00 2011-09-26 21:47:00 31526. #> 9 60438… 1812202… 2011-09-27 22:31:00 2011-09-28 11:10:00 11644. #> 10 84478… 1030571… 2011-09-28 16:29:00 2011-09-28 19:28:00 7463. #> # ℹ 2,756 more rows #> # ℹ 12 more variables: total_amount_due , total_adjustment_amount , #> # payer_grouping , total_payment_amount , ip_op_flag , #> # service_line , length_of_stay , expected_length_of_stay , #> # length_of_stay_threshold , los_outlier_flag , readmit_flag , #> # readmit_expectation #> #> $`Colonoscopy/Endoscopy` #> # A tibble: 11,486 × 17 #> mrn visit_id visit_start_date_time visit_end_date_time total_charge_amount #> #> 1 55897… 3869688… 2010-01-04 05:00:00 2010-01-04 00:00:00 8788. #> 2 13463… 3990577… 2010-01-05 05:00:00 2010-01-05 00:00:00 7607. #> 3 80092… 3361584… 2010-01-06 05:00:00 2010-01-06 00:00:00 9567. #> 4 53897… 3961488… 2010-01-06 05:00:00 2010-01-06 00:00:00 8671. #> 5 51791… 3022697… 2010-01-07 05:00:00 2010-01-07 00:00:00 7966. #> 6 94563… 3247268… 2010-01-08 05:00:00 2010-01-08 00:00:00 8695. #> 7 97321… 3978227… 2010-01-08 05:00:00 2010-01-08 00:00:00 7277. #> 8 10341… 3542481… 2010-01-08 05:00:00 2010-01-08 00:00:00 8783. #> 9 40727… 3471312… 2010-01-08 05:00:00 2010-01-08 00:00:00 8988. #> 10 96631… 3784146… 2010-01-10 20:54:00 2010-01-10 00:00:00 7656. #> # ℹ 11,476 more rows #> # ℹ 12 more variables: total_amount_due , total_adjustment_amount , #> # payer_grouping , total_payment_amount , ip_op_flag , #> # service_line , length_of_stay , expected_length_of_stay , #> # length_of_stay_threshold , los_outlier_flag , readmit_flag , #> # readmit_expectation #> #> $`GI Hemorrhage` #> # A tibble: 2,404 × 17 #> mrn visit_id visit_start_date_time visit_end_date_time total_charge_amount #> #> 1 45079… 1076298… 2011-09-24 07:08:00 2011-09-26 18:00:00 18964. #> 2 78632… 1595472… 2011-09-24 15:09:00 2011-09-27 12:06:00 27776. #> 3 80547… 1555948… 2011-09-20 01:23:00 2011-09-27 21:20:00 87188. #> 4 21014… 1246530… 2011-09-25 20:58:00 2011-09-28 15:50:00 36404. #> 5 53480… 1976271… 2011-09-20 02:55:00 2011-09-30 19:32:00 115091. #> 6 84440… 1899305… 2011-09-28 20:00:00 2011-10-01 12:06:00 26018. #> 7 55748… 1658072… 2011-09-28 23:44:00 2011-10-02 13:23:00 64608. #> 8 22340… 1938596… 2011-09-30 20:00:00 2011-10-03 14:00:00 25310. #> 9 80292… 1911753… 2011-09-30 09:09:00 2011-10-05 15:34:00 55967. #> 10 33494… 1977982… 2011-08-25 13:20:00 2011-10-05 16:38:00 301838. #> # ℹ 2,394 more rows #> # ℹ 12 more variables: total_amount_due , total_adjustment_amount , #> # payer_grouping , total_payment_amount , ip_op_flag , #> # service_line , length_of_stay , expected_length_of_stay , #> # length_of_stay_threshold , los_outlier_flag , readmit_flag , #> # readmit_expectation #> #> $`General Outpatient` #> # A tibble: 50,526 × 17 #> mrn visit_id visit_start_date_time visit_end_date_time total_charge_amount #> #> 1 86069… 3519249… 2010-01-04 05:00:00 2010-01-04 00:00:00 25984. #> 2 60856… 3602225… 2010-01-04 05:00:00 2010-01-04 00:00:00 22774. #> 3 80673… 3125290… 2010-01-04 05:00:00 2010-01-04 00:00:00 10690. #> 4 99766… 3372388… 2010-01-04 05:00:00 2010-01-04 00:00:00 7325. #> 5 23979… 3139267… 2010-01-04 05:00:00 2010-01-04 00:00:00 9119. #> 6 56640… 3346223… 2010-01-04 05:00:00 2010-01-04 00:00:00 10628 #> 7 43395… 3323331… 2010-01-04 05:00:00 2010-01-04 00:00:00 8677. #> 8 54736… 3159812… 2010-01-05 05:00:00 2010-01-05 00:00:00 9604. #> 9 71143… 3070269… 2010-01-05 05:00:00 2010-01-05 00:00:00 8839. #> 10 27377… 3185100… 2010-01-05 05:00:00 2010-01-05 00:00:00 10185. #> # ℹ 50,516 more rows #> # ℹ 12 more variables: total_amount_due , total_adjustment_amount , #> # payer_grouping , total_payment_amount , ip_op_flag , #> # service_line , length_of_stay , expected_length_of_stay , #> # length_of_stay_threshold , los_outlier_flag , readmit_flag , #> # readmit_expectation #> #> $`Joint Replacement` #> # A tibble: 447 × 17 #> mrn visit_id visit_start_date_time visit_end_date_time total_charge_amount #> #> 1 35741… 1963731… 2011-09-20 06:42:00 2011-09-23 18:27:00 70655. #> 2 45785… 1385680… 2011-09-27 07:51:00 2011-09-30 17:30:00 76480. #> 3 96001… 1647184… 2011-09-27 05:30:00 2011-09-30 18:20:00 90495. #> 4 78560… 1955538… 2011-09-22 09:00:00 2011-10-04 17:05:00 128587. #> 5 24244… 1536456… 2011-10-04 11:09:00 2011-10-07 15:13:00 80185. #> 6 45372… 1900289… 2011-10-04 06:33:00 2011-10-07 17:15:00 73753. #> 7 68583… 1223451… 2011-10-04 05:00:00 2011-10-07 17:15:00 86199. #> 8 76901… 1228116… 2011-10-04 08:25:00 2011-10-07 17:20:00 70719. #> 9 84765… 1344408… 2011-10-13 05:25:00 2011-10-18 20:21:00 82033. #> 10 13510… 1879596… 2011-10-18 05:00:00 2011-10-21 16:18:00 97454. #> # ℹ 437 more rows #> # ℹ 12 more variables: total_amount_due , total_adjustment_amount , #> # payer_grouping , total_payment_amount , ip_op_flag , #> # service_line , length_of_stay , expected_length_of_stay , #> # length_of_stay_threshold , los_outlier_flag , readmit_flag , #> # readmit_expectation #> #> $`Laparoscopic Cholecystectomy` #> # A tibble: 2,456 × 17 #> mrn visit_id visit_start_date_time visit_end_date_time total_charge_amount #> #> 1 44174… 3094545… 2010-01-05 05:00:00 2010-01-05 00:00:00 13263. #> 2 42989… 3855977… 2010-01-12 05:00:00 2010-01-13 00:00:00 13717. #> 3 80834… 3647383… 2010-01-19 05:00:00 2010-01-20 00:00:00 13915. #> 4 24888… 3164824… 2010-01-28 05:00:00 2010-01-29 00:00:00 12403. #> 5 25026… 3107332… 2010-01-28 05:00:00 2010-01-29 00:00:00 13995. #> 6 43792… 3606774… 2010-01-29 05:00:00 2010-01-30 00:00:00 13725. #> 7 31761… 3103216… 2010-02-02 05:00:00 2010-02-02 00:00:00 13763. #> 8 12868… 3439301… 2010-02-04 05:00:00 2010-02-05 00:00:00 13602. #> 9 86010… 3136153… 2010-02-05 05:00:00 2010-02-06 00:00:00 15136. #> 10 40209… 3923213… 2010-02-11 05:00:00 2010-02-11 00:00:00 12798. #> # ℹ 2,446 more rows #> # ℹ 12 more variables: total_amount_due , total_adjustment_amount , #> # payer_grouping , total_payment_amount , ip_op_flag , #> # service_line , length_of_stay , expected_length_of_stay , #> # length_of_stay_threshold , los_outlier_flag , readmit_flag , #> # readmit_expectation #> #> $MI #> # A tibble: 2,253 × 17 #> mrn visit_id visit_start_date_time visit_end_date_time total_charge_amount #> #> 1 13778… 1779125… 2011-09-22 15:44:00 2011-09-23 12:48:00 13819. #> 2 75904… 1290112… 2011-09-29 11:57:00 2011-09-29 15:15:00 23384. #> 3 56932… 1127730… 2011-09-29 21:58:00 2011-09-30 16:37:00 11806. #> 4 33544… 1537839… 2011-09-18 13:21:00 2011-10-04 15:52:00 165563. #> 5 80141… 1426155… 2011-09-18 15:50:00 2011-10-06 15:25:00 137769. #> 6 44194… 1588054… 2011-09-30 09:14:00 2011-10-07 09:00:00 64195 #> 7 15917… 1023432… 2011-10-07 04:19:00 2011-10-08 16:30:00 29082. #> 8 45753… 1636854… 2011-10-02 02:37:00 2011-10-11 14:40:00 89552. #> 9 15982… 1131846… 2011-10-09 07:14:00 2011-10-16 15:50:00 46561. #> 10 75745… 1816201… 2011-10-16 16:39:00 2011-10-17 19:56:00 10487. #> # ℹ 2,243 more rows #> # ℹ 12 more variables: total_amount_due , total_adjustment_amount , #> # payer_grouping , total_payment_amount , ip_op_flag , #> # service_line , length_of_stay , expected_length_of_stay , #> # length_of_stay_threshold , los_outlier_flag , readmit_flag , #> # readmit_expectation #> #> $`Major Depression/Bipolar Affective Disorders` #> # A tibble: 2,866 × 17 #> mrn visit_id visit_start_date_time visit_end_date_time total_charge_amount #> #> 1 83028… 1773215… 2011-09-19 16:52:00 2011-09-22 13:18:00 12668. #> 2 52413… 1344738… 2011-09-17 15:46:00 2011-09-28 15:13:00 41043. #> 3 76863… 1963121… 2011-09-20 20:26:00 2011-09-28 17:11:00 30736. #> 4 31780… 1094724… 2011-09-26 00:15:00 2011-09-30 13:55:00 17790. #> 5 51449… 1225742… 2011-09-28 22:44:00 2011-10-03 14:35:00 19806. #> 6 16347… 1925531… 2011-09-30 16:55:00 2011-10-03 15:06:00 13748. #> 7 95753… 1886595… 2011-09-24 20:06:00 2011-10-03 15:07:00 34606. #> 8 52126… 1594861… 2011-09-22 19:56:00 2011-10-03 15:21:00 40757. #> 9 75670… 1235696… 2011-09-27 16:18:00 2011-10-03 15:26:00 24597. #> 10 42724… 1433227… 2011-09-19 10:39:00 2011-10-04 12:40:00 55108. #> # ℹ 2,856 more rows #> # ℹ 12 more variables: total_amount_due , total_adjustment_amount , #> # payer_grouping , total_payment_amount , ip_op_flag , #> # service_line , length_of_stay , expected_length_of_stay , #> # length_of_stay_threshold , los_outlier_flag , readmit_flag , #> # readmit_expectation #> #> $Mastectomy #> # A tibble: 58 × 17 #> mrn visit_id visit_start_date_time visit_end_date_time total_charge_amount #> #> 1 80731… 1129236… 2011-11-07 04:43:00 2011-11-09 13:05:00 33908. #> 2 37638… 1018182… 2011-11-14 06:43:00 2011-11-15 14:20:00 28817. #> 3 57062… 1503680… 2011-11-28 04:49:00 2011-11-29 15:00:00 29532. #> 4 57598… 1330344… 2011-12-12 09:22:00 2011-12-13 18:00:00 22163. #> 5 67748… 1066637… 2011-12-12 05:32:00 2011-12-14 14:00:00 36931. #> 6 81680… 1751336… 2012-01-16 06:00:00 2012-01-16 11:25:00 19637. #> 7 26174… 1748684… 2012-01-30 05:15:00 2012-01-31 18:30:00 25352. #> 8 59559… 1265426… 2012-02-06 05:00:00 2012-02-07 16:51:00 58899. #> 9 79465… 1419822… 2012-04-02 05:45:00 2012-04-03 13:50:00 104772. #> 10 27380… 1719685… 2012-04-16 05:57:00 2012-04-17 14:35:00 86889. #> # ℹ 48 more rows #> # ℹ 12 more variables: total_amount_due , total_adjustment_amount , #> # payer_grouping , total_payment_amount , ip_op_flag , #> # service_line , length_of_stay , expected_length_of_stay , #> # length_of_stay_threshold , los_outlier_flag , readmit_flag , #> # readmit_expectation #> #> $Medical #> # A tibble: 64,435 × 17 #> mrn visit_id visit_start_date_time visit_end_date_time total_charge_amount #> #> 1 15915… 1588023… 2011-09-11 19:55:00 2011-09-13 16:01:00 23983. #> 2 24790… 1351333… 2011-09-18 22:00:00 2011-09-21 14:10:00 29385. #> 3 40945… 1350530… 2011-09-20 22:23:00 2011-09-21 16:15:00 12161. #> 4 67359… 1906290… 2011-09-19 23:09:00 2011-09-21 17:27:00 16550. #> 5 36661… 1162679… 2011-09-21 03:14:00 2011-09-21 17:30:00 17444. #> 6 59649… 1179016… 2011-09-20 22:57:00 2011-09-21 22:30:00 27419 #> 7 65736… 1669246… 2011-09-21 09:45:00 2011-09-22 11:35:00 38719. #> 8 27099… 1828863… 2011-09-21 20:19:00 2011-09-22 11:35:00 9612. #> 9 78487… 1754195… 2011-09-20 15:47:00 2011-09-22 12:30:00 21077. #> 10 17896… 1716209… 2011-09-21 15:44:00 2011-09-22 12:42:00 11714. #> # ℹ 64,425 more rows #> # ℹ 12 more variables: total_amount_due , total_adjustment_amount , #> # payer_grouping , total_payment_amount , ip_op_flag , #> # service_line , length_of_stay , expected_length_of_stay , #> # length_of_stay_threshold , los_outlier_flag , readmit_flag , #> # readmit_expectation #> #> $PTCA #> # A tibble: 1,343 × 17 #> mrn visit_id visit_start_date_time visit_end_date_time total_charge_amount #> #> 1 65802… 1922614… 2013-12-16 18:42:00 2013-12-18 15:54:00 95300. #> 2 47960… 1712037… 2013-12-17 09:24:00 2013-12-20 11:44:00 126548. #> 3 88081… 1416143… 2013-12-16 15:57:00 2013-12-21 18:29:00 165931. #> 4 47327… 1242762… 2013-12-20 23:49:00 2013-12-24 16:27:00 72849. #> 5 68288… 1687746… 2013-12-08 13:12:00 2013-12-24 18:40:00 277715. #> 6 65853… 1602546… 2013-12-24 12:16:00 2013-12-27 17:21:00 129947. #> 7 22470… 1919563… 2014-01-02 22:02:00 2014-01-05 12:45:00 122591. #> 8 70383… 1542050… 2014-01-02 17:37:00 2014-01-08 15:18:00 155744. #> 9 30699… 1996197… 2014-01-07 15:17:00 2014-01-14 15:51:00 280973. #> 10 15526… 1350260… 2014-01-11 22:29:00 2014-01-15 12:13:00 100158. #> # ℹ 1,333 more rows #> # ℹ 12 more variables: total_amount_due , total_adjustment_amount , #> # payer_grouping , total_payment_amount , ip_op_flag , #> # service_line , length_of_stay , expected_length_of_stay , #> # length_of_stay_threshold , los_outlier_flag , readmit_flag , #> # readmit_expectation #> #> $`PTCA Outpatient` #> # A tibble: 369 × 17 #> mrn visit_id visit_start_date_time visit_end_date_time total_charge_amount #> #> 1 40037… 3514125… 2013-12-18 05:00:00 2013-12-19 00:00:00 107785. #> 2 65938… 3525540… 2013-12-19 05:00:00 2013-12-20 00:00:00 99169. #> 3 64137… 3456566… 2013-12-19 05:00:00 2013-12-20 00:00:00 104680. #> 4 32157… 3927503… 2013-12-20 05:00:00 2013-12-20 00:00:00 85622. #> 5 97406… 3404098… 2014-01-08 05:00:00 2014-01-08 00:00:00 54834. #> 6 52799… 3644914… 2014-01-09 05:00:00 2014-01-10 00:00:00 38735. #> 7 31448… 3922625… 2014-01-28 05:00:00 2014-01-28 00:00:00 73034. #> 8 69180… 3654599… 2014-01-29 05:00:00 2014-01-30 00:00:00 69213. #> 9 79461… 3382468… 2014-01-30 05:00:00 2014-01-31 00:00:00 73589. #> 10 35852… 3344079… 2014-02-18 05:00:00 2014-02-18 00:00:00 73071. #> # ℹ 359 more rows #> # ℹ 12 more variables: total_amount_due , total_adjustment_amount , #> # payer_grouping , total_payment_amount , ip_op_flag , #> # service_line , length_of_stay , expected_length_of_stay , #> # length_of_stay_threshold , los_outlier_flag , readmit_flag , #> # readmit_expectation #> #> $Pneumonia #> # A tibble: 3,323 × 17 #> mrn visit_id visit_start_date_time visit_end_date_time total_charge_amount #> #> 1 41168… 1339933… 2011-09-19 00:15:00 2011-09-20 18:15:00 13585. #> 2 87344… 1581344… 2011-09-21 09:39:00 2011-09-24 18:21:00 38143. #> 3 64810… 1511895… 2011-09-23 20:30:00 2011-09-26 12:45:00 23686. #> 4 23339… 1813741… 2011-09-23 15:18:00 2011-09-26 13:23:00 26700. #> 5 43861… 1935030… 2011-09-22 14:03:00 2011-09-26 20:03:00 32690. #> 6 35356… 1551465… 2011-09-21 20:50:00 2011-09-27 16:34:00 45089. #> 7 49815… 1349707… 2011-09-23 02:48:00 2011-09-30 18:10:00 50528. #> 8 77558… 1443601… 2011-09-30 15:42:00 2011-10-01 11:28:00 12873. #> 9 72612… 1249400… 2011-09-30 19:05:00 2011-10-03 18:47:00 18688. #> 10 36317… 1539295… 2011-10-01 10:44:00 2011-10-04 13:59:00 24887. #> # ℹ 3,313 more rows #> # ℹ 12 more variables: total_amount_due , total_adjustment_amount , #> # payer_grouping , total_payment_amount , ip_op_flag , #> # service_line , length_of_stay , expected_length_of_stay , #> # length_of_stay_threshold , los_outlier_flag , readmit_flag , #> # readmit_expectation #> #> $Schizophrenia #> # A tibble: 1,681 × 17 #> mrn visit_id visit_start_date_time visit_end_date_time total_charge_amount #> #> 1 78864… 1578423… 2011-09-10 10:37:00 2011-09-16 14:08:00 25230. #> 2 90780… 1948172… 2011-09-12 20:18:00 2011-09-22 13:19:00 37537. #> 3 24439… 1541902… 2011-09-17 20:52:00 2011-09-23 14:34:00 24523. #> 4 17550… 1239946… 2011-09-15 19:56:00 2011-10-04 10:50:00 70223. #> 5 90449… 1067597… 2011-09-26 10:16:00 2011-10-06 15:08:00 40697. #> 6 21252… 1222746… 2011-10-05 10:32:00 2011-10-11 14:28:00 25232. #> 7 47554… 1507806… 2011-09-24 19:18:00 2011-10-12 15:41:00 62677. #> 8 34234… 1699816… 2011-10-06 19:05:00 2011-10-13 12:57:00 34400. #> 9 70046… 1132874… 2011-10-07 20:28:00 2011-10-14 15:26:00 26578. #> 10 74820… 1025221… 2011-10-11 20:57:00 2011-10-19 13:46:00 30806. #> # ℹ 1,671 more rows #> # ℹ 12 more variables: total_amount_due , total_adjustment_amount , #> # payer_grouping , total_payment_amount , ip_op_flag , #> # service_line , length_of_stay , expected_length_of_stay , #> # length_of_stay_threshold , los_outlier_flag , readmit_flag , #> # readmit_expectation #> #> $Surgical #> # A tibble: 14,916 × 17 #> mrn visit_id visit_start_date_time visit_end_date_time total_charge_amount #> #> 1 58762… 1957238… 2011-09-19 20:12:00 2011-09-21 11:17:00 33911. #> 2 66908… 1572987… 2011-09-20 09:09:00 2011-09-22 10:27:00 16933. #> 3 55391… 1020021… 2011-09-21 23:20:00 2011-09-22 15:44:00 13050. #> 4 28900… 1121152… 2011-09-20 05:00:00 2011-09-22 17:51:00 24769. #> 5 46455… 1937756… 2011-09-22 20:09:00 2011-09-23 18:07:00 32807. #> 6 86883… 1781570… 2011-09-23 05:00:00 2011-09-24 11:44:00 20214. #> 7 74525… 1390406… 2011-09-25 07:23:00 2011-09-26 17:45:00 37743. #> 8 91913… 1827659… 2011-09-23 13:36:00 2011-09-27 11:47:00 53769. #> 9 95797… 1767983… 2011-09-11 20:12:00 2011-09-27 15:47:00 161126. #> 10 68422… 1124488… 2011-09-26 07:18:00 2011-09-28 14:42:00 105689. #> # ℹ 14,906 more rows #> # ℹ 12 more variables: total_amount_due , total_adjustment_amount , #> # payer_grouping , total_payment_amount , ip_op_flag , #> # service_line , length_of_stay , expected_length_of_stay , #> # length_of_stay_threshold , los_outlier_flag , readmit_flag , #> # readmit_expectation #> #> $Syncope #> # A tibble: 1,854 × 17 #> mrn visit_id visit_start_date_time visit_end_date_time total_charge_amount #> #> 1 23076… 1461398… 2011-09-20 01:18:00 2011-09-20 10:38:00 13422. #> 2 84855… 1170655… 2011-09-19 18:23:00 2011-09-21 15:51:00 21865. #> 3 47360… 1041458… 2011-09-20 23:24:00 2011-09-22 13:34:00 17635 #> 4 29909… 1798395… 2011-09-22 15:38:00 2011-09-25 15:12:00 33088. #> 5 86969… 1347663… 2011-09-25 15:28:00 2011-09-26 16:43:00 14623. #> 6 16815… 1367750… 2011-09-23 17:02:00 2011-09-26 18:51:00 27595. #> 7 74671… 1467173… 2011-09-25 02:07:00 2011-09-26 22:00:00 34697. #> 8 58540… 1224109… 2011-09-22 23:12:00 2011-09-27 18:47:00 29705. #> 9 44743… 1018572… 2011-09-27 18:07:00 2011-09-28 18:40:00 16385. #> 10 69830… 1136058… 2011-09-27 10:55:00 2011-09-28 21:16:00 5867. #> # ℹ 1,844 more rows #> # ℹ 12 more variables: total_amount_due , total_adjustment_amount , #> # payer_grouping , total_payment_amount , ip_op_flag , #> # service_line , length_of_stay , expected_length_of_stay , #> # length_of_stay_threshold , los_outlier_flag , readmit_flag , #> # readmit_expectation #> #> $TIA #> # A tibble: 1,490 × 17 #> mrn visit_id visit_start_date_time visit_end_date_time total_charge_amount #> #> 1 11900… 1817373… 2011-09-26 20:51:00 2011-09-27 14:07:00 15764. #> 2 40157… 1365680… 2011-09-26 22:49:00 2011-09-29 18:35:00 27759. #> 3 81648… 1909292… 2011-10-08 15:57:00 2011-10-11 16:46:00 44648. #> 4 35853… 1358966… 2011-10-06 19:41:00 2011-10-13 11:24:00 66200. #> 5 35309… 1512759… 2011-10-10 17:33:00 2011-10-13 15:46:00 32168. #> 6 60037… 1754357… 2011-10-09 21:27:00 2011-10-13 16:03:00 37201. #> 7 24439… 1805134… 2011-10-12 14:56:00 2011-10-17 14:21:00 56238. #> 8 95326… 1662410… 2011-10-13 14:44:00 2011-10-20 16:27:00 85644. #> 9 97257… 1096965… 2011-10-19 23:02:00 2011-10-23 14:11:00 37159. #> 10 19835… 1741208… 2011-10-16 19:00:00 2011-10-24 16:56:00 65126. #> # ℹ 1,480 more rows #> # ℹ 12 more variables: total_amount_due , total_adjustment_amount , #> # payer_grouping , total_payment_amount , ip_op_flag , #> # service_line , length_of_stay , expected_length_of_stay , #> # length_of_stay_threshold , los_outlier_flag , readmit_flag , #> # readmit_expectation #> #> $`Vaginal Delivery` #> # A tibble: 11 × 17 #> mrn visit_id visit_start_date_time visit_end_date_time total_charge_amount #> #> 1 97356… 1473544… 2011-12-14 15:30:00 2011-12-14 17:37:00 5707 #> 2 54205… 1412111… 2012-01-31 07:10:00 2012-01-31 09:00:00 7885. #> 3 78836… 1257448… 2012-03-05 13:51:00 2012-03-05 16:40:00 11019. #> 4 51141… 1989466… 2012-06-12 12:02:00 2012-06-12 13:17:00 7702 #> 5 63911… 1743794… 2012-07-06 08:59:00 2012-07-06 11:07:00 7386. #> 6 16156… 1997707… 2012-07-13 09:15:00 2012-07-13 11:59:00 15250. #> 7 25535… 1161988… 2012-09-22 18:35:00 2012-09-22 22:00:00 8301. #> 8 88987… 1605284… 2012-11-04 00:50:00 2012-11-11 14:14:00 46743. #> 9 88866… 1936904… 2012-12-14 07:10:00 2012-12-15 20:37:00 12017. #> 10 93192… 1506189… 2013-03-06 12:01:00 2013-03-06 13:31:00 8192. #> 11 79312… 1724518… 2013-09-08 22:32:00 2013-09-08 23:21:00 6599. #> # ℹ 12 more variables: total_amount_due , total_adjustment_amount , #> # payer_grouping , total_payment_amount , ip_op_flag , #> # service_line , length_of_stay , expected_length_of_stay , #> # length_of_stay_threshold , los_outlier_flag , readmit_flag , #> # readmit_expectation #> #> $`Valve Procedure` #> # A tibble: 8 × 17 #> mrn visit_id visit_start_date_time visit_end_date_time total_charge_amount #> #> 1 698201… 1919502… 2014-10-01 02:44:00 2014-10-01 10:30:00 61967. #> 2 825784… 1181134… 2014-11-19 15:29:00 2014-11-20 22:42:00 95348. #> 3 697728… 1925626… 2015-06-12 22:07:00 2015-06-13 02:00:00 210729. #> 4 497633… 1911039… 2016-01-12 02:12:00 2016-01-13 12:25:00 209630. #> 5 586969… 1572755… 2016-01-12 09:06:00 2016-01-14 14:55:00 244695. #> 6 729922… 1565557… 2016-04-06 10:38:00 2016-04-15 16:33:00 215360. #> 7 507774… 1715639… 2018-06-05 00:37:00 2018-06-05 13:58:00 295358. #> 8 444943… 1920905… 2020-07-13 10:21:00 2020-07-13 15:00:00 341798. #> # ℹ 12 more variables: total_amount_due , total_adjustment_amount , #> # payer_grouping , total_payment_amount , ip_op_flag , #> # service_line , length_of_stay , expected_length_of_stay , #> # length_of_stay_threshold , los_outlier_flag , readmit_flag , #> # readmit_expectation #>"},{"path":"https://www.spsanderson.com/healthyR/reference/opt_bin.html","id":null,"dir":"Reference","previous_headings":"","what":"Get the optimal binwidth for a histogram — opt_bin","title":"Get the optimal binwidth for a histogram — opt_bin","text":"Gives optimal binwidth histogram given data set, value desired amount bins","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/opt_bin.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get the optimal binwidth for a histogram — opt_bin","text":"","code":"opt_bin(.data, .value_col, .iters = 30)"},{"path":"https://www.spsanderson.com/healthyR/reference/opt_bin.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get the optimal binwidth for a histogram — opt_bin","text":".data data set question .value_col column holds values .iters many times cost function loop run","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/opt_bin.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get the optimal binwidth for a histogram — opt_bin","text":"tibble histogram breakpoints","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/opt_bin.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Get the optimal binwidth for a histogram — opt_bin","text":"Modified Hideaki Shimazaki Department Physics, Kyoto University shimazaki ton.scphys.kyoto-u.ac.jp Feel free modify/distribute program. Supply data.frame/tibble value column. optimal binwidth computed amount binds desired","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/opt_bin.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get the optimal binwidth for a histogram — opt_bin","text":"","code":"suppressPackageStartupMessages(library(purrr)) suppressPackageStartupMessages(library(dplyr)) df_tbl <- rnorm(n = 1000, mean = 0, sd = 1) df_tbl <- df_tbl %>% as_tibble() %>% set_names(\"value\") df_tbl %>% opt_bin( .value_col = value , .iters = 100 ) #> # A tibble: 16 × 1 #> value #> #> 1 -2.85 #> 2 -2.45 #> 3 -2.04 #> 4 -1.64 #> 5 -1.23 #> 6 -0.825 #> 7 -0.419 #> 8 -0.0131 #> 9 0.393 #> 10 0.799 #> 11 1.20 #> 12 1.61 #> 13 2.02 #> 14 2.42 #> 15 2.83 #> 16 3.23"},{"path":"https://www.spsanderson.com/healthyR/reference/pipe.html","id":null,"dir":"Reference","previous_headings":"","what":"Pipe operator — %>%","title":"Pipe operator — %>%","text":"See magrittr::%>% details.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/pipe.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Pipe operator — %>%","text":"","code":"lhs %>% rhs"},{"path":"https://www.spsanderson.com/healthyR/reference/px_cc_mapping.html","id":null,"dir":"Reference","previous_headings":"","what":"Procedure to Condition Code Mapping file — px_cc_mapping","title":"Procedure to Condition Code Mapping file — px_cc_mapping","text":"dataset containing Procedure Code AHRQ Condition Code Mapping used helping define servce lines inpatient discharges.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/px_cc_mapping.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Procedure to Condition Code Mapping file — px_cc_mapping","text":"","code":"data(px_cc_mapping)"},{"path":"https://www.spsanderson.com/healthyR/reference/px_cc_mapping.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Procedure to Condition Code Mapping file — px_cc_mapping","text":"data frame 79721 rows 5 variables","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/px_cc_mapping.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Procedure to Condition Code Mapping file — px_cc_mapping","text":"CC_Code. PX_1, PX_2, ..., PX_n CC_Desc. PX_1 = Genitourinary incontinence procedures ICD_Ver_Flag. 10 9 ICDCode. ICD-9 ICD-10 Code Procedure. Inject Implant Urethra","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/save_to_excel.html","id":null,"dir":"Reference","previous_headings":"","what":"Save a file to Excel — save_to_excel","title":"Save a file to Excel — save_to_excel","text":"Save tibble/data.frame excel .xlsx file. file automatically save_dtime format 20201109_132416 November 11th, 2020 1:24:16PM.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/save_to_excel.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Save a file to Excel — save_to_excel","text":"","code":"save_to_excel(.data, .file_name)"},{"path":"https://www.spsanderson.com/healthyR/reference/save_to_excel.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Save a file to Excel — save_to_excel","text":".data tibble/data.frame want save .xlsx file. .file_name name want give file.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/save_to_excel.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Save a file to Excel — save_to_excel","text":"saved excel file","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/save_to_excel.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Save a file to Excel — save_to_excel","text":"Requires tibble/data.frame passed .","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/save_to_excel.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Save a file to Excel — save_to_excel","text":"Steven P. Sanderson II, MPH","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/service_line_augment.html","id":null,"dir":"Reference","previous_headings":"","what":"Service Line Grouper Augment Function — service_line_augment","title":"Service Line Grouper Augment Function — service_line_augment","text":"Takes arguments data.frame/tibble returns service line augmented data.frame/tibble set patients.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/service_line_augment.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Service Line Grouper Augment Function — service_line_augment","text":"","code":"service_line_augment(.data, .dx_col, .px_col, .drg_col)"},{"path":"https://www.spsanderson.com/healthyR/reference/service_line_augment.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Service Line Grouper Augment Function — service_line_augment","text":".data data passed augmented function. .dx_col column containing Principal Diagnosis discharge. .px_col column containing Principal Coded Procedure discharge. possible blank. .drg_col DRG Number coded inpatient discharge.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/service_line_augment.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Service Line Grouper Augment Function — service_line_augment","text":"augmented data.frame/tibble service line appended new column.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/service_line_augment.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Service Line Grouper Augment Function — service_line_augment","text":"augment function appends vector data.frame/tibble passed .data parameter. data.frame/tibble required, along principal diagnosis column, principal procedure column, column DRG number. needed function can join dx_cc_mapping px_cc_mapping columns provide service line. function works visits coded using ICD Version 10 . Lets take example discharge, DRG 896 Principal Diagnosis code maps DX_660, visit get grouped alcohol_abuse DRG 896: ALCOHOL, DRUG ABUSE DEPENDENCE WITHOUT REHABILITATION THERAPY MAJOR COMPLICATION COMORBIDITY (MCC) DX_660 Maps following ICD-10 Codes ie F1010 Alcohol abuse, uncomplicated:","code":"library(healthyR) dx_cc_mapping %>% filter(CC_Code == \"DX_660\", ICD_Ver_Flag == \"10\")"},{"path":"https://www.spsanderson.com/healthyR/reference/service_line_augment.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Service Line Grouper Augment Function — service_line_augment","text":"Steven P. Sanderson II, MPH","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/service_line_augment.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Service Line Grouper Augment Function — service_line_augment","text":"","code":"df <- data.frame( dx_col = \"F10.10\", px_col = NA, drg_col = \"896\" ) service_line_augment( .data = df, .dx_col = dx_col, .px_col = px_col, .drg_col = drg_col ) #> # A tibble: 1 × 4 #> dx_col px_col drg_col service_line #> #> 1 F10.10 NA 896 alcohol_abuse"},{"path":"https://www.spsanderson.com/healthyR/reference/service_line_vec.html","id":null,"dir":"Reference","previous_headings":"","what":"Service Line Grouper Vectorized Function — service_line_vec","title":"Service Line Grouper Vectorized Function — service_line_vec","text":"Takes arguments data.frame/tibble returns service line vector set patients.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/service_line_vec.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Service Line Grouper Vectorized Function — service_line_vec","text":"","code":"service_line_vec(.data, .dx_col, .px_col, .drg_col)"},{"path":"https://www.spsanderson.com/healthyR/reference/service_line_vec.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Service Line Grouper Vectorized Function — service_line_vec","text":".data data passed augmented function. .dx_col column containing Principal Diagnosis discharge. .px_col column containing Principal Coded Procedure discharge. possible blank. .drg_col DRG Number coded inpatient discharge.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/service_line_vec.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Service Line Grouper Vectorized Function — service_line_vec","text":"vector service line assignments.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/service_line_vec.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Service Line Grouper Vectorized Function — service_line_vec","text":"vectorized function returns vector. can applied inside mutate statement using dplyr desired. data.frame/tibble required, along principal diagnosis column, principal procedure column, column DRG number. needed function can join dx_cc_mapping px_cc_mapping columns provide service line. function works visits coded using ICD Version 10 . Lets take example discharge, DRG 896 Principal Diagnosis code maps DX_660, visit get grouped alcohol_abuse DRG 896: ALCOHOL, DRUG ABUSE DEPENDENCE WITHOUT REHABILITATION THERAPY MAJOR COMPLICATION COMORBIDITY (MCC) DX_660 Maps following ICD-10 Codes ie F1010 Alcohol abuse, uncomplicated:","code":"library(healthyR) dx_cc_mapping %>% filter(CC_Code == \"DX_660\", ICD_Ver_Flag == \"10\")"},{"path":"https://www.spsanderson.com/healthyR/reference/service_line_vec.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Service Line Grouper Vectorized Function — service_line_vec","text":"Steven P. Sanderson II, MPH","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/service_line_vec.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Service Line Grouper Vectorized Function — service_line_vec","text":"","code":"df <- data.frame( dx_col = \"F10.10\", px_col = NA, drg_col = \"896\" ) service_line_vec( .data = df, .dx_col = dx_col, .px_col = px_col, .drg_col = drg_col ) #> [1] \"alcohol_abuse\""},{"path":"https://www.spsanderson.com/healthyR/reference/sql_left.html","id":null,"dir":"Reference","previous_headings":"","what":"Use SQL LEFT type function — sql_left","title":"Use SQL LEFT type function — sql_left","text":"Perform SQL LEFT() type function piece text","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/sql_left.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Use SQL LEFT type function — sql_left","text":"","code":"sql_left(.text, .num_char)"},{"path":"https://www.spsanderson.com/healthyR/reference/sql_left.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Use SQL LEFT type function — sql_left","text":".text piece text/string manipulated .num_char many characters want grab","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/sql_left.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Use SQL LEFT type function — sql_left","text":"must supply data want manipulate.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/sql_left.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Use SQL LEFT type function — sql_left","text":"","code":"sql_left(\"text\", 3) #> [1] \"tex\""},{"path":"https://www.spsanderson.com/healthyR/reference/sql_mid.html","id":null,"dir":"Reference","previous_headings":"","what":"Use SQL MID type function — sql_mid","title":"Use SQL MID type function — sql_mid","text":"Perform SQL SUBSTRING type function","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/sql_mid.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Use SQL MID type function — sql_mid","text":"","code":"sql_mid(.text, .start_num, .num_char)"},{"path":"https://www.spsanderson.com/healthyR/reference/sql_mid.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Use SQL MID type function — sql_mid","text":".text piece text/string manipulated .start_num place start .num_char many characters want grab","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/sql_mid.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Use SQL MID type function — sql_mid","text":"must supply data want manipulate.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/sql_mid.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Use SQL MID type function — sql_mid","text":"","code":"sql_mid(\"this is some text\", 6, 2) #> [1] \"is\""},{"path":"https://www.spsanderson.com/healthyR/reference/sql_right.html","id":null,"dir":"Reference","previous_headings":"","what":"Use SQL RIGHT type functions — sql_right","title":"Use SQL RIGHT type functions — sql_right","text":"Perform SQL RIGHT type function","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/sql_right.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Use SQL RIGHT type functions — sql_right","text":"","code":"sql_right(.text, .num_char)"},{"path":"https://www.spsanderson.com/healthyR/reference/sql_right.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Use SQL RIGHT type functions — sql_right","text":".text piece text/string manipulated .num_char many characters want grab","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/sql_right.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Use SQL RIGHT type functions — sql_right","text":"must supply data want manipulate.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/sql_right.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Use SQL RIGHT type functions — sql_right","text":"","code":"sql_right(\"this is some more text\", 3) #> [1] \"ext\""},{"path":"https://www.spsanderson.com/healthyR/reference/tidyeval.html","id":null,"dir":"Reference","previous_headings":"","what":"Tidy eval helpers — tidyeval","title":"Tidy eval helpers — tidyeval","text":"sym() creates symbol string syms() creates list symbols character vector. enquo() enquos() delay execution one several function arguments. enquo() returns single quoted expression, like blueprint delayed computation. enquos() returns list quoted expressions. expr() quotes new expression locally. mostly useful build new expressions around arguments captured enquo() enquos(): expr(mean(!!enquo(arg), na.rm = TRUE)). as_name() transforms quoted variable name string. Supplying something else quoted variable name error. unlike as_label() also returns single string supports kind R object input, including quoted function calls vectors. purpose summarise object single label. label often suitable default name. know quoted expression contains (instance expressions captured enquo() variable name, call function, unquoted constant), use as_label(). know quoted simple variable name, like enforce , use as_name(). learn tidy eval use tools, visit Metaprogramming section Advanced R.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/top_n_tbl.html","id":null,"dir":"Reference","previous_headings":"","what":"Top N tibble — top_n_tbl","title":"Top N tibble — top_n_tbl","text":"Get tibble returned n records sorted either descending order (default) ascending order.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/top_n_tbl.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Top N tibble — top_n_tbl","text":"","code":"top_n_tbl(.data, .n_records, .arrange_value = TRUE, ...)"},{"path":"https://www.spsanderson.com/healthyR/reference/top_n_tbl.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Top N tibble — top_n_tbl","text":".data data want pass function .n_records many records want returned .arrange_value boolean TRUE default. TRUE sorts data descending order ... columns want pass function.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/top_n_tbl.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Top N tibble — top_n_tbl","text":"Requires data.frame/tibble Requires least one column chosen inside ... return tibble sorted order chosen descending default","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/top_n_tbl.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Top N tibble — top_n_tbl","text":"Steven P. Sanderson II, MPH","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/top_n_tbl.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Top N tibble — top_n_tbl","text":"","code":"library(healthyR.data) df <- healthyR_data df_tbl <- top_n_tbl( .data = df , .n_records = 3 , .arrange_value = TRUE , service_line , payer_grouping ) print(df_tbl) #> # A tibble: 3 × 3 #> service_line payer_grouping n #> #> 1 Medical Medicare A 30250 #> 2 General Outpatient Medicare B 13646 #> 3 General Outpatient Blue Cross 10607"},{"path":"https://www.spsanderson.com/healthyR/reference/ts_alos_plt.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot ALOS - Average Length of Stay — ts_alos_plt","title":"Plot ALOS - Average Length of Stay — ts_alos_plt","text":"Plot ALOS - Average Length Stay","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/ts_alos_plt.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot ALOS - Average Length of Stay — ts_alos_plt","text":"","code":"ts_alos_plt(.data, .date_col, .value_col, .by_grouping, .interactive)"},{"path":"https://www.spsanderson.com/healthyR/reference/ts_alos_plt.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot ALOS - Average Length of Stay — ts_alos_plt","text":".data time series data need pass .date_col date column .value_col value column .by_grouping want data summarized - \"sec\", \"min\", \"hour\", \"day\", \"week\", \"month\", \"quarter\" \"year\" .interactive TRUE FALSE. TRUE returns plotly plot FALSE returns static ggplot2 plot","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/ts_alos_plt.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot ALOS - Average Length of Stay — ts_alos_plt","text":"timetk time series plot","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/ts_alos_plt.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Plot ALOS - Average Length of Stay — ts_alos_plt","text":"Expects tibble date time column value column Uses timetk underlying sumarization plot .by_grouping missing default \"day\" static ggplot2 object return .interactive function FALSE otherwise plotly plot returned.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/ts_alos_plt.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Plot ALOS - Average Length of Stay — ts_alos_plt","text":"Steven P. Sanderson II, MPH","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/ts_alos_plt.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot ALOS - Average Length of Stay — ts_alos_plt","text":"","code":"library(healthyR) library(healthyR.data) library(timetk) library(dplyr) library(purrr) # Make A Series of Dates ---- data_tbl <- healthyR_data df_tbl <- data_tbl %>% filter(ip_op_flag == \"I\") %>% select(visit_end_date_time, length_of_stay) %>% summarise_by_time( .date_var = visit_end_date_time , .by = \"day\" , visits = mean(length_of_stay, na.rm = TRUE) ) %>% filter_by_time( .date_var = visit_end_date_time , .start_date = \"2012\" , .end_date = \"2019\" ) %>% set_names(\"Date\",\"Values\") ts_alos_plt( .data = df_tbl , .date_col = Date , .value_col = Values , .by = \"month\" , .interactive = FALSE )"},{"path":"https://www.spsanderson.com/healthyR/reference/ts_census_los_daily_tbl.html","id":null,"dir":"Reference","previous_headings":"","what":"Time Series - Census and LOS by Day — ts_census_los_daily_tbl","title":"Time Series - Census and LOS by Day — ts_census_los_daily_tbl","text":"Sometimes important know census given day, average length stay given day, including patients yet discharged. can easily achieved. return one record every account data still need summarized. multiple entries per day records show therefore multiple entries column date resulting tibble. want aggregate able easily. record .start_date_col filled corresponding end_date null end date set equal Sys.Date() record start_date NA discarded. function can take little bit time run join comparison runs.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/ts_census_los_daily_tbl.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Time Series - Census and LOS by Day — ts_census_los_daily_tbl","text":"","code":"ts_census_los_daily_tbl( .data, .keep_nulls_only = FALSE, .start_date_col, .end_date_col, .by_time = \"day\" )"},{"path":"https://www.spsanderson.com/healthyR/reference/ts_census_los_daily_tbl.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Time Series - Census and LOS by Day — ts_census_los_daily_tbl","text":".data data want pass function .keep_nulls_only boolean keep records NULL end date, meaning patient still admitted. default FALSE brings back records. .start_date_col column containing start date record .end_date_col column containing end date record. .by_time want data presented, defaults day remain way unless need granular data.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/ts_census_los_daily_tbl.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Time Series - Census and LOS by Day — ts_census_los_daily_tbl","text":"tibble object","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/ts_census_los_daily_tbl.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Time Series - Census and LOS by Day — ts_census_los_daily_tbl","text":"Requires dataset least start date column end date column Takes single boolean parameter","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/ts_census_los_daily_tbl.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Time Series - Census and LOS by Day — ts_census_los_daily_tbl","text":"Steven P. Sanderson II, MPH","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/ts_census_los_daily_tbl.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Time Series - Census and LOS by Day — ts_census_los_daily_tbl","text":"","code":"library(healthyR) library(healthyR.data) library(dplyr) df <- healthyR_data df_tbl <- df %>% filter(ip_op_flag == \"I\") %>% select(visit_start_date_time, visit_end_date_time) %>% timetk::filter_by_time(.date_var = visit_start_date_time, .start_date = \"2020\") ts_census_los_daily_tbl( .data = df_tbl , .keep_nulls_only = FALSE , .start_date_col = visit_start_date_time , .end_date_col = visit_end_date_time ) #> # A tibble: 45,572 × 5 #> date visit_start_date_time visit_end_date_time los census #> #> 1 2020-01-01 2020-01-01 2020-01-02 1 1 #> 2 2020-01-01 2020-01-01 2020-01-02 1 1 #> 3 2020-01-01 2020-01-01 2020-01-02 1 1 #> 4 2020-01-01 2020-01-01 2020-01-03 2 1 #> 5 2020-01-01 2020-01-01 2020-01-03 2 1 #> 6 2020-01-01 2020-01-01 2020-01-03 2 1 #> 7 2020-01-01 2020-01-01 2020-01-04 3 1 #> 8 2020-01-01 2020-01-01 2020-01-04 3 1 #> 9 2020-01-01 2020-01-01 2020-01-04 3 1 #> 10 2020-01-01 2020-01-01 2020-01-05 4 1 #> # ℹ 45,562 more rows"},{"path":"https://www.spsanderson.com/healthyR/reference/ts_median_excess_plt.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a plot showing the excess of the median value — ts_median_excess_plt","title":"Create a plot showing the excess of the median value — ts_median_excess_plt","text":"Plot excess +/- median value grouped certain time parameters.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/ts_median_excess_plt.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a plot showing the excess of the median value — ts_median_excess_plt","text":"","code":"ts_median_excess_plt( .data, .date_col, .value_col, .x_axis, .ggplot_group_var, .years_back )"},{"path":"https://www.spsanderson.com/healthyR/reference/ts_median_excess_plt.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a plot showing the excess of the median value — ts_median_excess_plt","text":".data data analyzed, data must tibble/data.frame. .date_col column tibble holds date. .value_col column holds value interest. .x_axis x-axis, day, week, etc. .ggplot_group_var variable group ggplot . .years_back many yeas back want go order compute median value.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/ts_median_excess_plt.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create a plot showing the excess of the median value — ts_median_excess_plt","text":"ggplot2 plot","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/ts_median_excess_plt.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Create a plot showing the excess of the median value — ts_median_excess_plt","text":"Supply data want view see excess +/- median values specified time series tibble.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/ts_median_excess_plt.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create a plot showing the excess of the median value — ts_median_excess_plt","text":"","code":"suppressPackageStartupMessages(library(timetk)) ts_signature_tbl( .data = m4_daily , .date_col = date ) %>% ts_median_excess_plt( .date_col = date , .value_col = value , .x_axis = month , .ggplot_group_var = year , .years_back = 1 ) #> pad applied on the interval: day #> Joining with `by = join_by(month)` #> Warning: The `` argument of `guides()` cannot be `FALSE`. Use \"none\" instead as #> of ggplot2 3.3.4. #> ℹ The deprecated feature was likely used in the healthyR package. #> Please report the issue at . #> Warning: Removed 261 rows containing missing values (`geom_line()`)."},{"path":"https://www.spsanderson.com/healthyR/reference/ts_plt.html","id":null,"dir":"Reference","previous_headings":"","what":"Time Series Plot — ts_plt","title":"Time Series Plot — ts_plt","text":"warpper function timetk::plot_time_series() function limited functionality parameter set. see full reference please visit timetk package site.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/ts_plt.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Time Series Plot — ts_plt","text":"","code":"ts_plt( .data, .date_col, .value_col, .color_col = NULL, .facet_col = NULL, .facet_ncol = NULL, .interactive = FALSE )"},{"path":"https://www.spsanderson.com/healthyR/reference/ts_plt.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Time Series Plot — ts_plt","text":".data data pass function, must tibble/data.frame. .date_col column holding date. .value_col column holding value. .color_col column holding variable color. .facet_col column holding variable faceting. .facet_ncol many columns want. .interactive Return plotly plot set TRUE static ggplot2 plot set FALSE. default FALSE.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/ts_plt.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Time Series Plot — ts_plt","text":"plotly plot ggplot2 static plot","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/ts_plt.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Time Series Plot — ts_plt","text":"function takes arguments function presets others choosing defaults others. smoother functionality turned .","code":""},{"path":[]},{"path":"https://www.spsanderson.com/healthyR/reference/ts_plt.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Time Series Plot — ts_plt","text":"Steven P. Sanderson II, MPH","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/ts_plt.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Time Series Plot — ts_plt","text":"","code":"suppressPackageStartupMessages(library(dplyr)) library(timetk) library(healthyR.data) healthyR.data::healthyR_data %>% filter(ip_op_flag == \"I\") %>% select(visit_end_date_time, service_line) %>% filter_by_time( .date_var = visit_end_date_time , .start_date = \"2020\" ) %>% group_by(service_line) %>% summarize_by_time( .date_var = visit_end_date_time , .by = \"month\" , visits = n() ) %>% ungroup() %>% ts_plt( .date_col = visit_end_date_time , .value_col = visits , .color_col = service_line )"},{"path":"https://www.spsanderson.com/healthyR/reference/ts_readmit_rate_plt.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot Readmit Rate — ts_readmit_rate_plt","title":"Plot Readmit Rate — ts_readmit_rate_plt","text":"Plot Readmit Rate","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/ts_readmit_rate_plt.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot Readmit Rate — ts_readmit_rate_plt","text":"","code":"ts_readmit_rate_plt(.data, .date_col, .value_col, .by_grouping, .interactive)"},{"path":"https://www.spsanderson.com/healthyR/reference/ts_readmit_rate_plt.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot Readmit Rate — ts_readmit_rate_plt","text":".data data need pass. .date_col date column. .value_col value column. .by_grouping want data summarized - \"sec\", \"min\", \"hour\", \"day\", \"week\", \"month\", \"quarter\" \"year\". .interactive TRUE FALSE. TRUE returns plotly plot FALSE returns static ggplot2 plot.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/ts_readmit_rate_plt.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot Readmit Rate — ts_readmit_rate_plt","text":"timetk time series plot interactive","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/ts_readmit_rate_plt.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Plot Readmit Rate — ts_readmit_rate_plt","text":"Expects tibble date time column value column Uses timetk underlying sumarization plot .by_grouping missing default \"day\"","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/ts_readmit_rate_plt.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Plot Readmit Rate — ts_readmit_rate_plt","text":"Steven P. Sanderson II, MPH","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/ts_readmit_rate_plt.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot Readmit Rate — ts_readmit_rate_plt","text":"","code":"set.seed(123) suppressPackageStartupMessages(library(timetk)) suppressPackageStartupMessages(library(purrr)) suppressPackageStartupMessages(library(dplyr)) ts_tbl <- tk_make_timeseries( start = \"2019-01-01\" , by = \"day\" , length_out = \"1 year 6 months\" ) values <- arima.sim( model = list( order = c(0, 1, 0)) , n = 547 , mean = 1 , sd = 5 ) df_tbl <- tibble( x = ts_tbl , y = values ) %>% set_names(\"Date\",\"Values\") ts_readmit_rate_plt( .data = df_tbl , .date_col = Date , .value_col = Values , .by = \"month\" , .interactive = FALSE )"},{"path":"https://www.spsanderson.com/healthyR/reference/ts_signature_tbl.html","id":null,"dir":"Reference","previous_headings":"","what":"Make a Time Enhanced Tibble — ts_signature_tbl","title":"Make a Time Enhanced Tibble — ts_signature_tbl","text":"Returns tibble adds time series signature timetk::tk_augment_timeseries_signature() function. added chosen date column defined .date_col parameter.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/ts_signature_tbl.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Make a Time Enhanced Tibble — ts_signature_tbl","text":"","code":"ts_signature_tbl(.data, .date_col, .pad_time = TRUE, ...)"},{"path":"https://www.spsanderson.com/healthyR/reference/ts_signature_tbl.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Make a Time Enhanced Tibble — ts_signature_tbl","text":".data data analyzed. .date_col column holds date. .pad_time Boolean TRUE/FALSE. TRUE timetk::pad_by_time() function called used data.frame modification. default TRUE. ... Grouping variables used dplyr::group_by() using timetk::pad_by_time()","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/ts_signature_tbl.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Make a Time Enhanced Tibble — ts_signature_tbl","text":"tibble","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/ts_signature_tbl.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Make a Time Enhanced Tibble — ts_signature_tbl","text":"Supply data date column add year, month, week, week day hour tibble. original date column kept. Returns time-series signature tibble. must know data going function certain columns dropped kept using functions","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/ts_signature_tbl.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Make a Time Enhanced Tibble — ts_signature_tbl","text":"","code":"library(timetk) ts_signature_tbl( .data = m4_daily , .date_col = date , .pad_time = TRUE , id ) #> pad applied on the interval: day #> # A tibble: 9,743 × 31 #> id date value index.num diff year year.iso half quarter month #> #> 1 D410 1978-06-23 9109. 267408000 NA 1978 1978 1 2 6 #> 2 D410 1978-06-24 9103. 267494400 86400 1978 1978 1 2 6 #> 3 D410 1978-06-25 9116. 267580800 86400 1978 1978 1 2 6 #> 4 D410 1978-06-26 9116. 267667200 86400 1978 1978 1 2 6 #> 5 D410 1978-06-27 9106. 267753600 86400 1978 1978 1 2 6 #> 6 D410 1978-06-28 9094. 267840000 86400 1978 1978 1 2 6 #> 7 D410 1978-06-29 9094. 267926400 86400 1978 1978 1 2 6 #> 8 D410 1978-06-30 9084. 268012800 86400 1978 1978 1 2 6 #> 9 D410 1978-07-01 9081. 268099200 86400 1978 1978 2 3 7 #> 10 D410 1978-07-02 9047. 268185600 86400 1978 1978 2 3 7 #> # ℹ 9,733 more rows #> # ℹ 21 more variables: month.xts , month.lbl , day , hour , #> # minute , second , hour12 , am.pm , wday , #> # wday.xts , wday.lbl , mday , qday , yday , #> # mweek , week , week.iso , week2 , week3 , #> # week4 , mday7 "},{"path":"https://www.spsanderson.com/healthyR/reference/umap_list.html","id":null,"dir":"Reference","previous_headings":"","what":"UMAP Projection — umap_list","title":"UMAP Projection — umap_list","text":"Create umap object uwot::umap() function.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/umap_list.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"UMAP Projection — umap_list","text":"","code":"umap_list(.data, .kmeans_map_tbl, .k_cluster = 5)"},{"path":"https://www.spsanderson.com/healthyR/reference/umap_list.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"UMAP Projection — umap_list","text":".data data kmeans_user_item_tbl() function. .kmeans_map_tbl data kmeans_mapped_tbl(). .k_cluster Pick desired amount clusters analysis scree plot.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/umap_list.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"UMAP Projection — umap_list","text":"list tibbles umap object","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/umap_list.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"UMAP Projection — umap_list","text":"takes user item table/matix produced kmeans_user_item_tbl() function. function uses defaults uwot::umap().","code":""},{"path":[]},{"path":"https://www.spsanderson.com/healthyR/reference/umap_list.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"UMAP Projection — umap_list","text":"Steven P. Sanderson II, MPH","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/umap_list.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"UMAP Projection — umap_list","text":"","code":"library(healthyR.data) library(healthyR) library(dplyr) library(broom) data_tbl <- healthyR_data %>% filter(ip_op_flag == \"I\") %>% filter(payer_grouping != \"Medicare B\") %>% filter(payer_grouping != \"?\") %>% select(service_line, payer_grouping) %>% mutate(record = 1) %>% as_tibble() uit_tbl <- kmeans_user_item_tbl( .data = data_tbl , .row_input = service_line , .col_input = payer_grouping , .record_input = record ) kmm_tbl <- kmeans_mapped_tbl(uit_tbl) umap_list(.data = uit_tbl, kmm_tbl, 3) #> Warning: The `x` argument of `as_tibble.matrix()` must have unique column names if `.name_repair` is omitted as of tibble 2.0.0. #> Using compatibility `.name_repair`. #> This warning is displayed once every 8 hours. #> Call `lifecycle::last_lifecycle_warnings()` to see where this warning was generated. #> Joining, by = \"service_line\" #> $umap_obj #> [,1] [,2] #> [1,] -1.20154126 -1.47929355 #> [2,] -1.85642035 -0.92673132 #> [3,] 2.06673794 0.43277195 #> [4,] 0.50777595 0.88411787 #> [5,] 1.39594083 0.91600016 #> [6,] 2.07423394 0.07035807 #> [7,] -1.58056147 0.54257897 #> [8,] -1.28963168 -0.07908270 #> [9,] 1.64515095 0.56890276 #> [10,] 0.51813190 0.06985691 #> [11,] -1.65750105 -0.38041183 #> [12,] 1.28338330 -0.23311302 #> [13,] -1.14359362 -0.99453851 #> [14,] -1.57960684 0.21351746 #> [15,] 0.07514446 0.57518891 #> [16,] -0.79473717 0.35539225 #> [17,] 1.41217868 0.20038059 #> [18,] -0.87235720 -0.62273332 #> [19,] -1.12270386 0.55439070 #> [20,] 0.89454477 0.56136778 #> [21,] 0.92169182 0.11029461 #> [22,] -1.39727528 -1.20793316 #> [23,] 1.70101528 -0.13128158 #> attr(,\"scaled:center\") #> [1] -3.380066 5.532106 #> #> $umap_results_tbl #> # A tibble: 23 × 3 #> x y service_line #> #> 1 -1.20 -1.48 Alcohol Abuse #> 2 -1.86 -0.927 Bariatric Surgery For Obesity #> 3 2.07 0.433 CHF #> 4 0.508 0.884 COPD #> 5 1.40 0.916 CVA #> 6 2.07 0.0704 Carotid Endarterectomy #> 7 -1.58 0.543 Cellulitis #> 8 -1.29 -0.0791 Chest Pain #> 9 1.65 0.569 GI Hemorrhage #> 10 0.518 0.0699 Joint Replacement #> # … with 13 more rows #> # ℹ Use `print(n = ...)` to see more rows #> #> $kmeans_obj #> K-means clustering with 3 clusters of sizes 6, 12, 5 #> #> Cluster means: #> Blue Cross Commercial Compensation Exchange Plans HMO Medicaid #> 1 0.1170278 0.03141187 0.0101665392 0.013865190 0.09822472 0.08557952 #> 2 0.0783745 0.02182129 0.0043244347 0.006202137 0.04493860 0.03684344 #> 3 0.1495475 0.03679700 0.0003066332 0.020729565 0.16252855 0.13072521 #> Medicaid HMO Medicare A Medicare HMO No Fault Self Pay #> 1 0.14652195 0.3535395 0.10524131 0.007067791 0.031353724 #> 2 0.08001653 0.5625037 0.15152338 0.003475542 0.009976485 #> 3 0.31446157 0.1318675 0.03192357 0.001364577 0.019748398 #> #> Clustering vector: #> [1] 3 3 2 2 2 2 1 1 2 2 3 2 3 1 2 1 2 1 1 2 2 3 2 #> #> Within cluster sum of squares by cluster: #> [1] 0.08456928 0.09625399 0.19152559 #> (between_SS / total_SS = 73.6 %) #> #> Available components: #> #> [1] \"cluster\" \"centers\" \"totss\" \"withinss\" \"tot.withinss\" #> [6] \"betweenss\" \"size\" \"iter\" \"ifault\" #> #> $kmeans_cluster_tbl #> # A tibble: 23 × 2 #> service_line .cluster #> #> 1 Alcohol Abuse 3 #> 2 Bariatric Surgery For Obesity 3 #> 3 CHF 2 #> 4 COPD 2 #> 5 CVA 2 #> 6 Carotid Endarterectomy 2 #> 7 Cellulitis 1 #> 8 Chest Pain 1 #> 9 GI Hemorrhage 2 #> 10 Joint Replacement 2 #> # … with 13 more rows #> # ℹ Use `print(n = ...)` to see more rows #> #> $umap_kmeans_cluster_results_tbl #> # A tibble: 23 × 4 #> x y service_line .cluster #> #> 1 -1.20 -1.48 Alcohol Abuse 3 #> 2 -1.86 -0.927 Bariatric Surgery For Obesity 3 #> 3 2.07 0.433 CHF 2 #> 4 0.508 0.884 COPD 2 #> 5 1.40 0.916 CVA 2 #> 6 2.07 0.0704 Carotid Endarterectomy 2 #> 7 -1.58 0.543 Cellulitis 1 #> 8 -1.29 -0.0791 Chest Pain 1 #> 9 1.65 0.569 GI Hemorrhage 2 #> 10 0.518 0.0699 Joint Replacement 2 #> # … with 13 more rows #> # ℹ Use `print(n = ...)` to see more rows #>"},{"path":"https://www.spsanderson.com/healthyR/reference/umap_plt.html","id":null,"dir":"Reference","previous_headings":"","what":"UMAP and K-Means Cluster Visualization — umap_plt","title":"UMAP and K-Means Cluster Visualization — umap_plt","text":"Create UMAP Projection plot.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/umap_plt.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"UMAP and K-Means Cluster Visualization — umap_plt","text":"","code":"umap_plt(.data, .point_size = 2, .label = TRUE)"},{"path":"https://www.spsanderson.com/healthyR/reference/umap_plt.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"UMAP and K-Means Cluster Visualization — umap_plt","text":".data data umap_list() function. .point_size desired size points plot. .label ggrepel::geom_label_repel() used display cluster user labels.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/umap_plt.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"UMAP and K-Means Cluster Visualization — umap_plt","text":"ggplot2 UMAP Projection clusters represented colors.","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/umap_plt.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"UMAP and K-Means Cluster Visualization — umap_plt","text":"takes umap_kmeans_cluster_results_tbl umap_list() function output.","code":""},{"path":[]},{"path":"https://www.spsanderson.com/healthyR/reference/umap_plt.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"UMAP and K-Means Cluster Visualization — umap_plt","text":"Steven P. Sanderson II, MPH","code":""},{"path":"https://www.spsanderson.com/healthyR/reference/umap_plt.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"UMAP and K-Means Cluster Visualization — umap_plt","text":"","code":"library(healthyR.data) library(healthyR) library(dplyr) library(broom) library(ggplot2) data_tbl <- healthyR_data %>% filter(ip_op_flag == \"I\") %>% filter(payer_grouping != \"Medicare B\") %>% filter(payer_grouping != \"?\") %>% select(service_line, payer_grouping) %>% mutate(record = 1) %>% as_tibble() uit_tbl <- kmeans_user_item_tbl( .data = data_tbl , .row_input = service_line , .col_input = payer_grouping , .record_input = record ) kmm_tbl <- kmeans_mapped_tbl(uit_tbl) ump_lst <- umap_list(.data = uit_tbl, kmm_tbl, 3) #> Joining, by = \"service_line\" umap_plt(.data = ump_lst, .point_size = 3)"},{"path":[]},{"path":"https://www.spsanderson.com/healthyR/news/index.html","id":"healthyr-021","dir":"Changelog","previous_headings":"","what":"healthyR 0.2.1","title":"healthyR 0.2.1","text":"CRAN release: 2023-04-06","code":""},{"path":"https://www.spsanderson.com/healthyR/news/index.html","id":"breaking-changes-0-2-1","dir":"Changelog","previous_headings":"","what":"Breaking Changes","title":"healthyR 0.2.1","text":"Fix #141 - Drop support kmeans functions umap functions moved healthyR.ai Fix #152 - Updated Depends R >= 3.3","code":""},{"path":"https://www.spsanderson.com/healthyR/news/index.html","id":"new-features-0-2-1","dir":"Changelog","previous_headings":"","what":"New Features","title":"healthyR 0.2.1","text":"None","code":""},{"path":"https://www.spsanderson.com/healthyR/news/index.html","id":"minor-fixes-and-improvements-0-2-1","dir":"Changelog","previous_headings":"","what":"Minor Fixes and Improvements","title":"healthyR 0.2.1","text":"None","code":""},{"path":"https://www.spsanderson.com/healthyR/news/index.html","id":"healthyr-020","dir":"Changelog","previous_headings":"","what":"healthyR 0.2.0","title":"healthyR 0.2.0","text":"CRAN release: 2022-07-18","code":""},{"path":"https://www.spsanderson.com/healthyR/news/index.html","id":"breaking-changes-0-2-0","dir":"Changelog","previous_headings":"","what":"Breaking Changes","title":"healthyR 0.2.0","text":"None","code":""},{"path":"https://www.spsanderson.com/healthyR/news/index.html","id":"new-features-0-2-0","dir":"Changelog","previous_headings":"","what":"New Features","title":"healthyR 0.2.0","text":"Fix #139 - Add functions color_blind() hr_scale_fill_colorblind() hr_scale_color_colorblind() Fix #138 - Add parameter gartner_magic_chart_plt() function order size points accoring column data.frame/tibble.","code":""},{"path":"https://www.spsanderson.com/healthyR/news/index.html","id":"minor-fixes-and-improvements-0-2-0","dir":"Changelog","previous_headings":"","what":"Minor Fixes and Improvements","title":"healthyR 0.2.0","text":"None","code":""},{"path":"https://www.spsanderson.com/healthyR/news/index.html","id":"healthyr-019","dir":"Changelog","previous_headings":"","what":"healthyR 0.1.9","title":"healthyR 0.1.9","text":"CRAN release: 2022-04-25","code":""},{"path":"https://www.spsanderson.com/healthyR/news/index.html","id":"breaking-changes-0-1-9","dir":"Changelog","previous_headings":"","what":"Breaking Changes","title":"healthyR 0.1.9","text":"None","code":""},{"path":"https://www.spsanderson.com/healthyR/news/index.html","id":"new-features-0-1-9","dir":"Changelog","previous_headings":"","what":"New Features","title":"healthyR 0.1.9","text":"None","code":""},{"path":"https://www.spsanderson.com/healthyR/news/index.html","id":"minor-fixes-and-improvements-0-1-9","dir":"Changelog","previous_headings":"","what":"Minor Fixes and Improvements","title":"healthyR 0.1.9","text":"Fix #129 - Default ggplot2::theme_minimal() plots.","code":""},{"path":"https://www.spsanderson.com/healthyR/news/index.html","id":"healthyr-018","dir":"Changelog","previous_headings":"","what":"healthyR 0.1.8","title":"healthyR 0.1.8","text":"CRAN release: 2022-02-27","code":""},{"path":"https://www.spsanderson.com/healthyR/news/index.html","id":"breaking-changes-0-1-8","dir":"Changelog","previous_headings":"","what":"Breaking Changes","title":"healthyR 0.1.8","text":"None","code":""},{"path":"https://www.spsanderson.com/healthyR/news/index.html","id":"new-features-0-1-8","dir":"Changelog","previous_headings":"","what":"New Features","title":"healthyR 0.1.8","text":"None","code":""},{"path":"https://www.spsanderson.com/healthyR/news/index.html","id":"minor-fixes-and-improvements-0-1-8","dir":"Changelog","previous_headings":"","what":"Minor Fixes and Improvements","title":"healthyR 0.1.8","text":"Fix #116 - Drop need cli, crayon, rstudioapi F-x #105 - correct code make minor updates ts_census_los_daily_tbl()","code":""},{"path":"https://www.spsanderson.com/healthyR/news/index.html","id":"healthyr-017","dir":"Changelog","previous_headings":"","what":"healthyR 0.1.7","title":"healthyR 0.1.7","text":"CRAN release: 2022-01-05","code":""},{"path":"https://www.spsanderson.com/healthyR/news/index.html","id":"breaking-changes-0-1-7","dir":"Changelog","previous_headings":"","what":"Breaking Changes","title":"healthyR 0.1.7","text":"None","code":""},{"path":"https://www.spsanderson.com/healthyR/news/index.html","id":"new-features-0-1-7","dir":"Changelog","previous_headings":"","what":"New Features","title":"healthyR 0.1.7","text":"Fix #107 - Add service_line_vec() Fix #108 - Add service_line_augment()","code":""},{"path":"https://www.spsanderson.com/healthyR/news/index.html","id":"minor-fixes-and-improvements-0-1-7","dir":"Changelog","previous_headings":"","what":"Minor Fixes and Improvements","title":"healthyR 0.1.7","text":"None","code":""},{"path":"https://www.spsanderson.com/healthyR/news/index.html","id":"healthyr-016","dir":"Changelog","previous_headings":"","what":"healthyR 0.1.6","title":"healthyR 0.1.6","text":"CRAN release: 2021-08-20","code":""},{"path":"https://www.spsanderson.com/healthyR/news/index.html","id":"breaking-changes-0-1-6","dir":"Changelog","previous_headings":"","what":"Breaking Changes","title":"healthyR 0.1.6","text":"None","code":""},{"path":"https://www.spsanderson.com/healthyR/news/index.html","id":"new-features-0-1-6","dir":"Changelog","previous_headings":"","what":"New Features","title":"healthyR 0.1.6","text":"Fix #92 - Add diverging_lollipop_plt Fix #93 - Add diverging_bar_plt","code":""},{"path":"https://www.spsanderson.com/healthyR/news/index.html","id":"minor-fixes-and-improvements-0-1-6","dir":"Changelog","previous_headings":"","what":"Minor Fixes and Improvements","title":"healthyR 0.1.6","text":"Fix #90 - Add startup message library attachment.","code":""},{"path":"https://www.spsanderson.com/healthyR/news/index.html","id":"healthyr-015","dir":"Changelog","previous_headings":"","what":"healthyR 0.1.5","title":"healthyR 0.1.5","text":"CRAN release: 2021-06-22","code":""},{"path":"https://www.spsanderson.com/healthyR/news/index.html","id":"breaking-changes-0-1-5","dir":"Changelog","previous_headings":"","what":"Breaking Changes","title":"healthyR 0.1.5","text":"Fix #70 - ts_ymwdh_tbl() renamed ts_signature_tbl()","code":""},{"path":"https://www.spsanderson.com/healthyR/news/index.html","id":"new-features-0-1-5","dir":"Changelog","previous_headings":"","what":"New Features","title":"healthyR 0.1.5","text":"Fix #70 - Add timetk::tk_augment_time_series_signature() tibble gets returned. Fix #59 - Add boolean ts_signature_tbl() timetk::pad_by_time() functionality. Fix #55 - Add uwot::umap() functionality umap_list(). Fix #56 - Add umap_plt() functionality plot UMAP Projection K-Means cluster assignments.","code":""},{"path":"https://www.spsanderson.com/healthyR/news/index.html","id":"minor-fixes-and-improvments-0-1-5","dir":"Changelog","previous_headings":"","what":"Minor Fixes and Improvments","title":"healthyR 0.1.5","text":"Fix #76 - Require user select column aggregated normalized kmeans_user_item_tbl() function. Fix #62 - Add lifecycle project.","code":""},{"path":"https://www.spsanderson.com/healthyR/news/index.html","id":"healthyr-014","dir":"Changelog","previous_headings":"","what":"healthyR 0.1.4","title":"healthyR 0.1.4","text":"CRAN release: 2021-06-13","code":""},{"path":"https://www.spsanderson.com/healthyR/news/index.html","id":"breaking-changes-0-1-4","dir":"Changelog","previous_headings":"","what":"Breaking Changes","title":"healthyR 0.1.4","text":"None","code":""},{"path":"https://www.spsanderson.com/healthyR/news/index.html","id":"new-features-0-1-4","dir":"Changelog","previous_headings":"","what":"New Features","title":"healthyR 0.1.4","text":"Added Functions kmeans_tidy_tbl() Fix #40 - broom style function get tidy, augment glance kmeans_obj() output kmeans_scree_data_tbl() Fix #41 - Creates tibble data underlies kmeans_scree_plot() kmeans_scree_plt() Fix #42 - ggplot2 plot Scree data help find optimal elbow. Otherwise known elbow plot. kmeans_mapped_tbl() - Fix #43 - generates data help create elbow ploat data. maps kmeans_obj() function across stated amount centers. default set 15.","code":""},{"path":"https://www.spsanderson.com/healthyR/news/index.html","id":"minor-fixes-and-improvments-0-1-4","dir":"Changelog","previous_headings":"","what":"Minor Fixes and Improvments","title":"healthyR 0.1.4","text":"Fix #45 - drop .row_col parameter kmeans_tidy_tbl() function needed, saves user needing remember selected user column.","code":""},{"path":"https://www.spsanderson.com/healthyR/news/index.html","id":"healthyr-013","dir":"Changelog","previous_headings":"","what":"healthyR 0.1.3","title":"healthyR 0.1.3","text":"CRAN release: 2021-06-03","code":""},{"path":"https://www.spsanderson.com/healthyR/news/index.html","id":"breaking-changes-0-1-3","dir":"Changelog","previous_headings":"","what":"Breaking Changes","title":"healthyR 0.1.3","text":"None","code":""},{"path":"https://www.spsanderson.com/healthyR/news/index.html","id":"new-features-0-1-3","dir":"Changelog","previous_headings":"","what":"New Features","title":"healthyR 0.1.3","text":"Added functions kmeans_user_item_tbl() Fix #37 - Creates user item tibble preprocessed data. kmeans_obj() Fix #37 - Creates stats kmeans object, simple wrapper.","code":""},{"path":"https://www.spsanderson.com/healthyR/news/index.html","id":"minor-fixes-and-improvments-0-1-3","dir":"Changelog","previous_headings":"","what":"Minor Fixes and Improvments","title":"healthyR 0.1.3","text":"Minor fixes improvements ts_census_los_daily_tbl() Fix #37 - Correctly arranges date gets correct counts date column.","code":""},{"path":"https://www.spsanderson.com/healthyR/news/index.html","id":"healthyr-0-1-3","dir":"Changelog","previous_headings":"","what":"healthyR 0.1.2","title":"healthyR 0.1.3","text":"Add function ts_census_los_daily_tbl - Can get census length stay given just two columns data, admit/arrival date discharge/departure date","code":""},{"path":"https://www.spsanderson.com/healthyR/news/index.html","id":"healthyr-0-1-3-1","dir":"Changelog","previous_headings":"","what":"healthyR 0.1.1","title":"healthyR 0.1.3","text":"Add function(s) category_counts_tbl - Get counts specified column user specified grouping provided named_item_list - Good saving tibble many groups different sheets excel file top_n_tbl - Good getting tibble n records column selection ts_census_los_daily_tbl - Can compute alos census data given simply Admit Date Discharge Date (discharge date can null). Sometimes want see average length stay patients currently admitted","code":""},{"path":"https://www.spsanderson.com/healthyR/news/index.html","id":"healthyr-0-1-3-2","dir":"Changelog","previous_headings":"","what":"healthyR 0.1.0","title":"healthyR 0.1.3","text":"Released CRAN 12-03-2020","code":""},{"path":"https://www.spsanderson.com/healthyR/news/index.html","id":"healthyr-0-1-3-3","dir":"Changelog","previous_headings":"","what":"healthyR 0.0.0.9006","title":"healthyR 0.1.3","text":"Add data files dx_cc_mapping px_cc_mapping Added fucntion(s) save_to_excel() los_ra_index_summary_tbl los_ra_index_plt","code":""},{"path":"https://www.spsanderson.com/healthyR/news/index.html","id":"healthyr-0-1-3-4","dir":"Changelog","previous_headings":"","what":"healthyR 0.0.0.9005","title":"healthyR 0.1.3","text":"Add parameters gartner magic chart interior lables","code":""},{"path":"https://www.spsanderson.com/healthyR/news/index.html","id":"healthyr-0-1-3-5","dir":"Changelog","previous_headings":"","what":"healthyR 0.0.0.9004","title":"healthyR 0.1.3","text":"Update sql substring ike functions","code":""},{"path":"https://www.spsanderson.com/healthyR/news/index.html","id":"healthyr-0-1-3-6","dir":"Changelog","previous_headings":"","what":"healthyR 0.0.0.9003","title":"healthyR 0.1.3","text":"Added plt_gartner_magic_chart()","code":""},{"path":"https://www.spsanderson.com/healthyR/news/index.html","id":"healthyr-0-1-3-7","dir":"Changelog","previous_headings":"","what":"healthyR 0.0.0.9002","title":"healthyR 0.1.3","text":"Added function opt_bin()","code":""},{"path":"https://www.spsanderson.com/healthyR/news/index.html","id":"healthyr-0-1-3-8","dir":"Changelog","previous_headings":"","what":"healthyR 0.0.0.9001","title":"healthyR 0.1.3","text":"Added function ts_ymwdh_tbl()","code":""},{"path":"https://www.spsanderson.com/healthyR/news/index.html","id":"healthyr-0-1-3-9","dir":"Changelog","previous_headings":"","what":"healthyR 0.0.0.9000","title":"healthyR 0.1.3","text":"Added NEWS.md file track changes package.","code":""}] diff --git a/pkgdown/favicon/apple-touch-icon-120x120.png b/pkgdown/favicon/apple-touch-icon-120x120.png new file mode 100644 index 0000000..b73e9d0 Binary files /dev/null and b/pkgdown/favicon/apple-touch-icon-120x120.png differ diff --git a/pkgdown/favicon/apple-touch-icon-152x152.png b/pkgdown/favicon/apple-touch-icon-152x152.png new file mode 100644 index 0000000..3b9bef2 Binary files /dev/null and b/pkgdown/favicon/apple-touch-icon-152x152.png differ diff --git a/pkgdown/favicon/apple-touch-icon-180x180.png b/pkgdown/favicon/apple-touch-icon-180x180.png new file mode 100644 index 0000000..b9053fb Binary files /dev/null and b/pkgdown/favicon/apple-touch-icon-180x180.png differ diff --git a/pkgdown/favicon/apple-touch-icon-60x60.png b/pkgdown/favicon/apple-touch-icon-60x60.png new file mode 100644 index 0000000..d6db546 Binary files /dev/null and b/pkgdown/favicon/apple-touch-icon-60x60.png differ diff --git a/pkgdown/favicon/apple-touch-icon-76x76.png b/pkgdown/favicon/apple-touch-icon-76x76.png new file mode 100644 index 0000000..8c68956 Binary files /dev/null and b/pkgdown/favicon/apple-touch-icon-76x76.png differ diff --git a/pkgdown/favicon/apple-touch-icon.png b/pkgdown/favicon/apple-touch-icon.png new file mode 100644 index 0000000..a632d41 Binary files /dev/null and b/pkgdown/favicon/apple-touch-icon.png differ diff --git a/pkgdown/favicon/favicon-16x16.png b/pkgdown/favicon/favicon-16x16.png new file mode 100644 index 0000000..b986688 Binary files /dev/null and b/pkgdown/favicon/favicon-16x16.png differ diff --git a/pkgdown/favicon/favicon-32x32.png b/pkgdown/favicon/favicon-32x32.png new file mode 100644 index 0000000..8f35647 Binary files /dev/null and b/pkgdown/favicon/favicon-32x32.png differ diff --git a/pkgdown/favicon/favicon.ico b/pkgdown/favicon/favicon.ico new file mode 100644 index 0000000..d135d6f Binary files /dev/null and b/pkgdown/favicon/favicon.ico differ