The common way to compute Positive Predictive Value (probability of
disease given a positive test (PPV)) and Negative Predictive Value
(probability of no disease given negative test (NPV)) is to use Bayes' rule
with the Sensitivity, Specificity, and Prevalence.
This approach can be overwhelming to non-math types, so this
demonstration goes through the steps of assuming a virtual population, then
filling in a 2x2 table based on the population and given values of
Sensitivity, Specificity, and Prevalence. PPV and NPV are then
computed from this table. This approach is more intuitive to many
people.
The function can be run multiple times with different values of
step
to show the steps in building the table, then rerun with
different values to show how changes in the inputs affect the results.