| Title: | Bayesian Early-Warning Risk Surveillance for Healthcare Performance Monitoring |
|---|---|
| Description: | Provides Bayesian early-warning surveillance methods for monitoring healthcare performance and patient safety outcomes. The package draws on risk-adjusted monitoring frameworks developed by Steiner et al. (2000) <doi:10.1093/biostatistics/1.4.441>, Spiegelhalter et al. (2003) <doi:10.1002/sim.1546>, Cook et al. (2011) <doi:10.1136/bmjqs.2008.031831>, and Neuburger et al. (2017) <doi:10.1136/bmjqs-2016-005511>. The package implements Bayesian predictive modelling, risk-adjusted monitoring, early-warning signal detection, and graphical tools for continuous quality improvement and healthcare performance assessment. |
| Authors: | Muhammad Zahir Khan [aut, cre] |
| Maintainer: | Muhammad Zahir Khan <[email protected]> |
| License: | GPL-3 |
| Version: | 0.1.1 |
| Built: | 2026-06-24 13:23:06 UTC |
| Source: | https://github.com/cran/bewrs |
Computes the Bayesian Dynamic Early-Warning Risk Score using current posterior underperformance probability, persistence, and deterioration.
compute_dynamic_bewrs( up, persistence, deterioration, alpha = 0, beta_up = 1, beta_persistence = 1, beta_deterioration = 1 )compute_dynamic_bewrs( up, persistence, deterioration, alpha = 0, beta_up = 1, beta_persistence = 1, beta_deterioration = 1 )
up |
Numeric vector of posterior underperformance probabilities. |
persistence |
Numeric vector measuring persistence of elevated risk. |
deterioration |
Numeric vector measuring recent deterioration. |
alpha |
Intercept parameter. |
beta_up |
Coefficient for logit-transformed posterior risk. |
beta_persistence |
Coefficient for persistence. |
beta_deterioration |
Coefficient for deterioration. |
Numeric vector of Dynamic BEWRS probabilities.
compute_dynamic_bewrs( up = c(0.2, 0.5, 0.8), persistence = c(0.1, 0.4, 0.7), deterioration = c(0.0, 0.1, 0.2) )compute_dynamic_bewrs( up = c(0.2, 0.5, 0.8), persistence = c(0.1, 0.4, 0.7), deterioration = c(0.0, 0.1, 0.2) )
Computes the Expected Value of Intervention (EVI) as the reduction in expected loss from no action to the selected intervention.
compute_evi(loss_no_action, loss_intervention)compute_evi(loss_no_action, loss_intervention)
loss_no_action |
Numeric vector of expected loss under no action. |
loss_intervention |
Numeric vector of expected loss under intervention. |
Numeric vector of EVI values.
compute_evi(c(10, 5, 2), c(7, 4, 3))compute_evi(c(10, 5, 2), c(7, 4, 3))
Selects the intervention with the lowest expected loss.
optimal_intervention(loss_matrix)optimal_intervention(loss_matrix)
loss_matrix |
Numeric matrix or data.frame of expected losses. Rows represent observational units and columns represent intervention options. |
A data.frame containing optimal action and minimum expected loss.
losses <- data.frame( no_action = c(10, 5, 2), monitor = c(8, 4, 3), review = c(7, 6, 4) ) optimal_intervention(losses)losses <- data.frame( no_action = c(10, 5, 2), monitor = c(8, 4, 3), review = c(7, 6, 4) ) optimal_intervention(losses)
Plot calibration curve
plot_calibration(observed, predicted, groups = 10)plot_calibration(observed, predicted, groups = 10)
observed |
Binary observed outcome, coded 0/1. |
predicted |
Predicted probabilities. |
groups |
Number of quantile groups. |
A ggplot object.
Plot risk group event rates
plot_risk_groups(observed, risk_group)plot_risk_groups(observed, risk_group)
observed |
Binary observed outcome, coded 0/1. |
risk_group |
Ordered risk group factor. |
A ggplot object.
Classifies risk probabilities into Low, Watchlist, High, and Critical groups.
risk_stratify(risk, cutoffs = c(0.25, 0.5, 0.75))risk_stratify(risk, cutoffs = c(0.25, 0.5, 0.75))
risk |
Numeric vector of predicted risk probabilities. |
cutoffs |
Numeric vector of three cutoffs. Default is c(0.25, 0.50, 0.75). |
Ordered factor of risk categories.
risk_stratify(c(0.1, 0.4, 0.6, 0.9))risk_stratify(c(0.1, 0.4, 0.6, 0.9))
Computes AUC, Brier score, calibration intercept, and calibration slope.
validate_bewrs(observed, predicted)validate_bewrs(observed, predicted)
observed |
Binary vector of observed outcomes, coded 0/1. |
predicted |
Numeric vector of predicted probabilities. |
A data.frame containing validation metrics.
validate_bewrs(c(0, 1, 1, 0), c(0.1, 0.8, 0.7, 0.3))validate_bewrs(c(0, 1, 1, 0), c(0.1, 0.8, 0.7, 0.3))