| Title: | Submission Confidence Index Engine |
|---|---|
| Description: | Converts standardized R4SUB (R for Regulatory Submission) evidence into indicator scores, pillar scores, and a Submission Confidence Index (SCI). Provides sensitivity analysis, explainability tables, and decision band classification to answer the question: are we ready for regulatory submission. |
| Authors: | Pawan Rama Mali [aut, cre, cph] (ORCID: <https://orcid.org/0000-0001-7864-5819>) |
| Maintainer: | Pawan Rama Mali <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.1.1 |
| Built: | 2026-05-15 09:41:08 UTC |
| Source: | https://github.com/r4sub/r4subscore |
Classify SCI Value into Decision Band
classify_band(sci_value, bands = sci_config_default()$bands)classify_band(sci_value, bands = sci_config_default()$bands)
sci_value |
Numeric SCI score (0–100). |
bands |
Named list of band boundaries from |
Character band name.
classify_band(92) classify_band(55)classify_band(92) classify_band(55)
Converts each indicator in an evidence table into a numeric score (0–1) using severity-weighted result scoring.
compute_indicator_scores(evidence)compute_indicator_scores(evidence)
evidence |
A validated evidence data.frame (from |
For each evidence row:
result_score = r4subcore::result_to_score(result) (pass=1, warn=0.5, fail=0)
severity_weight = r4subcore::severity_to_weight(severity) (info=0, ..., critical=1)
weighted_score = result_score * (1 - severity_weight)
Rows are grouped by indicator_id and indicator_domain, and the
indicator score is the mean of weighted_score within each group.
A tibble with columns: indicator_id, indicator_name,
indicator_domain, n_evidence, indicator_score.
## Not run: scores <- compute_indicator_scores(evidence) scores ## End(Not run)## Not run: scores <- compute_indicator_scores(evidence) scores ## End(Not run)
Aggregates indicator scores into pillar-level scores (one per domain). Each pillar score is the mean of its indicator scores.
compute_pillar_scores(evidence, config = sci_config_default())compute_pillar_scores(evidence, config = sci_config_default())
evidence |
A validated evidence data.frame. |
config |
An |
A tibble with columns: pillar, pillar_score, n_indicators,
weight.
## Not run: ps <- compute_pillar_scores(evidence) ps ## End(Not run)## Not run: ps <- compute_pillar_scores(evidence) ps ## End(Not run)
Computes the SCI from pillar scores as a weighted sum scaled to 0–100, with decision band classification.
compute_sci(pillar_scores, config = sci_config_default())compute_sci(pillar_scores, config = sci_config_default())
pillar_scores |
A tibble from |
config |
An |
The SCI is computed as:
SCI = round(sum(pillar_score * weight) * 100, 1)
Pillars with NA scores are excluded from both the numerator and the
weight normalization denominator.
A list of class "sci_result" with:
SCI: numeric 0–100
band: character band classification
pillar_scores: the input pillar scores tibble
weights_used: named numeric vector of effective weights
## Not run: ps <- compute_pillar_scores(evidence) result <- compute_sci(ps) result$SCI result$band ## End(Not run)## Not run: ps <- compute_pillar_scores(evidence) result <- compute_sci(ps) result$SCI result$band ## End(Not run)
Print SCI Result
## S3 method for class 'sci_result' print(x, ...)## S3 method for class 'sci_result' print(x, ...)
x |
An |
... |
Ignored. |
Returns a configuration list with default pillar weights, decision bands, and scoring parameters for the Submission Confidence Index.
sci_config_default( pillar_weights = c(quality = 0.35, trace = 0.25, risk = 0.25, usability = 0.15), bands = list(ready = c(85, 100), minor_gaps = c(70, 84), conditional = c(50, 69), high_risk = c(0, 49)) )sci_config_default( pillar_weights = c(quality = 0.35, trace = 0.25, risk = 0.25, usability = 0.15), bands = list(ready = c(85, 100), minor_gaps = c(70, 84), conditional = c(50, 69), high_risk = c(0, 49)) )
pillar_weights |
Named numeric vector of weights for each pillar.
Must sum to 1. Names must be a subset of
|
bands |
Named list of numeric length-2 vectors defining SCI band
boundaries |
A list of class "sci_config" with elements:
pillar_weights, bands.
cfg <- sci_config_default() cfg$pillar_weights cfg$bands # Custom weights (must sum to 1) sci_config_default( pillar_weights = c(quality = 0.40, trace = 0.20, risk = 0.30, usability = 0.10) )cfg <- sci_config_default() cfg$pillar_weights cfg$bands # Custom weights (must sum to 1) sci_config_default( pillar_weights = c(quality = 0.40, trace = 0.20, risk = 0.30, usability = 0.10) )
Identifies which indicators contribute most to SCI loss and provides a breakdown of pillar contributions.
sci_explain(evidence, config = sci_config_default())sci_explain(evidence, config = sci_config_default())
evidence |
A validated evidence data.frame. |
config |
An |
For each indicator, the contribution to SCI loss is:
loss = pillar_weight * (1 - indicator_score) / n_indicators_in_pillar
This gives a sense of how much each indicator drags the SCI down.
Results are sorted by loss descending (worst contributors first).
A list with:
indicator_contributions: tibble of per-indicator loss contributions
pillar_contributions: tibble of per-pillar contributions to SCI
## Not run: expl <- sci_explain(evidence) expl$indicator_contributions expl$pillar_contributions ## End(Not run)## Not run: expl <- sci_explain(evidence) expl$indicator_contributions expl$pillar_contributions ## End(Not run)
Evaluates the stability of the Submission Confidence Index under alternative pillar weight scenarios.
sci_sensitivity_analysis(evidence, weight_grid)sci_sensitivity_analysis(evidence, weight_grid)
evidence |
A validated evidence data.frame. |
weight_grid |
A data.frame where each row is a weight scenario.
Column names must match pillar names ( |
A tibble with one row per scenario, containing:
scenario (row number), the weight columns, SCI, and band.
## Not run: grid <- data.frame( quality = c(0.4, 0.3, 0.25), trace = c(0.2, 0.3, 0.25), risk = c(0.3, 0.2, 0.25), usability = c(0.1, 0.2, 0.25) ) sci_sensitivity_analysis(evidence, grid) ## End(Not run)## Not run: grid <- data.frame( quality = c(0.4, 0.3, 0.25), trace = c(0.2, 0.3, 0.25), risk = c(0.3, 0.2, 0.25), usability = c(0.1, 0.2, 0.25) ) sci_sensitivity_analysis(evidence, grid) ## End(Not run)