Skip to contents

Calculates a bin-level summary for the Relative Mortality Metric (RMM) from Napoli et al. (2017) by grouping data into bins based on survival probabilities (Ps) and summarizing outcomes within each bin. This function returns statistics such as total alive, total dead, estimated mortality, anticipated mortality, and confidence intervals for each bin. For more information on the methods used in this function, see as well Schroeder et al. (2019), and Kassar et al. (2016).

The Relative Mortality Metric (RMM) quantifies the performance of a center in comparison to the anticipated mortality based on the TRISS national benchmark. The RMM measures the difference between observed and expected mortality, with a range from -1 to 1.

  • An RMM of 0 indicates that the observed mortality aligns with the expected national benchmark across all acuity levels.

  • An RMM greater than 0 indicates better-than-expected performance, where the center is outperforming the national benchmark.

  • An RMM less than 0 indicates under-performance, where the center’s observed mortality is higher than the expected benchmark.

This metric helps assess how a center's mortality compares to the national standards, guiding quality improvement efforts.rm_bin_summary() utilizes bootstrap sampling to calculate the confidence intervals via the standard error method.

Usage

rm_bin_summary(
  data,
  Ps_col,
  outcome_col,
  group_vars = NULL,
  n_samples = 100,
  Divisor1 = 5,
  Divisor2 = 5,
  Threshold_1 = 0.9,
  Threshold_2 = 0.99,
  seed = NULL
)

Arguments

data

A data frame or tibble containing the data.

Ps_col

The name of the column containing the survival probabilities (Ps). Should be numeric on a scale from 0 to 1.

outcome_col

The name of the column containing the outcome data. It should be binary, with values indicating patient survival. A value of 1 should represent "alive" (survived), while 0 should represent "dead" (did not survive). Ensure the column contains only these two possible values.

group_vars

Optional character vector specifying grouping variables for stratified analysis. If NULL, the calculation is performed on the entire dataset.

n_samples

A numeric value indicating the number of bootstrap samples to take from the data source.

Divisor1

A divisor used for binning the survival probabilities (default is 5).

Divisor2

A second divisor used for binning the survival probabilities (default is 5).

Threshold_1

The first threshold for dividing the survival probabilities (default is 0.9).

Threshold_2

The second threshold for dividing the survival probabilities (default is 0.99).

seed

Optional numeric value to set a random seed for reproducibility. If NULL (default), no seed is set.

Value

A tibble containing bin-level statistics including:

  • bin_number: The bin to which each record was assigned.

  • TA_b: Total alive in each bin (number of patients who survived).

  • TD_b: Total dead in each bin (number of patients who did not survive).

  • N_b: Total number of patients in each bin.

  • EM_b: Estimated mortality rate for each bin (TD_b / (TA_b + TD_b)).

  • AntiS_b: The anticipated survival rate for each bin.

  • AntiM_b: The anticipated mortality rate for each bin.

  • bin_start: The lower bound of the survival probability range for each bin.

  • bin_end: The upper bound of the survival probability range for each bin.

  • midpoint: The midpoint of the bin range (calculated as (bin_start + bin_end) / 2).

  • R_b: The width of each bin (bin_end - bin_start).

  • population_RMM_LL: The lower bound of the 95% confidence interval for the population RMM.

  • population_RMM: The final calculated Relative Mortality Metric for the population existing in data.

  • population_RMM_UL: The upper bound of the 95% confidence interval for the population RMM.

  • population_CI: The confidence interval width for the population RMM.

  • bootstrap_RMM_LL: The lower bound of the 95% confidence interval for the bootstrap RMM.

  • bootstrap_RMM: The average RMM value calculated for the bootstrap sample.

  • bootstrap_RMM_UL: The upper bound of the 95% confidence interval for the bootstrap RMM.

  • bootstrap_CI: The width of the 95% confidence interval for the bootstrap RMM.

Details

Like other statistical computing functions, rm_bin_summary() is happiest without missing data. It is best to pass complete probability of survival and outcome data to the function for optimal performance. With smaller datasets, this is especially helpful. However, rm_bin_summary() will handle NA values and throw a warning about missing probability of survival values, if any exist in Ps_col.

Due to the use of bootstrap sampling within the function, users should consider setting the random number seed within rm_bin_summary() using the seed argument for reproducibility.

References

Kassar, O.M., Eklund, E.A., Barnhardt, W.F., Napoli, N.J., Barnes, L.E., Young, J.S. (2016). Trauma survival margin analysis: A dissection of trauma center performance through initial lactate. The American Surgeon, 82(7), 649-653. doi:10.1177/000313481608200733

Napoli, N. J., Barnhardt, W., Kotoriy, M. E., Young, J. S., & Barnes, L. E. (2017). Relative mortality analysis: A new tool to evaluate clinical performance in trauma centers. IISE Transactions on Healthcare Systems Engineering, 7(3), 181–191. doi:10.1080/24725579.2017.1325948

Schroeder, P. H., Napoli, N. J., Barnhardt, W. F., Barnes, L. E., & Young, J. S. (2018). Relative mortality analysis of the “golden hour”: A comprehensive acuity stratification approach to address disagreement in current literature. Prehospital Emergency Care, 23(2), 254–262. doi:10.1080/10903127.2018.1489021

See also

Author

Nicolas Foss, Ed.D, MS, original implementation in MATLAB by Nicholas J. Napoli, Ph.D., MS

Examples

# Generate example data with high negative skewness
set.seed(10232015)

# Parameters
n_patients <- 10000  # Total number of patients

Ps <- plogis(rnorm(n_patients, mean = 2,
                    sd = 1.5)
                    )  # Skewed towards higher values

# Simulate survival outcomes based on Ps
survival_outcomes <- rbinom(n_patients,
                            size = 1,
                            prob = Ps
                            )

# Create data frame
data <- data.frame(Ps = Ps, survival = survival_outcomes) |>
dplyr::mutate(death = dplyr::if_else(survival == 1, 0, 1))

# Example usage of the `rm_bin_summary` function
rm_bin_summary(data = data, Ps_col = Ps,
               outcome_col = survival,
               n_samples = 10,
               Divisor1 = 4,
               Divisor2 = 4
               )
#> # A tibble: 9 × 19
#>   bin_number  TA_b  TD_b   N_b    EM_b AntiS_b AntiM_b bin_start bin_end
#>        <int> <int> <int> <int>   <dbl>   <dbl>   <dbl>     <dbl>   <dbl>
#> 1          1   565   832  1397 0.596     0.417   0.583   0.00814   0.592
#> 2          2   969   427  1396 0.306     0.681   0.319   0.592     0.756
#> 3          3  1096   300  1396 0.215     0.804   0.196   0.756     0.846
#> 4          4  1206   188  1394 0.135     0.875   0.125   0.846     0.900
#> 5          5   898    94   992 0.0948    0.916   0.084   0.900     0.932
#> 6          6   945    47   992 0.0474    0.944   0.056   0.932     0.955
#> 7          7   961    31   992 0.0312    0.965   0.035   0.955     0.974
#> 8          8   983     9   992 0.00907   0.982   0.018   0.974     0.990
#> 9          9   446     3   449 0.00668   0.994   0.006   0.990     1.00 
#> # ℹ 10 more variables: midpoint <dbl>, R_b <dbl>, population_RMM_LL <dbl>,
#> #   population_RMM <dbl>, population_RMM_UL <dbl>, population_CI <dbl>,
#> #   bootstrap_RMM_LL <dbl>, bootstrap_RMM <dbl>, bootstrap_RMM_UL <dbl>,
#> #   bootstrap_CI <dbl>

# Create example grouping variable (e.g., hospital)
hospital <- sample(c("Hospital A", "Hospital B"), n_patients, replace = TRUE)

# Create data frame
data <- data.frame(Ps = Ps,
                  survival = survival_outcomes,
                  hospital = hospital
                  ) |>
  dplyr::mutate(death = dplyr::if_else(survival == 1, 0, 1))

# Example usage of the `rm_bin_summary` function with grouping
rm_bin_summary(
  data = data,
  Ps_col = Ps,
  outcome_col = survival,
  group_vars = "hospital", # Stratifies by hospital
  n_samples = 10,
  Divisor1 = 4,
  Divisor2 = 4
)
#> # A tibble: 18 × 20
#>    hospital   bin_number  TA_b  TD_b   N_b    EM_b AntiS_b AntiM_b bin_start
#>    <chr>           <int> <int> <int> <int>   <dbl>   <dbl>   <dbl>     <dbl>
#>  1 Hospital A          1   296   428   724 0.591     0.417   0.583   0.00814
#>  2 Hospital A          2   488   201   689 0.292     0.682   0.318   0.592  
#>  3 Hospital A          3   558   150   708 0.212     0.804   0.196   0.756  
#>  4 Hospital A          4   591    88   679 0.130     0.876   0.124   0.846  
#>  5 Hospital A          5   441    52   493 0.105     0.916   0.084   0.900  
#>  6 Hospital A          6   471    20   491 0.0407    0.944   0.056   0.932  
#>  7 Hospital A          7   471    20   491 0.0407    0.964   0.036   0.955  
#>  8 Hospital A          8   505     5   510 0.00980   0.982   0.018   0.974  
#>  9 Hospital A          9   229     2   231 0.00866   0.994   0.006   0.990  
#> 10 Hospital B          1   269   404   673 0.600     0.416   0.584   0.00814
#> 11 Hospital B          2   481   226   707 0.320     0.68    0.32    0.592  
#> 12 Hospital B          3   538   150   688 0.218     0.805   0.195   0.756  
#> 13 Hospital B          4   615   100   715 0.140     0.875   0.125   0.846  
#> 14 Hospital B          5   457    42   499 0.0842    0.917   0.083   0.900  
#> 15 Hospital B          6   474    27   501 0.0539    0.944   0.056   0.932  
#> 16 Hospital B          7   490    11   501 0.0220    0.965   0.035   0.955  
#> 17 Hospital B          8   478     4   482 0.00830   0.983   0.017   0.974  
#> 18 Hospital B          9   217     1   218 0.00459   0.994   0.006   0.990  
#> # ℹ 11 more variables: bin_end <dbl>, midpoint <dbl>, R_b <dbl>,
#> #   population_RMM_LL <dbl>, population_RMM <dbl>, population_RMM_UL <dbl>,
#> #   population_CI <dbl>, bootstrap_RMM_LL <dbl>, bootstrap_RMM <dbl>,
#> #   bootstrap_RMM_UL <dbl>, bootstrap_CI <dbl>