View source: R/data-tbl-los-ra-index.R
los_ra_index_summary_tbl | R Documentation |
Create the length of stay and readmit index summary tibble
los_ra_index_summary_tbl(
.data,
.max_los = 15,
.alos_col,
.elos_col,
.readmit_rate,
.readmit_bench
)
.data |
The data you are going to analyze. |
.max_los |
You can give a maximum LOS value. Lets say you typically do not see los over 15 days, you would then set .max_los to 15 and all values greater than .max_los will be grouped to .max_los |
.alos_col |
The Average Length of Stay column |
.elos_col |
The Expected Length of Stay column |
.readmit_rate |
The Actual Readmit Rate column |
.readmit_bench |
The Expected Readmit Rate column |
Expects a tibble
Expects the following columns and there should only be these 4
Length Of Stay Actual - Should be an integer
Length Of Stacy Benchmark - Should be an integer
Readmit Rate Actual - Should be 0/1 for each record, 1 = readmitted, 0 did not.
Readmit Rate Benchmark - Should be a percentage from the benchmark file.
This will add a column called visits that will be the count of records per length of stay from 1 to .max_los
The .max_los param can be left blank and the function will default to 15. If
this is not a good default and you don't know what it should be then set it to
75 percentile from the stats::quantile()
function using the defaults, like so
.max_los = stats::quantile(data_tbl$alos)[[4]]
Uses all data to compute variance, if you want it for a particular time frame
you will have to filter the data that goes into the .data argument. It is
suggested to use timetk::filter_by_time()
The index is computed as the excess of the length of stay or readmit rates over their respective expectations.
A tibble
Steven P. Sanderson II, MPH
Other Data Table Functions:
category_counts_tbl()
,
named_item_list()
,
top_n_tbl()
,
ts_census_los_daily_tbl()
,
ts_signature_tbl()
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
)
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
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.