Skip to content

Solutions: Bayes and the False Positives Problem – nutshell.

May 8, 2019

Solutions to Exercises

Question 1.

ab/ [ab+c(1-a)]

a is the prior probability, i.e. the probability that a hypothesis is true before you see the new evidence. Before the new evidence (the test), this chance is estimated at 1 in 100 (0.01), as we are told that 1 per cent of the people who visit his surgery have the virus. So, a = 0.01

b is the probability of the new evidence if the hypothesis is true. The probability of the new evidence (the positive result on the test) if the hypothesis is true (the patient is sick) is 95%, since the test is 95% accurate. So, b =0.95

c is the probability of the new evidence if the hypothesis is false. The probability of the new evidence (the positive result on the test) if the hypothesis is false (the patient is not sick) is 5% (because the test is 95% accurate, and we can only expect a false positive 5 times in 100). So, c = 0.05

Using Bayes’ Theorem, the updated (posterior) probability = 0.01 x 0.95/ [(0.01 x 0.95) + 0.05 (1-0.01)] = 0.0095 / (0.0095 + 0.0495) = 0.161

So the chance the doctor should give to the patient having the flu, if testing positive, is 16.1 per cent.

 

Question 2.

Let A = a positive test for an individual.

Let B = a negative test for an individual.

Let C = the employee is a drug user.

We are seeking to determine whether a player who tested positive is a drug user. This is represented by P (C I A).

Using Bayes’ Theorem,

P (C I A) = P (A I C) . P (C) / P (A)

We are told that P (A I C) = 0.9

Also, P (C) = 0.1

P (A) is the sum of the probability of testing positive if the player is using the banned substances and the probability of testing positive if the player is not using the banned substances.

We know that 10% of the tournament entrants are using the drugs and that 90% of the drug users will test positive.

So the probability of testing positive if the employee is taking the banned drugs = 0.9 x 0.1 = 0.09

We also know that the test is 85% for those not taking the drugs, so 15% of those innocent of taking the drugs will still test positive. But only 10% of the players are guilty of taking the drugs so 90% are not taking the drugs.

So, the probability of testing positive if the employee is not taking the banned drugs (known as a ‘false positive’) = 0.9 x 0.15 = 0.135

So, P (A) = 0.09 + 0.135 = 0.225

So, P (C I A) = P (A I C) . P (C) / P (A) = 0.9 x 0.1 / 0.225 = 0.4

So, the probability that an entrant to the tennis tournament tests positive and is taking the banned substances is 40%.

Question 3.

a. Sensitivity = 66/ (66+4) = 0.94 = 94%

b. Specificity = 827/ (827+3) = 0.99 = 99%

c. PPV = TP/(TP+FP) = 66/ (66+3) = 95.7%

d. NPV = TN/(TN+FN) = 827/ (827+4) = 99.5%

e. LR+ = sensitivity/(1-specificity) = 0.94/0.01 = 94

LR+ = P (T+ I D+) / P (T+ I D-) = 0.94/0.01 = 94

f. The negative likelihood ratio is calculated as:

LR- = (1-sensitivity)/specificity = (1-0.94) / 0.99 = 0.06/0.99 = 0.06

This is equivalent to:

LR- = P (T- I D+) / P (T- I D-) = 0.06/0.99 = 0.06

g. Pre-Test Probability of having the flu = 66+4/3+827 = 70/830 = 0.084

Pre-Test Odds = P (something is true) / P (something is false) = 0.084/ (1-0.084) = 0.091

Post-Test Odds = Pre-Test Odds x LR+ = 0.091 x 94 = 8.55

Probability = Odds / (1 + Odds) = 8.55 / 9.55 = 0.895

 

Question 4.

a. Sensitivity = 90/ (90+10) = 90%

b. Specificity = 750/ (750+150) = 83%

  • a. Sensitivity = 610 / 728 = 83.8%

b. Specificity = 127,344/ 140, 556 = 90.6%

c. LR+ = sensitivity / (1 – specificity) = 0.836 / (1-0.906) = 8.9

d. LR- = (1 – sensitivity) / specificity = (1-0.836) / 0.906 = 0.18

e. Pre-test probability of having flu = 610 + 118 / (13212 + 127344) = 728/140556 = 0.005. So pre-test probability of not having flu = 0.995.

Odds = P (something is true) / P (something is false)

So Pre-Test Odds = 0.005 / 0.995 = 0.005

N.B. For events with a very low probability, Odds are very similar to Probability.

f. Post-Test Odds = Pre-Test Odds x LR+ = 0.005 x 8.9 = 0.045

Post-Test Probability = Post-Test Odds / (1 + Post-Test Odds) = 0.045 / (1 + 0.045) = 4.3%.

g. Pre-Test Odds = P (Something is true, pre-test) / P (something is false, pre-test) = 0.3/0.7 = 0.43

h. Post-test Odds = Pre-test Odds x LR+ = 0.43 x 8.9 = 3.8

i. Probability = Odds / (1 + Odds) = 3.8 / (1 + 3.8) = 79%

j. Post-test Odds = Pre-test Odds x LR– = 0.43 x 0.18 = 0.077

k. Post-test probability = Odds / (1 + Odds) = 0.077 / (1 + 0.077) = 7.1%

From → Uncategorized

Leave a Comment

Leave a comment