| Type: | Package |
| Title: | Cyber-Resilient Bayesian Healthcare Surveillance Framework |
| Version: | 0.1.0 |
| Description: | Provides methods for healthcare performance surveillance using Bayesian risk estimation, latent organisational trust modelling, cyber-resilience assessment, external validation, decision-theoretic optimisation, and digital-twin deployment simulation. The package supports prospective deterioration monitoring, uncertainty-aware risk assessment, intervention prioritisation, ablation analysis, and operational evaluation for healthcare performance management and health system resilience research. The methodological framework is informed by contemporary guidance on prediction model development and validation (Efthimiou et al., 2024 <doi:10.1136/bmj-2023-078276>), transparent reporting of prediction models (Collins et al., 2024 <doi:10.1136/bmj-2023-078378>), and decision-analytic model evaluation (Vickers and Elkin, 2006 <doi:10.1177/0272989X06295361>). |
| License: | MIT + file LICENSE |
| Encoding: | UTF-8 |
| RoxygenNote: | 7.3.3 |
| URL: | https://github.com/zerish12/CRBHSF |
| BugReports: | https://github.com/zerish12/CRBHSF/issues |
| Depends: | R (≥ 4.1.0) |
| Imports: | dplyr, ggplot2, pROC, purrr, tibble |
| Suggests: | testthat (≥ 3.0.0), knitr, rmarkdown |
| Config/testthat/edition: | 3 |
| NeedsCompilation: | no |
| Packaged: | 2026-06-20 14:26:28 UTC; muhammadzahirkhan |
| Author: | Muhammad Zahir Khan [aut, cre], Abdul Wahid Khan [aut] |
| Maintainer: | Muhammad Zahir Khan <zahirstat007@gmail.com> |
| Repository: | CRAN |
| Date/Publication: | 2026-06-24 09:50:27 UTC |
Clean healthcare surveillance data
Description
Clean healthcare surveillance data
Usage
clean_health_data(data, provider_col, time_col)
Arguments
data |
A data frame. |
provider_col |
Character string giving the column name. |
time_col |
Character string giving the column name. |
Value
A cleaned data.frame containing standardized health-service performance variables. The output typically includes harmonized provider identifiers, time-period variables, numeric performance measures, and derived fields required for CRBHSF risk estimation. Each row represents one provider-period observation.
Compare simple machine-learning benchmarks
Description
Compare simple machine-learning benchmarks
Usage
compare_ml_benchmarks(data, outcome_col, predictor_cols)
Arguments
data |
A data frame. |
outcome_col |
Character string giving the column name. |
predictor_cols |
Character vector of predictor column names. |
Value
A data.frame or list containing benchmark results comparing CRBHSF with conventional machine-learning models. The output includes model names and performance metrics such as AUC, sensitivity, specificity, accuracy, and/or Brier score, depending on the supplied inputs. These results summarise relative predictive performance across competing methods.
Compute CRBHSF risk score
Description
Compute CRBHSF risk score
Usage
compute_crbhsf_risk(
data,
bayes_risk_col = "risk_bayes",
trust_col = "latent_trust",
lambda = 0.2
)
Arguments
data |
A data frame. |
bayes_risk_col |
Character string giving the column name. |
trust_col |
Character string giving the column name. |
lambda |
Numeric parameter. |
Value
A data.frame containing the original observations with additional CRBHSF risk-score columns. The returned risk values represent estimated future deterioration or breach risk after incorporating performance pressure, operational pressure, and cyber/data-reliability adjustment components.
Compute Cyber-Resilience Pressure Ratio
Description
Compute Cyber-Resilience Pressure Ratio
Usage
compute_crpr(data, bayes_risk_col = "risk_bayes", trust_col = "latent_trust")
Arguments
data |
A data frame. |
bayes_risk_col |
Character string giving the column name. |
trust_col |
Character string giving the column name. |
Value
A numeric vector or data.frame containing cyber-resilience pressure ratio/index values. Larger values indicate greater cyber or data-integrity pressure relative to the observed operational context and may be used as an input to CRBHSF risk scoring.
Create future deterioration outcome
Description
Create future deterioration outcome
Usage
create_deterioration_outcome(
data,
provider_col,
time_col,
value_col,
threshold = 1
)
Arguments
data |
A data frame. |
provider_col |
Character string giving the column name. |
time_col |
Character string giving the column name. |
value_col |
Character string giving the column name. |
threshold |
Numeric parameter. |
Value
A data.frame containing the input data with an added binary deterioration outcome column. The new outcome indicates whether a provider experienced future deterioration or target breach according to the specified threshold and forecasting horizon.
Estimate expected value of intervention benefit
Description
Estimate expected value of intervention benefit
Usage
estimate_evib(
data,
risk_col = "risk_crbhsf",
review_cost = 1,
miss_cost = 10,
threshold = 0.5
)
Arguments
data |
A data frame. |
risk_col |
Character string giving the column name. |
review_cost |
Numeric parameter. |
miss_cost |
Numeric parameter. |
threshold |
Numeric parameter. |
Value
A data.frame containing expected value of information or expected value of intervention benefit estimates for each observation or decision unit. The output typically includes baseline risk, intervention-adjusted risk, expected loss, expected benefit, and recommended action variables.
Estimate latent organisational trust
Description
Estimate latent organisational trust
Usage
estimate_latent_trust(
data,
anomaly_col = NULL,
corruption_col = NULL,
cyber_col = NULL,
missing_col = NULL,
delay_col = NULL
)
Arguments
data |
A data frame. |
anomaly_col |
Character string giving the column name. |
corruption_col |
Character string giving the column name. |
cyber_col |
Character string giving the column name. |
missing_col |
Character string giving the column name. |
delay_col |
Character string giving the column name. |
Value
An object containing the function output. The exact structure depends on the inputs and analysis requested, but typically contains CRBHSF risk, performance, decision, or diagnostic summaries suitable for downstream analysis.
Fit lightweight Bayesian surveillance model
Description
Fit lightweight Bayesian surveillance model
Usage
fit_bayesian_surveillance(data, y_col, n_col, alpha0 = 2, beta0 = 2)
Arguments
data |
A data frame. |
y_col |
Character string giving the column name. |
n_col |
Character string giving the column name. |
alpha0 |
Numeric parameter. |
beta0 |
Numeric parameter. |
Value
An object containing the function output. The exact structure depends on the inputs and analysis requested, but typically contains CRBHSF risk, performance, decision, or diagnostic summaries suitable for downstream analysis.
Generate simple surveillance report
Description
Generate simple surveillance report
Usage
generate_surveillance_report(validation_results, deployment_results = NULL)
Arguments
validation_results |
Validation results returned by validate_surveillance(). |
deployment_results |
Optional deployment results returned by simulate_digital_twin(). |
Value
An object containing the function output. The exact structure depends on the inputs and analysis requested, but typically contains CRBHSF risk, performance, decision, or diagnostic summaries suitable for downstream analysis.
Plot ablation AUC
Description
Plot ablation AUC
Usage
plot_ablation_auc(ablation_results)
Arguments
ablation_results |
Function argument. |
Value
A ggplot object showing the requested CRBHSF diagnostic, performance, risk, or intervention summary. The plot can be printed, modified, or saved using standard ggplot2 functions.
Plot digital-twin deployment impact
Description
Plot digital-twin deployment impact
Usage
plot_deployment_impact(deployment_results)
Arguments
deployment_results |
Optional deployment results returned by simulate_digital_twin(). |
Value
A ggplot object showing the requested CRBHSF diagnostic, performance, risk, or intervention summary. The plot can be printed, modified, or saved using standard ggplot2 functions.
Plot risk distribution
Description
Plot risk distribution
Usage
plot_risk_distribution(data, risk_col = "risk_crbhsf")
Arguments
data |
A data frame. |
risk_col |
Character string giving the column name. |
Value
A ggplot object showing the requested CRBHSF diagnostic, performance, risk, or intervention summary. The plot can be printed, modified, or saved using standard ggplot2 functions.
Run CRBHSF ablation study
Description
Evaluates the incremental predictive contribution of multiple surveillance risk scores by calculating validation metrics for each score against a common binary outcome.
Usage
run_ablation_study(
data,
outcome_col,
score_cols = c("risk_bayes", "latent_trust", "crpr", "risk_crbhsf")
)
Arguments
data |
A data frame containing the outcome and score columns. |
outcome_col |
Character string giving the binary outcome column. |
score_cols |
Character vector giving the surveillance score columns
to evaluate. Defaults to |
Value
A tibble containing validation metrics for each score column, including sample size, event count, event rate, AUC, and Brier score.
Simulate digital-twin deployment
Description
Simulate digital-twin deployment
Usage
simulate_digital_twin(
data,
outcome_col,
score_col,
capacity = 0.1,
intervention_effect = 0.6,
miss_cost = 15,
review_cost = 1
)
Arguments
data |
A data frame containing outcome and score columns. |
outcome_col |
Character string giving the binary deterioration outcome column. |
score_col |
Character string giving the risk score column used for prioritisation. |
capacity |
Proportion of observations selected for review. |
intervention_effect |
Proportion of reviewed deterioration events assumed preventable. |
miss_cost |
Cost assigned to a missed deterioration event. |
review_cost |
Cost assigned to each review. |
Value
A tibble summarising reviews, prevented deteriorations, losses, and loss reduction.
Validate surveillance score
Description
Validate surveillance score
Usage
validate_surveillance(data, outcome_col, score_col)
Arguments
data |
A data frame containing the outcome and score columns. |
outcome_col |
Character string giving the binary outcome column. |
score_col |
Character string giving the risk score column. |
Value
A tibble containing sample size, event count, event rate, AUC, and Brier score.