Baysian probability of false positive COVID-19 test I am wondering what the probability of a false positive COVID-19 test would be in my city. I'm attempting to use Bayes Theorem to calculate this, however I'm getting very different results based on how I formulate the problem.
Here are the probabilities given:

*

*1 in 41 people in my city have COVID.

*The analytical false positive rate of a PCR test is 2 in 1,000

*The proportion of positive tests is 6.8%.

If I ask the probability of not being infected given a positive test, I get 2.9%.
P(Not Infected given Positive test) = P(Positive test given Not Infected) * P(Not Infected) / P(Positive test)
= (.002) * (.976) / (.068)
= 2.9%
However if I ask the probability of being infected given a positive test, I get 36%.
P(Infected given Positive test) =
P(Positive test given Infected) * P(Infected) / P(Positive test)
=(.998) * (.024) / (.068)
=36%
Can you set me straight here? I must be making an error. Given a positive test, I would expect the probabilities of being infected or not infected to sum to 1.
A note on the probabilities given:

*

*1 in 41 people infected is based on a model but should be interpreted as the ratio of infected people in the population as a whole, not necessarily the population being tested. I believe it's fair to use this as the pre-test odds of a person being infected if we know nothing else about them.

*PCR tests are generally described as very specific (i.e., very low false positive rate). Lets assume that of 1000 known covid-free samples, only 2 would return a positive result.

*6.8% test positivity rate is based on the number of tests that come back positive. Note that we are not testing the entire population, and you can assume that the population that receives a test is more likely to have covid than the population at large.

 A: NOTE this answer precedes the OP's note about percentages. This answer assumed:

*

*1/41 is the prior probability of infection in the tested population (not the population as a whole)


*2/1000 is the false negative rate of the PCR test $P(PCR^{-}|Infected)$

I may be confused myself as my calculations do give probabilities summing to 1.

The analytical false positive rate of a PCR test is 2 in 1,000

I assumed you mean false negative rate, right? Otherwise how can you have 2.4% true positives (1/41), 6.8% positive tests but only 0.2% false positives?
Here's my reasoning. First let's set up a simple tree with 100k people (there is some rounding here):
                      100000 people
                           |
                 --------------------
                 |                  | 
              Infected          Not infected 
              P = 1/41           P = 40/41  
               2439                97561
                 |                   |
         -------------          ------------
         |           |          |          |
       PCR+        PCR-        PCR+       PCR-
     P = 0.998   P = 0.002   P = 0.044   P = 0.956
       2434          5         4366       93195

Here P = 0.044 is the false positive rate and comes from 0.068 - (0.998 * 1/41).
And here's the probabilities:
$$
P(inf^{-}|PCR^{+}) = \frac{P(inf^{-}) \cdot P(PCR^{+}|inf^{-})}{P(inf^{-}) \cdot P(PCR^{+}|inf^{-}) + P(inf^{+}) \cdot P(PCR^{+}|inf^{+})} \\
= \frac{(40/41) \cdot 0.044}{(40/41) \cdot 0.044 + (1/41) \cdot 0.998} = 0.638
$$
and
$$
P(inf^{+}|PCR^{+}) = \frac{P(inf^{+}) \cdot P(PCR^{+}|inf^{+})}{P(inf^{-}) \cdot P(PCR^{+}|inf^{-}) + P(inf^{+}) \cdot P(PCR^{+}|inf^{+})} \\
= \frac{(1/41) \cdot 0.998}{(40/41) \cdot 0.044 + (1/41) \cdot 0.998} = 0.362
$$
If I'm correct, your mistake is in using 0.068 as denominator in the Bayes formulas.
A: Your first half of the reasoning seems correct.
$$\begin{array}{}P(\text{not infected | positive}) &=& \frac{P(\text{positive | not infected})\cdot P(\text{not infected})}{P(\text{positive})} \\ &=& \frac{0.002 \cdot 0.976}{0.068} \\ &=& 0.0287
\end{array}$$

However we get strange values when we try to deduce $P(\text{positive | infected})$ from
$$\begin{array}{rcl}P(\text{infected | positive}) &=& \frac{P(\text{positive | infected})\cdot P(\text{ infected})}{P(\text{positive})} \\ 0.9713&=& \frac{? \cdot 0.024}{0.068}  
\end{array}$$
or alternatively from
$$\begin{array}{rcl}
P(\text{pos}) &=& P(\text{pos | $\neg$ inf})\cdot P(\text{$\neg$ inf}) + P(\text{pos |  inf})\cdot P(\text{ inf})\\
0.068 &=& 0.002 \frac{40}{41} + P(\text{pos |  inf}) \frac{1}{41} 
\end{array}$$
or
$$P(\text{pos |  inf}) = 0.068 \cdot 41 - 0.002\cdot 40 = 2.708$$
Which is not possible. Intuitively we can see this more directly... If only 1 in 41 people are sick (2.43 %)then it is strange to find that 6.8% of the tests are positive. The percentage of positive tests is much higher than the people that are sick.
This can be explained in two ways:

*

*The false positive rate is not correct (it should be much higher and somewhere close to this 6.8%).
However, if this is a realistic example about Covid-19 testing then the false positive rate is probably not so high (unless something went very wrong).


*Among the people that are performing tests there are a higher
proportion of sick people (higher than 1 in 41).
If you would know that $P(\text{pos |  $\neg$ inf}) = 0.002$ and $P(\text{pos |  inf}) = 0.998$ then you could deduce the prior $P(\text{$\neg$ inf})$ and $P(\text{inf})$ from
$$\begin{array}{rccccccc}
\underbrace{P(\text{pos})}_{0.068} &=& \underbrace{P(\text{pos | $\neg$ inf})}_{0.002}\cdot P(\text{$\neg$ inf}) + \underbrace{P(\text{pos |  inf})}_{0.998}\cdot \underbrace{P(\text{ inf})}_{1-P(\text{$\neg$ inf})}\\
\end{array}$$
which leads to
$$P(\text{$\neg$ inf}) = \frac{0.998-0.068}{0.996} \approx 0.934$$
and
$$P(\text{$\neg$ inf| pos}) = \frac{0.002 \cdot \frac{0.998-0.068}{0.996}}{0.068} \approx 0.0275 $$
