class: center, middle, title-slide .title[ # Practical 1 ] .author[ ### Olivier Gimenez ] .date[ ### last updated: 2024-10-17 ] --- ## Setting the scene * The chance of the test being positive given you are a vampire is `\(\Pr(+|\text{vampire}) = 0.90\)` (**sensitivity**). * The chance of a negative test given you are mortal is `\(\Pr(-|\text{mortal}) = 0.95\)` (**specificity**). --- ## Question * Suppose the diagnostic test has the same sensitivity and specificity but vampirism is more common: `\(10\%\)` of the population is vampire. * What is the probability that a person is a vampire, given that the test is positive? --- ## Solution The probability that a person is a vampire, given that the test is positive - `\(\Pr(+ | \text{vampire}) = 0.9\)` - `\(\Pr(- | \text{mortal}) = 0.95\)` - `\(\Pr(\text{vampire}) = 0.1\)` `\begin{align} \Pr(+) &= \Pr(+ | \text{vampire}) \Pr(\text{vampire}) + \Pr(+ | \text{mortal}) \Pr(\text{mortal}) \\ &= 0.9*0.1 + 0.05*0.9 \\ &=0.135 \end{align}` `\begin{align} \Pr(\text{vampire} | +) &= \Pr(+ | \text{vampire}) \Pr(\text{vampire}) / \Pr(+) \\ &= 0.9*0.1 / 0.135\\ &= 0.666 \text{ (no comment)} \end{align}`