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.

Due to the use of bootstrap sampling within the function, users should set the random number seed before running rm_bin_summary().

Usage

rm_bin_summary(
  data,
  Ps_col,
  outcome_col,
  n_samples = 1000,
  Divisor1 = 5,
  Divisor2 = 5,
  Threshold_1 = 0.9,
  Threshold_2 = 0.99
)

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 (values between 0 and 100).

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.

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).

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.

Author

Nicolas Foss, Ed.D, MS, original paper and code 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 = 5
               )
#> # A tibble: 10 × 19
#>    bin_number  TA_b  TD_b   N_b    EM_b AntiS_b AntiM_b bin_start bin_end
#>         <int> <dbl> <dbl> <dbl>   <dbl>   <dbl>   <dbl>     <dbl>   <dbl>
#>  1          1   429   688  1117 0.616     0.379   0.621   0.00814   0.540
#>  2          2   685   432  1117 0.387     0.629   0.371   0.540     0.699
#>  3          3   842   275  1117 0.246     0.753   0.247   0.699     0.797
#>  4          4   910   207  1117 0.185     0.83    0.17    0.797     0.859
#>  5          5   969   145  1114 0.130     0.881   0.119   0.859     0.900
#>  6          6   714    80   794 0.101     0.913   0.087   0.900     0.926
#>  7          7   746    48   794 0.0605    0.937   0.063   0.926     0.947
#>  8          8   767    27   794 0.0340    0.955   0.045   0.947     0.963
#>  9          9   775    19   794 0.0239    0.97    0.03    0.963     0.978
#> 10         10  1232    10  1242 0.00805   0.988   0.012   0.978     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>