Bayes Theorem | Disease problem Solved

Recently I came across a puzzle which can be solved by using Bayes probability theorem.  Thought I will share that.

Puzzle:
If a person has malaria, there is a 90% chance that his/her test results are positive. However the test result are not very correct, There is a chance for 1% error. Also only 1% of the total population get affected by Malaria.
Now one person's test result came out as Positive. Whats the odds that he will actually have Malaria.


Bayes theorem:

Before getting into the solution - here is the simple explanation of Bayes theorem.
  • Bayes theorem gives you the actual probability of an event from the measured test probabilities and the skewness.
  • In other words - If you know the real probabilities and the chance of skewness ( i.e. false positive and false negative), you can make correction for measurement errors.
Solution:

Applying Bayes formula

                                           P( T | M ) * P( M )
P( M | T ) =  -----------------------------------------------------------
                      P( T | M ) * P( M )  + P( T | m ) * P( m )

M = having Malaria
m = not having malaria
T  = testing positive
t   = testing negative
P( M | T) = chance of having Malaria when Tested Positive
P( T | M) = chance of getting a positive Result when having Malaria
P( M) = probability of getting Malaria
P( T | m) = testing false positive
.. and so on

                 
                                           0.9 * 0.01
P( M | T ) =  -----------------------------------------------------------   = .4761  = 47.6%
                      0.9 * 0.01 + 0.01 * .99


Puzzle -2
Now suppose your doctor had employed a far superior, more expensive test, one with only a .1% chance of a false positive. (Other parameters are the same - 90% chance of a true positive, 1% chance of malaria in general.) What are the odds now

                                           0.9 * 0.01
P( M | T ) =  -----------------------------------------------------------   = .9009  = 90.09%
                      0.9 * 0.01 + 0.001 * .99




Comments

Unknown said…
Thanks a lot for the detailed Explanation...

Popular posts from this blog

Tableau - Accessing Tableau's DB

react-bootstrap-table | header column alignment fix

Tableau : Convert ESRI shapes into Tableau Format