# Thread: probability of D given 2 positive tests for D

1. ## probability of D given 2 positive tests for D

I'm trying to "teach myself" stats from a book (Dekking et al. A modern introduction to probability and Statistics)...and I'm trying to do the
exercises that have answers provided @ the end of the book. Although the answer is provided to the following question, I can't get there on my own.
Here it is:

You are diagnosed with an uncommon disease. You know that there only is a 1% chance of getting it. Use the letter D for the event "you have the disease" and T for "the test says so." It is known that the test is imperfect: P(T|D) = 0.98 and P(Tc|Dc) = 0.95.

a. Given that you test positive, what is the probability that you really have the disease.

b. you obtain a 2nd opinion. an independent repetition of the test. You test positive again. Given this, what is the probability that you
really have the disease? The "unconscious" way to do this is to replace P(D) by the answer you found in part a and then perform the
calculation from a again. If you do it the conscientious way, you try to compute P(D|S$\displaystyle \cap$T), where S is the event
"the second test says you have the disease". You will find that you need the independence assumption P(S$\displaystyle \cap$T|D) = P(S|D)P(T|D) and a similar one for Dc.

Note that I can't figure out how to type the superscript "C" for complement...so I'm using c.

I was able to determine part a correctly.
my difficulty is with part b.

Specifically, I know that I'm not setting the problem up correctly, but I'm not sure where I'm going wrong.

e.g.
I want to find P(D|S$\displaystyle \cap$T), right?

(equation 1): P(D|S$\displaystyle \cap$T) = P(D$\displaystyle \cap$(S$\displaystyle \cap$T)) / (P(S$\displaystyle \cap$T)) <== I'm pretty sure this is right

We know the following (some of this was determined in part a).
P(D) = 0.01
P(T) ~ 0.0593 <== determined in part a
P(T|D) = 0.98
P(Tc|Dc) = 0.95
P(D|T) ~ 0.165 <== determined in part a

I *think* the denominator in equation 1 (P(S$\displaystyle \cap$T)) should be 0.0593*0.0593 because the events are independent and equal, but I'm not sure about this.
Is this a correct assumption?

P(S$\displaystyle \cap$T|D) = P(S|D)P(T|D) = P(D$\displaystyle \cap$(S$\displaystyle \cap$T)) / P(D) <== this is given as a hint in the question.
we know (I think) that P(S|D) = P(T|D) = 0.98 (see above).
we also know that P(D) = 0.01 (above).
therefore P(D$\displaystyle \cap$(S$\displaystyle \cap$T)) = 0.98 * 0.98 * 0.01 <= this is presumably the numerator of equation 1

Therefore P(D|S$\displaystyle \cap$T) = (0.98 * 0.98 * 0.01) / (0.0593 * 0.0593)
unfortunately, this turns out to be a # that is > 1, which raises a big red flag in my book.

The book says the answer is 0.795

Where am I going wrong (and thank you for any insight)?

2. Hello,

Originally Posted by pdanese
e.g.
I want to find P(D|S$\displaystyle \cap$T), right?

(equation 1): P(D|S$\displaystyle \cap$T) = P(D$\displaystyle \cap$(S$\displaystyle \cap$T)) / (P(S$\displaystyle \cap$T)) <== I'm pretty sure this is right

I *think* the denominator in equation 1 (P(S$\displaystyle \cap$T)) should be 0.0593*0.0593 because the events are independent and equal, but I'm not sure about this.
Is this a correct assumption?
Yes it is

P(S$\displaystyle \cap$T|D) = P(S|D)P(T|D) = P(D$\displaystyle \cap$(S$\displaystyle \cap$T)) / P(D) <== this is given as a hint in the question.
Stop here

Ok, this is true. But you have no clue what P(D$\displaystyle \cap$(S$\displaystyle \cap$T)) is.

So far, you have two equations :

P(D|S$\displaystyle \cap$T) = P(D$\displaystyle \cap$(S$\displaystyle \cap$T)) / (P(S$\displaystyle \cap$T))

P(S|D)P(T|D) = P(D$\displaystyle \cap$(S$\displaystyle \cap$T)) / P(D)

From the second equation, you have :
P(D$\displaystyle \cap$(S$\displaystyle \cap$T))=P(D)P(S|D)P(T|D)

By replacing in the first equation (the green one), you get :

$\displaystyle \boxed{P(D|S \cap T)=\frac{P(D) \cdot P(S|D) \cdot P(T|D)}{P(S \cap T)}}$

we know (I think) that P(S|D) = P(T|D) = 0.98 (see above).
we also know that P(D) = 0.01 (above).
Correct.

It's a bit messy because I tried to quote what you did so that you can see the reasoning, but you should be able to conclude with all of that

3. ## Re: probability of D given 2 positive tests for D

Hate to bump up a really old thread, but I am having the exact same problem as the OP, 5 years later. Moo's answer gives the same exact answer the OP was getting.

(.98)^2 (.01) / (.0593)^2 > 1 , so it doesn't make sense.

4. ## Re: probability of D given 2 positive tests for D

Returning to what was originally known:
$\displaystyle P(T^c|D^c) = 0.95$
From this, we get:
$\displaystyle P(T|D^c) = 1-P(T^c|D^c) = 0.05$

Then, moving on to the problem, we are given the following independence formulas:
\displaystyle \begin{align*}P(S\cap T|D) & = P(S|D)P(T|D) \\ P(S\cap T|D^c) & = P(S|D^c)P(T|D^c)\end{align*}

Along with the known formulas:
\displaystyle \begin{align*}P(S\cap T|D) & = \dfrac{P(D\cap (S\cap T))}{P(D)} \\ P(S\cap T|D^c) & = \dfrac{P(D^c\cap (S\cap T))}{P(D^c)} \end{align*}

From these equations, we determine:
$\displaystyle P(D\cap (S\cap T)) = P(D)P(S|D)P(T|D)$ and $\displaystyle P(D^c\cap (S\cap T)) = P(D^c)P(S|D^c)P(T|D^c)$

Since $\displaystyle P(S\cap T) = P(D\cap (S\cap T)) + P(D^c\cap (S\cap T))$ we have:

\displaystyle \begin{align*}P(D|(S\cap T)) & = \dfrac{P(D\cap (S\cap T))}{P(S\cap T)} \\ & = \dfrac{P(D\cap (S\cap T))}{P(D\cap (S\cap T)) + P(D^c\cap (S\cap T))} \\ & = \dfrac{P(D)P(S|D)P(T|D)}{P(D)P(S|D)P(T|D) + P(D^c)P(S|D^c)P(T|D^c)} \\ & = \dfrac{(0.01)(0.98)(0.98)}{(0.01)(0.98)(0.98) + (0.99)(0.05)(0.05)} \\ & \approx 0.795\end{align*}

5. ## Re: probability of D given 2 positive tests for D

The test results are dependent upon whether or not the individual actually has the disease. So, the test outcome is a dependent event, not an independent one. You can only use the formula $\displaystyle P(S\cap T) = P(S)P(T)$ when $\displaystyle S,T$ are independent events.