Calculates the Relative Mortality Metric (RMM) from Napoli et al. (2017) based on patient survival probabilities (Ps) and actual outcomes. The function groups patients into bins based on their survival probability scores (Ps) and computes a weighted mortality metric along with confidence intervals. 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. rmm()
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 rmm()
.
Usage
rmm(
data,
Ps_col,
outcome_col,
n_samples = 1000,
Divisor1 = 5,
Divisor2 = 5,
Threshold_1 = 0.9,
Threshold_2 = 0.99,
pivot = FALSE
)
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), while0
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).
- pivot
A logical indicating whether to return the results in a long format (pivot = TRUE) or wide format (pivot = FALSE, default).
Value
A tibble containing the Relative Mortality Metric (RMM) and related statistics:
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 indata
.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.If
pivot = TRUE
, the results will be in long format with two columns:stat
andvalue
, where each row corresponds to one of the calculated statistics.If
pivot = FALSE
(default), the results will be returned in wide format, with each statistic as a separate column.
Examples
# Generate example data with high negative skewness
set.seed(10232015)
# Parameters
n_patients <- 1000 # Total number of patients
# Skewed towards higher values
Ps <- plogis(rnorm(n_patients, mean = 2, sd = 1.5))
# 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 `rmm` function
rmm(data = data, Ps_col = Ps,
outcome_col = survival,
Divisor1 = 5,
Divisor2 = 5,
n_samples = 5
)
#> # A tibble: 1 × 8
#> population_RMM_LL population_RMM population_RMM_UL population_CI
#> <dbl> <dbl> <dbl> <dbl>
#> 1 -0.334 -0.0823 0.170 0.252
#> # ℹ 4 more variables: bootstrap_RMM_LL <dbl>, bootstrap_RMM <dbl>,
#> # bootstrap_RMM_UL <dbl>, bootstrap_CI <dbl>
# pivot!
rmm(data = data, Ps_col = Ps,
outcome_col = survival,
Divisor1 = 5,
Divisor2 = 5,
n_samples = 5,
pivot = TRUE
)
#> # A tibble: 8 × 2
#> stat value
#> <chr> <dbl>
#> 1 population_RMM_LL -0.334
#> 2 population_RMM -0.0823
#> 3 population_RMM_UL 0.170
#> 4 population_CI 0.252
#> 5 bootstrap_RMM_LL -0.155
#> 6 bootstrap_RMM -0.0866
#> 7 bootstrap_RMM_UL -0.0185
#> 8 bootstrap_CI 0.0682