Skip to main content

Welcome to a Grasp lesson

Create a free account to keep studying and create your own study path.

Lesson 43

Calculating PPV and FDR from Sensitivity, Specificity, and Prevalence

Recommended resources

In our last lesson, we explored how to update our beliefs using Bayes' theorem, discovering that the probability of a hypothesis being true after seeing evidence is critically dependent on the initial prior probability. We saw this in action with our relationship neglect scenario, where a low prevalence of the issue led to a surprisingly low posterior probability, even with a sensitive test.

Today, we will formalize these ideas. The concepts you are interested in — Positive Predictive Value (PPV) and False Discovery Rate (FDR) — are the standard metrics used to quantify the very effect we calculated. This lesson will define these terms and show how to compute them using sensitivity, specificity, and prevalence. You will see that PPV is precisely the Bayesian posterior probability we worked with previously, now given a standard name in the context of diagnostic testing and classification models.

From Bayesian Posteriors to Standard Metrics

In diagnostic or classification settings, we often frame Bayes' theorem using a standard 2x2 confusion matrix format, which tallies four possible outcomes of a test:

Condition Present Condition Absent
Test Positive True Positive (TP) False Positive (FP)
Test Negative False Negative (FN) True Negative (TN)

Using these terms, we can define the key metrics for evaluating a test's performance.

Positive Predictive Value (PPV)

The Positive Predictive Value (PPV) answers the question: "If the test result is positive, what is the probability that the individual actually has the condition?" This is exactly the posterior probability we calculated in the last lesson.

The formal definition of PPV is the proportion of positive test results that are actually true positives.

Diagnostic Testing Accuracy: Sensitivity, Specificity, Predictive ...

This document from the NCBI StatPearls collection provides clear, standard definitions for diagnostic test metrics. Please read the section that defines PPV.

Focus on the subsection titled "PPV and NPV." Read the definition and formula for Positive Predictive Value. Note its interpretation as the proportion of true positives among all positive findings.

As the reading states, the formula for PPV is:

False Discovery Rate (FDR)

The False Discovery Rate (FDR) is the logical complement to PPV. It answers the question: "If the test result is positive, what is the probability that it is a false alarm?" FDR represents the proportion of positive results that are incorrect.

You can see immediately that PPV and FDR are directly related:

An FDR of 10% means that 10% of your "discoveries" (positive tests) are false, and consequently, 90% are true (PPV = 90%).


Calculating PPV and FDR from Core Parameters

The learning outcome requires calculating PPV and FDR from three fundamental parameters:

  1. Prevalence (P): The prior probability that the condition is present in the population, .
  2. Sensitivity (): The True Positive Rate, or the probability of a positive test given the condition is present, .
  3. Specificity (): The True Negative Rate, or the probability of a negative test given the condition is absent, . The False Positive Rate is simply .

To calculate PPV, we express TP and FP in terms of these parameters. For a population of size :

Substituting these into the PPV formula gives:

This is precisely the expanded form of Bayes' theorem we used in the previous lesson. Now let's apply it to our scenarios using this formal terminology.



Application 1: Bra-Fit Screening Tool

Let's revisit your bra-fitting questionnaire. We'll use the same numbers but calculate PPV and FDR explicitly.

Parameters:

  • Prevalence (P): 80% of clients wear the wrong size. .
  • Sensitivity (): The questionnaire correctly identifies 90% of those wearing the wrong size. .
  • Specificity (): The questionnaire correctly identifies 85% of those wearing the correct size (since the false positive rate was 15%). .

Calculation:

Let's calculate the components of PPV.

  • The numerator (proportional to TP): .
  • The first part of the denominator is the same: .
  • The second part of the denominator (proportional to FP): .

Now, we can find the PPV:

And the FDR is simply its complement:

Interpretation:
The Positive Predictive Value of your questionnaire is 96%. This means that when a client's test comes back positive, you can be 96% certain they are indeed wearing a poorly fitting bra. The False Discovery Rate is only 4%, indicating a very low rate of false alarms among the positive results.



Application 2: Relationship Neglect Signal

Now for the imbalanced case of the relationship neglect signal. This is where FDR becomes particularly revealing.

Parameters:

  • Prevalence (P): A neglect issue occurs in only 5% of weeks. .
  • Sensitivity (): The system detects 95% of real issues. .
  • Specificity (): The system correctly gives no signal in 90% of weeks without issues (false positive rate was 10%). .

Calculation:

Let's compute the components.

  • Numerator (proportional to TP): .
  • Denominator part 1: .
  • Denominator part 2 (proportional to FP): .

Now, we calculate the PPV:

And the corresponding FDR:

Interpretation:
The PPV is only 33.3%. This confirms our finding from last lesson: a warning signal indicates only a one-in-three chance of a genuine neglect issue. The FDR is a staggering 66.7%. This means that two-thirds of all "discoveries" or warnings generated by the system are false alarms. This is the "false positive paradox" expressed as a standard metric, highlighting the danger of misinterpreting positive signals when the underlying condition is rare.


Visualizing the Impact of Prevalence

Using frequency trees and tables can make the relationship between prevalence and PPV/FDR very intuitive.

This decision tree illustrates the flow of a screening test applied to 10,000 people. It starts with the base prevalence and branches out based on the test's sensitivity and specificity to arrive at the final counts of true positives, false negatives, true negatives, and false positives.

Let's use the numbers from the diagram above to calculate PPV and FDR directly from the counts:

  • True Positives (TP) = 450
  • False Positives (FP) = 190
  • Total Positive Tests = TP + FP = 450 + 190 = 640

The following image provides a powerful direct comparison. It shows two scenarios with identical test characteristics (Sensitivity = 90%, Specificity = 90%) but drastically different prevalence rates.

This figure demonstrates how Positive Predictive Value changes dramatically with prevalence. Table A shows that with a 50% prevalence, the PPV is 90%. Table B shows that when prevalence drops to 5%, the PPV plummets to 32.1%, even though the test's sensitivity and specificity remain constant at 90%.

Let's verify the FDR for both cases in this image:

  • Case A (Prevalence = 50%): PPV is 90.0%. Therefore, FDR = 1 - 0.90 = 10%.
  • Case B (Prevalence = 5%): PPV is 32.1%. Therefore, FDR = 1 - 0.321 = 67.9%.

This starkly illustrates the central point: as the condition you are testing for becomes rarer, the reliability of a positive test result degrades significantly, and your rate of false discoveries climbs.


Conclusion

In this lesson, we have formalized the concepts from our introduction to Bayesian inference into the standard diagnostic metrics of Positive Predictive Value (PPV) and False Discovery Rate (FDR). You have seen how these metrics are calculated and how they are fundamentally tied to the prevalence of the condition being tested.

Key Takeaways:

  • PPV is the probability that a positive test result is correct, which is equivalent to the Bayesian posterior probability.
  • FDR is the probability that a positive test result is a false alarm; it is the complement of PPV ().
  • Both metrics can be calculated directly from a test's sensitivity, specificity, and the condition's prevalence.
  • Low prevalence drastically reduces PPV and increases FDR, even for tests with high sensitivity and specificity. This is a critical consideration for any work with imbalanced data.

We've established that a low PPV can be problematic. A natural next question is: can we do anything about it? In our next lesson, we will explore how to adjust the decision threshold of a classification model to intentionally trade off between different types of errors, allowing us to achieve a more desirable balance for a specific application.