A test detects a condition 99% of the time and falsely flags 1% of healthy people.
You test positive. Intuition says 99%. The answer is 50%. The gap between those two
numbers is the bars below: how many people already had it before you were tested.
The population
What a positive result is worth
has it, tested positivehas it, tested negativedoesn't have it, tested positivedoesn't have it, tested negative
The same statement, with the numbers in it
The denominator is the part everyone drops:
P(E) = 0.99·0.01 + 0.01·0.99 = 0.0198
— the chance of a positive result from any cause, not just the condition.
Fine tune
Specificity 99% means 1% of healthy people are flagged anyway.