Sensitivity and specificity of a repeated test

1.5k Views Asked by At

Consider the following situation.

There is an epidemic and a person has probability $0.01$ of having the disease. The authorities decide to test the population, but the test is not completely reliable. The sensitivity of the test is $0.98$ and its specificity is $0.95$. Given that Patrick was tested positive for the disease, what is the probability that Patrick has the disease?

In drawing up a simple probability tree, one can arrive at the answer of $0.165$.

However, it is the next part that stumps me.

Patrick wants a second opinion, so he does an independent repetition of the test (regardless of Patrick's disease status, outcomes of the tests are independent). In the second test, he was tested positive again. What is the probability that Patrick has the disease?

I thought that since the tests are independent, it is like he never went for the first test, so the answer should still be $0.165$.

However, the correct answer is $0.795$.

I am not sure how to approach the second part of the question. If, say, I wish to use a probability tree again, how would I do it this time?

3

There are 3 best solutions below

4
On BEST ANSWER

It is precisely because they are independent that the probabilities can change.

Consider the most extremely dependent case for contrast: the second opinion is not really a second opinion, but just a new person telling Patrick the same results. Then Patrick doesn't really have any new information, which means the probabilities are unchanged.

Look at the following composite test: Take the original test and a second, identical but independent, test and consider the composite test as positive iff both tests come back positive. What is the specificity of this new test? It's $1-(1-0.95)(1-0.95)=0.9975$. And what's the sensitivity? It's $0.98\cdot0.98=0.9604$. This is, in effect, the test that Patrick has done, and it has come back positive. That new, higher specificity greatly increases his chances of being sick compared to what a positive result in the original test did.

0
On

You could solve it without figuring out the sensitivity and specificity of the repeated test. Just multiply pre-test odds 0.01/(1-0.01) with the squared likelihood ratio (19.6) you will get 3.88 as the post-test odds. The squaring of the likelihood ratio is due to doing two tests in succession. Then just convert odds to probability: P = 3.88/(1+3.88) = 0.795

0
On

Another way to see it is with Bayes Theorem.

Calling $D$ the disease and $T$ the test, the probability of having the disease given a positive test (also called Positive Predictive Value, PPV) is $$ \mathrm{PPV} = P(D^+|T^+) = \frac{\mathbf{Se} \cdot \mathbf{Pr}}{ \mathbf{Se} \cdot \mathbf{Pr} + (1 - \mathbf{Sp}) (1 - \mathbf{Pr}) } $$

where $\mathbf{Se}$ and $\mathbf{Sp}$ are respectively Sensitivity and Specificity and $\mathbf{Pr}$ is the prior probability (NB: if $\mathbf{Pr}$ is the prevalence in a sample, PPV simply reduces to $\frac{\mathrm{TP}}{\mathrm{TP} + \mathrm{FP}}$; you can verify it substituting $\mathbf{Pr} = \frac{\mathrm{P}}{\mathrm{P}+\mathrm{N}} = \frac{\mathrm{TP}+\mathrm{FN}}{\mathrm{TP}+\mathrm{FN}+\mathrm{TN}+\mathrm{FP}}$).

This is because, with Bayes

$$ P(D^+|T^+) = \frac{ P(T^+|D^+) P(D^+)}{ P(T^+) } $$

$P(T^+|D^+)$ is the Sensitivity $\mathbf{Se}$ because it is the probability of a positive test given the disease, i.e. $\frac{\mathrm{TP}}{\mathrm{TP}+\mathrm{FN}}$ (True Positive Rate, TPR, the $y$ axis in a ROC curve).

$P(D^+)$ is the prior probability of having the disease so $P(D^+)=\mathbf{Pr}$.

$P(T^+)$ is the overall probability of having a positive test, so $P(T^+)=P(T^+|D^+)P(D^+)+P(T^+|D^-)P(D^-)$. We already know that $P(T^+|D^+)=\mathbf{Se}$ and $P(T^+|D^-)$ is obviously $1-\mathbf{Sp}$ because it is the probability of a positive test given the absence of disease (False Positive Rate, FPR, i.e. the $x$ axis of a ROC curve). Finally $P(D^-)=1-P(D^+)$.

After the first positive test, Patrick has a prior probability $P(D^+)=\mathbf{Pr}=0.165$ so, calculating the PPV we obtain

$$ \mathrm{PPV} = P(D^+|T^+) = \frac{.99 \cdot .165}{ .99 \cdot .165 + (1 - .95) (1 - .165) } = 0.795 $$