Source: https://guthlabs.ai/docs/instruments/sensitivity-specificity-ppv-npv-calculator/mechanism/

instrument mechanism / verified-clean

# Sensitivity/Specificity/PPV/NPV Calculator mechanism

The inspectable method record for Sensitivity/Specificity/PPV/NPV Calculator, kept separate from implementation and qualification.

Status: **VERIFIED_CLEAN**Lifecycle: **verified-clean**

## Model scope

The core five listed expressions are standard under the stated unit assumptions. The specification needs an explicit input mode, denominator/error policy, LR− formula, and positive/negative post-test probability formulas before it can be treated as complete.

- The listed formulas correctly define sensitivity, specificity, PPV, NPV, and LR+ for a diagnostic 2x2 table, assuming all denominators are nonzero.

- The output claims likelihood ratios plural, but only LR+ is specified; the standard LR− formula is missing: LR−=(1−Sensitivity)/Specificity.

- Post-test probability formulas are missing. For a positive result, post-test probability equals PPV when calculated from the same table; from prevalence, sensitivity, and specificity it is (prevalence×sensitivity)/[(prevalence×sensitivity)+((1−prevalence)×(1−specificity))]. For a negative result, it is NPV, calculated from prevalence as ((1−prevalence)×specificity)/[((1−prevalence)×specificity)+(prevalence×(1−sensitivity))].

- The input specification is ambiguous because it permits either TP/FP/FN/TN counts or prevalence+sensitivity+specificity, but does not define how outputs are calculated or labeled for each input mode.

## Units and conventions

- TP, FP, FN, and TN are nonnegative integer counts of mutually exclusive and collectively exhaustive outcomes.

- Sensitivity, specificity, and prevalence are proportions from 0 to 1; percentage inputs such as 90% must be converted to 0.90 before calculation.

- All four 2x2 cells must refer to the same population, test threshold, and time frame.

- For count inputs, prevalence is assumed to be (TP+FN)/(TP+FP+FN+TN).

- Ratios and probabilities are dimensionless; counts must not be mixed with percentages or fractions without explicit conversion.

## Inspectable vector

One of 4 source-bound review vectors:

````
{
  "inputs": {
    "TP": 80,
    "FP": 100,
    "FN": 20,
    "TN": 900
  },
  "expected_outputs": {
    "sensitivity": 0.8,
    "specificity": 0.9,
    "PPV": 0.4444444444,
    "NPV": 0.9782608696,
    "LR+": 8,
    "LR-": 0.2222222222,
    "prevalence": 0.0909090909,
    "post_test_probability_positive": 0.4444444444,
    "post_test_probability_negative": 0.9782608696
  },
  "working": "Total=80+100+20+900=1100. Sensitivity=80/(80+20)=80/100=0.80. Specificity=900/(900+100)=900/1000=0.90. PPV=80/(80+100)=80/180=0.4444444444. NPV=900/(900+20)=900/920=0.9782608696. LR+=0.80/(1−0.90)=0.80/0.10=8. LR−=(1−0.80)/0.90=0.20/0.90=0.2222222222. Prevalence=(80+20)/1100=100/1100=0.0909090909. Positive post-test probability=PPV=0.4444444444. Negative post-test probability=NPV=0.9782608696."
}
````

## Failure boundary

**BREAK_CLAIMED** · SELF_FLAGGED

The specification permits zero-count tables and ambiguous prevalence input without stating denominator guards or an explicit percent-versus-fraction convention. Zero denominators produce undefined sensitivity, PPV, and LR+, while interpreting prevalence 5 as a fraction produces invalid probabilities above 1.

## Other records

[01**Overview**](<https://guthlabs.ai/docs/instruments/sensitivity-specificity-ppv-npv-calculator/>)[03**Implementation**](<https://guthlabs.ai/docs/instruments/sensitivity-specificity-ppv-npv-calculator/implementation/>)[04**Qualification**](<https://guthlabs.ai/docs/instruments/sensitivity-specificity-ppv-npv-calculator/qualification/>)

## Sources and evidence

These pointers bind the page to evidence. They do not grant authority or collapse verification into deployment.

- `VERIFIED_LEDGER.json`

- `evidence-tranche5/tranche5-results.json`

- `BOUNDARY_HAZARD_CATALOG.json`
