0
$\begingroup$

Abbreviate: $D =$ a person is diseased, $+ =$ the test is positive.
Assume: $\Pr(D) = 0.001, \; \Pr(+|D)=0.99, \; \Pr(+|D^C) = 0.01 \qquad ($$\iff$ $ \Pr(-|D^C) = 0.99).$

1. Use Bayes's Theorem: $\Pr(D|+) = 0.0 \; 90 \; 1639... \quad $ (confirmed; scroll down 30% hereof).

2. Quantify the above probabilities for 1000 people (per 1 and 2)
(Table herefrom. Green indicates True results, red False results).

$$\begin{array}{r|cc|c} &D &\lnot D &\text{Total}\\ \hline +&\color{green}{\Pr(D)\Pr(+|D)}&\color{red}{\Pr(D^C)\Pr(+|D^C)}&\text{add the 2 left entries}\\ - &\color{red}{\Pr(D)\Pr(-|D)}&\color{green}{\Pr(D^C)\Pr(-|D^C)}&\color{black}{\text{add the 2 left entries}}\\ \hline \text{Total}&\color{black}{1}&\color{black}{999}&\color{black}{1000} \end{array}$$

$$\begin{array}{r|cc|c} &D &\lnot D &\text{Total}\\ \hline +&\color{green}{1}&\color{red}{9.99}&10.99\\ - &\color{red}{\text{impertinent}}&\color{green}{\text{impertinent}}&\color{black}{\text{impertinent}}\\ \hline \text{Total}&\color{black}{1}&\color{black}{999}&\color{black}{1000} \end{array}$$

$3.$ So $\Pr(D|+) = \dfrac{ \color{green}{1} }{ 10.99 } = 0.0 \; 90 \; 9918... \quad $

Why do 1 and 3 differ starting at the ten-thousandth digit?

$\endgroup$
  • $\begingroup$ Your $9.9$ should be $9.99$. Also, your $1$ should be $0.99$. Too much rounding. $\endgroup$ – André Nicolas Feb 4 '16 at 4:26
  • $\begingroup$ @AndréNicolas I incorporated your first sentence. But why should my $1$ be $0.99$? $\endgroup$ – Greek - Area 51 Proposal Feb 4 '16 at 6:52
  • $\begingroup$ Only $99\%$ of people with the disease test positive. The total $10000$ used by Adriano makes things more clear. $\endgroup$ – André Nicolas Feb 4 '16 at 7:05
  • $\begingroup$ Basically, the "impertinent" is not irrelevant, as it would show where the error lay. $\;$ Since there is a non-zero something in the red "impertinent" cell, the cell above it can not contain $1$. $\;$ It must be $1-\color{red}{\textsf{impertinent}}$. $\endgroup$ – Graham Kemp Feb 4 '16 at 7:33
1
$\begingroup$

As mentioned in the comments, this is due to roundoff error. Try instead using $100000$ people:

$$\begin{array}{r|cc|c} &D &\lnot D &\text{Total}\\ \hline +&\color{green}{99}&\color{red}{999}&1098\\ - &\color{red}{1}&\color{green}{98901}&\color{black}{98902}\\ \hline \text{Total}&\color{black}{100}&\color{black}{99900}&\color{black}{100000} \end{array}$$

So: $$ \Pr[D \mid +] = \frac{99}{1098} = \frac{11}{122} = 0.090163934\ldots $$

$\endgroup$
  • $\begingroup$ Thanks; though I just corrected my OP, I do not see the 'roundoff' error. Why should my $1$ be $0.99$? $\endgroup$ – Greek - Area 51 Proposal Feb 4 '16 at 6:53
  • $\begingroup$ Because that entry in the table has a probability of: $$ \Pr[D \text{ and } +] = \Pr[D] \cdot \Pr[+ \mid D] = (0.001)(0.99) = 0.00099 $$ so multiplying by your total of $1000$ people yields $0.99$. $\endgroup$ – Adriano Feb 4 '16 at 12:05
0
$\begingroup$

Thanks to user 'Adriano' 's answer, I recognised the problem: I neglected to calculate precisely the four numbers in the middle entry which should instead be:

$$\begin{array}{r|cc|c} &D &\lnot D &\text{Total}\\ \hline +&\color{green}{0.99}&\color{red}{9.99}&10.98\\ - &\color{red}{ 0.01 }&\color{green}{989.01}&\color{black}{\text{989.02}}\\ \hline \text{Total}&\color{black}{1}&\color{black}{999}&\color{black}{1000} \end{array}$$

$3.$ So $\Pr(D|+) = \dfrac{ \color{green}{0.99} }{ 10.98 } = 0.0 \; 90 \; 1639344... \quad $

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.