Siemensueqw

2022-11-21

Bayes' Theorem in Conditional Probability
We are testing for a disease D that we think is present, D+, with probability 0.4, and absent, D-, with probability 0.6. We believe that a test has sensitivity $P\left\{T+|D+\right\}=0.75$ and specificity $P\left\{T-|D-\right\}=0.8$.
Q1: What is our probability that the disease is present if we perform the test and it is positive, T+, and our probability the disease is absent if that test is negative, T-?
My ans:
We can apply Bayes' formula to calculate $P\left\{D+|T+\right\}$ and $P\left\{D-|T-\right\}$.
$P\left\{D+|T+\right\}=5/7$
$P\left\{D-|T-\right\}=24/29$
Q2: Suppose we perform three tests, conditionally independent given D. Given each possible number of positive test results, 0, 1, 2, or 3, what is our probability that the disease is present?
My ans:
Let k denote the number of positive test results.
We know that P{ [exactly] k successes in n trials | p } $=\left(nCk\right)x\left({p}^{k}\right)×\left(\left(1-p{\right)}^{n-k}\right)$, hence we can calculate .
We can then apply Bayes' formula to calculate $P\left\{D+|k=0\right\}$.
$P\left\{D+|k=0\right\}=0.692$
Using the same approach for $k=1:3$, we derive:
$P\left\{D+|k=1\right\}=0.5$
$P\left\{D+|k=2\right\}=0.308$
$P\left\{D+|k=3\right\}=0.165$
Would really appreciate it if someone can verify whether my reasoning and answers are correct.

Neil Short

Step 1
Consider any k of the n tests show +ve results. The probability of the tests showing $k+ve$ results for any random person is

where p represents the sensitivity and q represents the specificity of the test.
Now, the probability that the chosen person has the disease given that k of n tests showed up positive is

Step 2
You can now enter $n=3$ and $k=0,1,2,3$ to get the required answers:

which also follow the expected trend.

Do you have a similar question?