How to calculate Pr(Diseased | 2 Positive Tests)?











up vote
7
down vote

favorite
1












Diagnosed with a rare disease, you know that there is only a 1% chance of getting it.

Abbreviate D as the event "you have the disease" and T as "you test positive for the disease."

The test is imperfect: $Pr(T | D) = 0.98$ and $Pr(T^C | D^C) = 0.95.$



$large{A.}$ Given that you test positive, what is the probability that you really have the disease?



$large{B.}$ You obtain a second opinion: an independent repetition of the test. You test positive again. given two positive tests, what is the probability that you really have the disease?




  1. So, first question I have is this: Does $Pr(T | D^C) = 1 - 0.95 = 0.05$?


This would mean that $P(T) = P(T | D) + P (T | D^C) = 0.98 + 0.05 = 1.03$ ...? This can't be right...P(T) can't be 1.03! Is there an error in this question?




  1. Then, here's my strategy for solving part A: Calculate $Pr(D | T) = dfrac{P(T cap D) }{ P(T) } = dfrac{ P(T | D) times P(D) }{ P(T) } $


UPDATE: Here is a hint from the professor:



During office hours today, the following hint came up that I thought would be good to share with the entire class for part B above.



Let's define two events T (first test positive) and S (second test positive). When you use Bayes' rule, you are going to need to figure out how to compute the total probability $Pr(T cap S)$. To do this, you should assume that these two tests are independent, and therefore you will get:



$Pr(T cap S | D) = P(T | D) * P(S | D) quad$ and $quad Pr(T cap S | D^c) = P(T | D^c) * P(S | D^c)$.



A point to remember here is that the rules of probability stay the same for conditional probability if the event on the right of the "|" stays constant. For instance, the complement rule looks like this: $P(A^c | B) = 1 - P(A | B)$. The other rules we have learned work out similarly.










share|cite|improve this question
























  • $P(D)$ is given to you. It's $1%$.
    – David Mitra
    Sep 18 '12 at 19:23










  • GAH! Hiding there in plain site the entire time! (editing, thank you!
    – user13327
    Sep 18 '12 at 19:23










  • is there a proof to show this? "you should assume that these two tests are independent, and therefore you will get:" Pr(T∩S|D)=P(T|D)∗P(S|D).
    – PGupta
    Aug 22 '17 at 13:37

















up vote
7
down vote

favorite
1












Diagnosed with a rare disease, you know that there is only a 1% chance of getting it.

Abbreviate D as the event "you have the disease" and T as "you test positive for the disease."

The test is imperfect: $Pr(T | D) = 0.98$ and $Pr(T^C | D^C) = 0.95.$



$large{A.}$ Given that you test positive, what is the probability that you really have the disease?



$large{B.}$ You obtain a second opinion: an independent repetition of the test. You test positive again. given two positive tests, what is the probability that you really have the disease?




  1. So, first question I have is this: Does $Pr(T | D^C) = 1 - 0.95 = 0.05$?


This would mean that $P(T) = P(T | D) + P (T | D^C) = 0.98 + 0.05 = 1.03$ ...? This can't be right...P(T) can't be 1.03! Is there an error in this question?




  1. Then, here's my strategy for solving part A: Calculate $Pr(D | T) = dfrac{P(T cap D) }{ P(T) } = dfrac{ P(T | D) times P(D) }{ P(T) } $


UPDATE: Here is a hint from the professor:



During office hours today, the following hint came up that I thought would be good to share with the entire class for part B above.



Let's define two events T (first test positive) and S (second test positive). When you use Bayes' rule, you are going to need to figure out how to compute the total probability $Pr(T cap S)$. To do this, you should assume that these two tests are independent, and therefore you will get:



$Pr(T cap S | D) = P(T | D) * P(S | D) quad$ and $quad Pr(T cap S | D^c) = P(T | D^c) * P(S | D^c)$.



A point to remember here is that the rules of probability stay the same for conditional probability if the event on the right of the "|" stays constant. For instance, the complement rule looks like this: $P(A^c | B) = 1 - P(A | B)$. The other rules we have learned work out similarly.










share|cite|improve this question
























  • $P(D)$ is given to you. It's $1%$.
    – David Mitra
    Sep 18 '12 at 19:23










  • GAH! Hiding there in plain site the entire time! (editing, thank you!
    – user13327
    Sep 18 '12 at 19:23










  • is there a proof to show this? "you should assume that these two tests are independent, and therefore you will get:" Pr(T∩S|D)=P(T|D)∗P(S|D).
    – PGupta
    Aug 22 '17 at 13:37















up vote
7
down vote

favorite
1









up vote
7
down vote

favorite
1






1





Diagnosed with a rare disease, you know that there is only a 1% chance of getting it.

Abbreviate D as the event "you have the disease" and T as "you test positive for the disease."

The test is imperfect: $Pr(T | D) = 0.98$ and $Pr(T^C | D^C) = 0.95.$



$large{A.}$ Given that you test positive, what is the probability that you really have the disease?



$large{B.}$ You obtain a second opinion: an independent repetition of the test. You test positive again. given two positive tests, what is the probability that you really have the disease?




  1. So, first question I have is this: Does $Pr(T | D^C) = 1 - 0.95 = 0.05$?


This would mean that $P(T) = P(T | D) + P (T | D^C) = 0.98 + 0.05 = 1.03$ ...? This can't be right...P(T) can't be 1.03! Is there an error in this question?




  1. Then, here's my strategy for solving part A: Calculate $Pr(D | T) = dfrac{P(T cap D) }{ P(T) } = dfrac{ P(T | D) times P(D) }{ P(T) } $


UPDATE: Here is a hint from the professor:



During office hours today, the following hint came up that I thought would be good to share with the entire class for part B above.



Let's define two events T (first test positive) and S (second test positive). When you use Bayes' rule, you are going to need to figure out how to compute the total probability $Pr(T cap S)$. To do this, you should assume that these two tests are independent, and therefore you will get:



$Pr(T cap S | D) = P(T | D) * P(S | D) quad$ and $quad Pr(T cap S | D^c) = P(T | D^c) * P(S | D^c)$.



A point to remember here is that the rules of probability stay the same for conditional probability if the event on the right of the "|" stays constant. For instance, the complement rule looks like this: $P(A^c | B) = 1 - P(A | B)$. The other rules we have learned work out similarly.










share|cite|improve this question















Diagnosed with a rare disease, you know that there is only a 1% chance of getting it.

Abbreviate D as the event "you have the disease" and T as "you test positive for the disease."

The test is imperfect: $Pr(T | D) = 0.98$ and $Pr(T^C | D^C) = 0.95.$



$large{A.}$ Given that you test positive, what is the probability that you really have the disease?



$large{B.}$ You obtain a second opinion: an independent repetition of the test. You test positive again. given two positive tests, what is the probability that you really have the disease?




  1. So, first question I have is this: Does $Pr(T | D^C) = 1 - 0.95 = 0.05$?


This would mean that $P(T) = P(T | D) + P (T | D^C) = 0.98 + 0.05 = 1.03$ ...? This can't be right...P(T) can't be 1.03! Is there an error in this question?




  1. Then, here's my strategy for solving part A: Calculate $Pr(D | T) = dfrac{P(T cap D) }{ P(T) } = dfrac{ P(T | D) times P(D) }{ P(T) } $


UPDATE: Here is a hint from the professor:



During office hours today, the following hint came up that I thought would be good to share with the entire class for part B above.



Let's define two events T (first test positive) and S (second test positive). When you use Bayes' rule, you are going to need to figure out how to compute the total probability $Pr(T cap S)$. To do this, you should assume that these two tests are independent, and therefore you will get:



$Pr(T cap S | D) = P(T | D) * P(S | D) quad$ and $quad Pr(T cap S | D^c) = P(T | D^c) * P(S | D^c)$.



A point to remember here is that the rules of probability stay the same for conditional probability if the event on the right of the "|" stays constant. For instance, the complement rule looks like this: $P(A^c | B) = 1 - P(A | B)$. The other rules we have learned work out similarly.







probability bayes-theorem






share|cite|improve this question















share|cite|improve this question













share|cite|improve this question




share|cite|improve this question








edited Feb 4 '16 at 3:19









Greek - Area 51 Proposal

3,135669103




3,135669103










asked Sep 18 '12 at 19:12







user13327



















  • $P(D)$ is given to you. It's $1%$.
    – David Mitra
    Sep 18 '12 at 19:23










  • GAH! Hiding there in plain site the entire time! (editing, thank you!
    – user13327
    Sep 18 '12 at 19:23










  • is there a proof to show this? "you should assume that these two tests are independent, and therefore you will get:" Pr(T∩S|D)=P(T|D)∗P(S|D).
    – PGupta
    Aug 22 '17 at 13:37




















  • $P(D)$ is given to you. It's $1%$.
    – David Mitra
    Sep 18 '12 at 19:23










  • GAH! Hiding there in plain site the entire time! (editing, thank you!
    – user13327
    Sep 18 '12 at 19:23










  • is there a proof to show this? "you should assume that these two tests are independent, and therefore you will get:" Pr(T∩S|D)=P(T|D)∗P(S|D).
    – PGupta
    Aug 22 '17 at 13:37


















$P(D)$ is given to you. It's $1%$.
– David Mitra
Sep 18 '12 at 19:23




$P(D)$ is given to you. It's $1%$.
– David Mitra
Sep 18 '12 at 19:23












GAH! Hiding there in plain site the entire time! (editing, thank you!
– user13327
Sep 18 '12 at 19:23




GAH! Hiding there in plain site the entire time! (editing, thank you!
– user13327
Sep 18 '12 at 19:23












is there a proof to show this? "you should assume that these two tests are independent, and therefore you will get:" Pr(T∩S|D)=P(T|D)∗P(S|D).
– PGupta
Aug 22 '17 at 13:37






is there a proof to show this? "you should assume that these two tests are independent, and therefore you will get:" Pr(T∩S|D)=P(T|D)∗P(S|D).
– PGupta
Aug 22 '17 at 13:37












3 Answers
3






active

oldest

votes

















up vote
5
down vote



accepted










We want $Pr(D|T)$. By the universal formula to solve such problems, we have
$$Pr(D|T)Pr(T)=Pr(Dcap T).$$



It remains to calculate $Pr(T)$ and $Pr(Dcap T)$.



Let's go first for the harder one, $Pr(T)$. The event $T$ can happen in two disjoint ways: (i) You have the disease and the test says so or (ii) You don't have the disease, but the test says you do.



For (i), the probability you have the disease is $0.01$. Given that you have the disease, the probability the test says so is $0.98$. So the probability of (i) is $(0.01)(0.98)$.



We can calculate the probability of (i) in a more fancy way. We want $Pr(Dcap T)$. This is $Pr(T|D)Pr(D)$, which is $(0.98)(0.01)$.



For (ii), the probability you don't have the disease is $0.99$. Given you don't have the disease, the probability the test wrongly says you do is $0.05$. So the probability of (ii) is $(0.99)(0.05)$.



Add the probabilities of (i) and (ii) to get $Pr(T)$.



For $Pr(Dcap T)$, note it is just the already computed probability of (i).



Remark: At one time, tuberculosis was not uncommon. A simple antibody test, the tuberculin test, was routinely given to people. The tuberculin test gave a significant proportion of false positives, and a smaller proportion of false negatives, these mostly due to handling mixups. People who tested positive had X-ray chest examinations for confirmation. After a while, tuberculosis became quite rare, at least in relatively prosperous communities. Just as in the above problem, it turned out that a large proportion of the people who tested positive and got X-rayed were healthy. The X-rays became more of a public health hazard than the disease, and the routine tuberculin test disappeared.






share|cite|improve this answer























  • Wait, is the fancy way of calculating (i) right? Pr(D intersect T) = Pr(T | D) * Pr(T)? But the first way you put it you had Pr(D | T). So, the Ts and Ds are interchangeable in this instance?
    – user13327
    Sep 18 '12 at 19:41










  • @Silver: Thanks, typo, fixed.
    – André Nicolas
    Sep 18 '12 at 19:43










  • Alright cool, but the answer I'm getting looks funny to me. I have P(T) = (0.01 * 0.98) + (0.99 * 0.05) = 0.0593. And P(D intersect T) = (0.98 * 0.01) = 0.0098. Now, I do P(D | T) = 0.0098 / 0.0593 = 0.16526138279. And that just doesn't seem right.
    – user13327
    Sep 18 '12 at 19:54










  • Yes, it should be roughly $1/6$. In other words, most of the people who test positive don't have the disease. That is a very important fact. a test whose specs look quite good can be, when you are dealing with a rare disease, look not so good! I added some historical material to the post that you may find interesting.
    – André Nicolas
    Sep 18 '12 at 20:10










  • Ahhhh, thank you very much!
    – user13327
    Sep 18 '12 at 20:12


















up vote
6
down vote














P(T) = P(T | D) + P (T | !D) = 0.98 + .05 = 1.03 ...?




That is incorrect. P(T) = P(T | D) x P(D) + P(T | !D) x P(!D) (remember Bayes' Rule?)



I think this alone is enough information for you to solve it. I must post this as a comment but due to no rep, am posting it as an answer. Hope it helps.






share|cite|improve this answer




























    up vote
    6
    down vote













    To get a handle on what Bayes’ rule is really doing in a simple case like your first problem, look at a little table:



    $$begin{array}{r|cc|c}
    &T&lnot T&text{Total}\ hline
    D&color{red}{0.0098}&color{red}{0.0002}&0.01\
    lnot D&color{red}{0.0495}&color{red}{0.9405}&color{blue}{0.99}\ hline
    text{Total}&color{green}{0.0593}&color{green}{0.9407}&color{blue}{1}
    end{array}$$



    What’s in black shows the basic setup: the number in row $D$ and column $T$ will be the probability that you have the disease and test positive, for instance. (I’ve used $lnot D$, meaning $text{not }D$, for the event of not having the disease.) I’ve also written in black the one number that you were explicitly given that goes in the table, namely, the probability that a randomly chosen person has the disease. Obviously the probability in the lower righthand corner must be $1$, and the probability that a randomly chosen person does not have the disease must be $1-0.01=0.99$, so I added those in blue.



    Next, we know that $98$% of the $1$% who have the test will test positive, so the probability that a randomly chosen person both has the disease and tests positive is $0.98cdot0.01=0.0098$, and the probability that such a person both has the disease and tests negative must be $0.01-0.0098=0.0002$; I’ve added these in red.



    Similar reasoning tells us that the probability that a randomly chosen person does not have the disease and tests negative is $0.95cdot0.99=0.9405$, so the probability that such a person does not have the disease but tests positive is $0.99-0.9405=0.0495$; I’ve added these in red as well.



    At this point we can complete the table by adding the $T$ and $lnot T$ columns to get the missing totals on the bottom line.



    Now, suppose that you test positive. That means that you’re one of the $14.75$% represented by the first column of the table, and you want to know your chance of being one of the $0.98$% who test positive and have the disease. That probability is $dfrac{0.0098}{0.0593}approx 0.1653$: you have almost one chance in six of having the disease.



    Bayes’ rule boils all of this down to a single formula. We ended up calculating the ratio $$frac{mathrm{Pr}(Dcap T)}{mathrm{Pr}(T)};,$$ but we got the numerator by calculating $mathrm{Pr}(T|D)mathrm{Pr}(D)$, so in fact we calculated



    $$mathrm{Pr}(D|T)=frac{mathrm{Pr}(T|D)mathrm{Pr}(D)}{mathrm{Pr}(T)};,$$



    which is Bayes’ rule.



    In this case we also had to work a bit to get the denominator; that’s typical.






    share|cite|improve this answer























    • So first off, thanks for taking the time to write out this answer. Second, .98 * .01 = .0098 right?
      – user13327
      Sep 18 '12 at 20:03










    • @Silver: It is indeed. sigh Fixed now. Thanks.
      – Brian M. Scott
      Sep 18 '12 at 20:13











    Your Answer





    StackExchange.ifUsing("editor", function () {
    return StackExchange.using("mathjaxEditing", function () {
    StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
    StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
    });
    });
    }, "mathjax-editing");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "69"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    noCode: true, onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f198677%2fhow-to-calculate-prdiseased-2-positive-tests%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown
























    3 Answers
    3






    active

    oldest

    votes








    3 Answers
    3






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    5
    down vote



    accepted










    We want $Pr(D|T)$. By the universal formula to solve such problems, we have
    $$Pr(D|T)Pr(T)=Pr(Dcap T).$$



    It remains to calculate $Pr(T)$ and $Pr(Dcap T)$.



    Let's go first for the harder one, $Pr(T)$. The event $T$ can happen in two disjoint ways: (i) You have the disease and the test says so or (ii) You don't have the disease, but the test says you do.



    For (i), the probability you have the disease is $0.01$. Given that you have the disease, the probability the test says so is $0.98$. So the probability of (i) is $(0.01)(0.98)$.



    We can calculate the probability of (i) in a more fancy way. We want $Pr(Dcap T)$. This is $Pr(T|D)Pr(D)$, which is $(0.98)(0.01)$.



    For (ii), the probability you don't have the disease is $0.99$. Given you don't have the disease, the probability the test wrongly says you do is $0.05$. So the probability of (ii) is $(0.99)(0.05)$.



    Add the probabilities of (i) and (ii) to get $Pr(T)$.



    For $Pr(Dcap T)$, note it is just the already computed probability of (i).



    Remark: At one time, tuberculosis was not uncommon. A simple antibody test, the tuberculin test, was routinely given to people. The tuberculin test gave a significant proportion of false positives, and a smaller proportion of false negatives, these mostly due to handling mixups. People who tested positive had X-ray chest examinations for confirmation. After a while, tuberculosis became quite rare, at least in relatively prosperous communities. Just as in the above problem, it turned out that a large proportion of the people who tested positive and got X-rayed were healthy. The X-rays became more of a public health hazard than the disease, and the routine tuberculin test disappeared.






    share|cite|improve this answer























    • Wait, is the fancy way of calculating (i) right? Pr(D intersect T) = Pr(T | D) * Pr(T)? But the first way you put it you had Pr(D | T). So, the Ts and Ds are interchangeable in this instance?
      – user13327
      Sep 18 '12 at 19:41










    • @Silver: Thanks, typo, fixed.
      – André Nicolas
      Sep 18 '12 at 19:43










    • Alright cool, but the answer I'm getting looks funny to me. I have P(T) = (0.01 * 0.98) + (0.99 * 0.05) = 0.0593. And P(D intersect T) = (0.98 * 0.01) = 0.0098. Now, I do P(D | T) = 0.0098 / 0.0593 = 0.16526138279. And that just doesn't seem right.
      – user13327
      Sep 18 '12 at 19:54










    • Yes, it should be roughly $1/6$. In other words, most of the people who test positive don't have the disease. That is a very important fact. a test whose specs look quite good can be, when you are dealing with a rare disease, look not so good! I added some historical material to the post that you may find interesting.
      – André Nicolas
      Sep 18 '12 at 20:10










    • Ahhhh, thank you very much!
      – user13327
      Sep 18 '12 at 20:12















    up vote
    5
    down vote



    accepted










    We want $Pr(D|T)$. By the universal formula to solve such problems, we have
    $$Pr(D|T)Pr(T)=Pr(Dcap T).$$



    It remains to calculate $Pr(T)$ and $Pr(Dcap T)$.



    Let's go first for the harder one, $Pr(T)$. The event $T$ can happen in two disjoint ways: (i) You have the disease and the test says so or (ii) You don't have the disease, but the test says you do.



    For (i), the probability you have the disease is $0.01$. Given that you have the disease, the probability the test says so is $0.98$. So the probability of (i) is $(0.01)(0.98)$.



    We can calculate the probability of (i) in a more fancy way. We want $Pr(Dcap T)$. This is $Pr(T|D)Pr(D)$, which is $(0.98)(0.01)$.



    For (ii), the probability you don't have the disease is $0.99$. Given you don't have the disease, the probability the test wrongly says you do is $0.05$. So the probability of (ii) is $(0.99)(0.05)$.



    Add the probabilities of (i) and (ii) to get $Pr(T)$.



    For $Pr(Dcap T)$, note it is just the already computed probability of (i).



    Remark: At one time, tuberculosis was not uncommon. A simple antibody test, the tuberculin test, was routinely given to people. The tuberculin test gave a significant proportion of false positives, and a smaller proportion of false negatives, these mostly due to handling mixups. People who tested positive had X-ray chest examinations for confirmation. After a while, tuberculosis became quite rare, at least in relatively prosperous communities. Just as in the above problem, it turned out that a large proportion of the people who tested positive and got X-rayed were healthy. The X-rays became more of a public health hazard than the disease, and the routine tuberculin test disappeared.






    share|cite|improve this answer























    • Wait, is the fancy way of calculating (i) right? Pr(D intersect T) = Pr(T | D) * Pr(T)? But the first way you put it you had Pr(D | T). So, the Ts and Ds are interchangeable in this instance?
      – user13327
      Sep 18 '12 at 19:41










    • @Silver: Thanks, typo, fixed.
      – André Nicolas
      Sep 18 '12 at 19:43










    • Alright cool, but the answer I'm getting looks funny to me. I have P(T) = (0.01 * 0.98) + (0.99 * 0.05) = 0.0593. And P(D intersect T) = (0.98 * 0.01) = 0.0098. Now, I do P(D | T) = 0.0098 / 0.0593 = 0.16526138279. And that just doesn't seem right.
      – user13327
      Sep 18 '12 at 19:54










    • Yes, it should be roughly $1/6$. In other words, most of the people who test positive don't have the disease. That is a very important fact. a test whose specs look quite good can be, when you are dealing with a rare disease, look not so good! I added some historical material to the post that you may find interesting.
      – André Nicolas
      Sep 18 '12 at 20:10










    • Ahhhh, thank you very much!
      – user13327
      Sep 18 '12 at 20:12













    up vote
    5
    down vote



    accepted







    up vote
    5
    down vote



    accepted






    We want $Pr(D|T)$. By the universal formula to solve such problems, we have
    $$Pr(D|T)Pr(T)=Pr(Dcap T).$$



    It remains to calculate $Pr(T)$ and $Pr(Dcap T)$.



    Let's go first for the harder one, $Pr(T)$. The event $T$ can happen in two disjoint ways: (i) You have the disease and the test says so or (ii) You don't have the disease, but the test says you do.



    For (i), the probability you have the disease is $0.01$. Given that you have the disease, the probability the test says so is $0.98$. So the probability of (i) is $(0.01)(0.98)$.



    We can calculate the probability of (i) in a more fancy way. We want $Pr(Dcap T)$. This is $Pr(T|D)Pr(D)$, which is $(0.98)(0.01)$.



    For (ii), the probability you don't have the disease is $0.99$. Given you don't have the disease, the probability the test wrongly says you do is $0.05$. So the probability of (ii) is $(0.99)(0.05)$.



    Add the probabilities of (i) and (ii) to get $Pr(T)$.



    For $Pr(Dcap T)$, note it is just the already computed probability of (i).



    Remark: At one time, tuberculosis was not uncommon. A simple antibody test, the tuberculin test, was routinely given to people. The tuberculin test gave a significant proportion of false positives, and a smaller proportion of false negatives, these mostly due to handling mixups. People who tested positive had X-ray chest examinations for confirmation. After a while, tuberculosis became quite rare, at least in relatively prosperous communities. Just as in the above problem, it turned out that a large proportion of the people who tested positive and got X-rayed were healthy. The X-rays became more of a public health hazard than the disease, and the routine tuberculin test disappeared.






    share|cite|improve this answer














    We want $Pr(D|T)$. By the universal formula to solve such problems, we have
    $$Pr(D|T)Pr(T)=Pr(Dcap T).$$



    It remains to calculate $Pr(T)$ and $Pr(Dcap T)$.



    Let's go first for the harder one, $Pr(T)$. The event $T$ can happen in two disjoint ways: (i) You have the disease and the test says so or (ii) You don't have the disease, but the test says you do.



    For (i), the probability you have the disease is $0.01$. Given that you have the disease, the probability the test says so is $0.98$. So the probability of (i) is $(0.01)(0.98)$.



    We can calculate the probability of (i) in a more fancy way. We want $Pr(Dcap T)$. This is $Pr(T|D)Pr(D)$, which is $(0.98)(0.01)$.



    For (ii), the probability you don't have the disease is $0.99$. Given you don't have the disease, the probability the test wrongly says you do is $0.05$. So the probability of (ii) is $(0.99)(0.05)$.



    Add the probabilities of (i) and (ii) to get $Pr(T)$.



    For $Pr(Dcap T)$, note it is just the already computed probability of (i).



    Remark: At one time, tuberculosis was not uncommon. A simple antibody test, the tuberculin test, was routinely given to people. The tuberculin test gave a significant proportion of false positives, and a smaller proportion of false negatives, these mostly due to handling mixups. People who tested positive had X-ray chest examinations for confirmation. After a while, tuberculosis became quite rare, at least in relatively prosperous communities. Just as in the above problem, it turned out that a large proportion of the people who tested positive and got X-rayed were healthy. The X-rays became more of a public health hazard than the disease, and the routine tuberculin test disappeared.







    share|cite|improve this answer














    share|cite|improve this answer



    share|cite|improve this answer








    edited Sep 18 '12 at 20:05

























    answered Sep 18 '12 at 19:23









    André Nicolas

    451k36421805




    451k36421805












    • Wait, is the fancy way of calculating (i) right? Pr(D intersect T) = Pr(T | D) * Pr(T)? But the first way you put it you had Pr(D | T). So, the Ts and Ds are interchangeable in this instance?
      – user13327
      Sep 18 '12 at 19:41










    • @Silver: Thanks, typo, fixed.
      – André Nicolas
      Sep 18 '12 at 19:43










    • Alright cool, but the answer I'm getting looks funny to me. I have P(T) = (0.01 * 0.98) + (0.99 * 0.05) = 0.0593. And P(D intersect T) = (0.98 * 0.01) = 0.0098. Now, I do P(D | T) = 0.0098 / 0.0593 = 0.16526138279. And that just doesn't seem right.
      – user13327
      Sep 18 '12 at 19:54










    • Yes, it should be roughly $1/6$. In other words, most of the people who test positive don't have the disease. That is a very important fact. a test whose specs look quite good can be, when you are dealing with a rare disease, look not so good! I added some historical material to the post that you may find interesting.
      – André Nicolas
      Sep 18 '12 at 20:10










    • Ahhhh, thank you very much!
      – user13327
      Sep 18 '12 at 20:12


















    • Wait, is the fancy way of calculating (i) right? Pr(D intersect T) = Pr(T | D) * Pr(T)? But the first way you put it you had Pr(D | T). So, the Ts and Ds are interchangeable in this instance?
      – user13327
      Sep 18 '12 at 19:41










    • @Silver: Thanks, typo, fixed.
      – André Nicolas
      Sep 18 '12 at 19:43










    • Alright cool, but the answer I'm getting looks funny to me. I have P(T) = (0.01 * 0.98) + (0.99 * 0.05) = 0.0593. And P(D intersect T) = (0.98 * 0.01) = 0.0098. Now, I do P(D | T) = 0.0098 / 0.0593 = 0.16526138279. And that just doesn't seem right.
      – user13327
      Sep 18 '12 at 19:54










    • Yes, it should be roughly $1/6$. In other words, most of the people who test positive don't have the disease. That is a very important fact. a test whose specs look quite good can be, when you are dealing with a rare disease, look not so good! I added some historical material to the post that you may find interesting.
      – André Nicolas
      Sep 18 '12 at 20:10










    • Ahhhh, thank you very much!
      – user13327
      Sep 18 '12 at 20:12
















    Wait, is the fancy way of calculating (i) right? Pr(D intersect T) = Pr(T | D) * Pr(T)? But the first way you put it you had Pr(D | T). So, the Ts and Ds are interchangeable in this instance?
    – user13327
    Sep 18 '12 at 19:41




    Wait, is the fancy way of calculating (i) right? Pr(D intersect T) = Pr(T | D) * Pr(T)? But the first way you put it you had Pr(D | T). So, the Ts and Ds are interchangeable in this instance?
    – user13327
    Sep 18 '12 at 19:41












    @Silver: Thanks, typo, fixed.
    – André Nicolas
    Sep 18 '12 at 19:43




    @Silver: Thanks, typo, fixed.
    – André Nicolas
    Sep 18 '12 at 19:43












    Alright cool, but the answer I'm getting looks funny to me. I have P(T) = (0.01 * 0.98) + (0.99 * 0.05) = 0.0593. And P(D intersect T) = (0.98 * 0.01) = 0.0098. Now, I do P(D | T) = 0.0098 / 0.0593 = 0.16526138279. And that just doesn't seem right.
    – user13327
    Sep 18 '12 at 19:54




    Alright cool, but the answer I'm getting looks funny to me. I have P(T) = (0.01 * 0.98) + (0.99 * 0.05) = 0.0593. And P(D intersect T) = (0.98 * 0.01) = 0.0098. Now, I do P(D | T) = 0.0098 / 0.0593 = 0.16526138279. And that just doesn't seem right.
    – user13327
    Sep 18 '12 at 19:54












    Yes, it should be roughly $1/6$. In other words, most of the people who test positive don't have the disease. That is a very important fact. a test whose specs look quite good can be, when you are dealing with a rare disease, look not so good! I added some historical material to the post that you may find interesting.
    – André Nicolas
    Sep 18 '12 at 20:10




    Yes, it should be roughly $1/6$. In other words, most of the people who test positive don't have the disease. That is a very important fact. a test whose specs look quite good can be, when you are dealing with a rare disease, look not so good! I added some historical material to the post that you may find interesting.
    – André Nicolas
    Sep 18 '12 at 20:10












    Ahhhh, thank you very much!
    – user13327
    Sep 18 '12 at 20:12




    Ahhhh, thank you very much!
    – user13327
    Sep 18 '12 at 20:12










    up vote
    6
    down vote














    P(T) = P(T | D) + P (T | !D) = 0.98 + .05 = 1.03 ...?




    That is incorrect. P(T) = P(T | D) x P(D) + P(T | !D) x P(!D) (remember Bayes' Rule?)



    I think this alone is enough information for you to solve it. I must post this as a comment but due to no rep, am posting it as an answer. Hope it helps.






    share|cite|improve this answer

























      up vote
      6
      down vote














      P(T) = P(T | D) + P (T | !D) = 0.98 + .05 = 1.03 ...?




      That is incorrect. P(T) = P(T | D) x P(D) + P(T | !D) x P(!D) (remember Bayes' Rule?)



      I think this alone is enough information for you to solve it. I must post this as a comment but due to no rep, am posting it as an answer. Hope it helps.






      share|cite|improve this answer























        up vote
        6
        down vote










        up vote
        6
        down vote










        P(T) = P(T | D) + P (T | !D) = 0.98 + .05 = 1.03 ...?




        That is incorrect. P(T) = P(T | D) x P(D) + P(T | !D) x P(!D) (remember Bayes' Rule?)



        I think this alone is enough information for you to solve it. I must post this as a comment but due to no rep, am posting it as an answer. Hope it helps.






        share|cite|improve this answer













        P(T) = P(T | D) + P (T | !D) = 0.98 + .05 = 1.03 ...?




        That is incorrect. P(T) = P(T | D) x P(D) + P(T | !D) x P(!D) (remember Bayes' Rule?)



        I think this alone is enough information for you to solve it. I must post this as a comment but due to no rep, am posting it as an answer. Hope it helps.







        share|cite|improve this answer












        share|cite|improve this answer



        share|cite|improve this answer










        answered Sep 18 '12 at 19:20









        rrampage

        32729




        32729






















            up vote
            6
            down vote













            To get a handle on what Bayes’ rule is really doing in a simple case like your first problem, look at a little table:



            $$begin{array}{r|cc|c}
            &T&lnot T&text{Total}\ hline
            D&color{red}{0.0098}&color{red}{0.0002}&0.01\
            lnot D&color{red}{0.0495}&color{red}{0.9405}&color{blue}{0.99}\ hline
            text{Total}&color{green}{0.0593}&color{green}{0.9407}&color{blue}{1}
            end{array}$$



            What’s in black shows the basic setup: the number in row $D$ and column $T$ will be the probability that you have the disease and test positive, for instance. (I’ve used $lnot D$, meaning $text{not }D$, for the event of not having the disease.) I’ve also written in black the one number that you were explicitly given that goes in the table, namely, the probability that a randomly chosen person has the disease. Obviously the probability in the lower righthand corner must be $1$, and the probability that a randomly chosen person does not have the disease must be $1-0.01=0.99$, so I added those in blue.



            Next, we know that $98$% of the $1$% who have the test will test positive, so the probability that a randomly chosen person both has the disease and tests positive is $0.98cdot0.01=0.0098$, and the probability that such a person both has the disease and tests negative must be $0.01-0.0098=0.0002$; I’ve added these in red.



            Similar reasoning tells us that the probability that a randomly chosen person does not have the disease and tests negative is $0.95cdot0.99=0.9405$, so the probability that such a person does not have the disease but tests positive is $0.99-0.9405=0.0495$; I’ve added these in red as well.



            At this point we can complete the table by adding the $T$ and $lnot T$ columns to get the missing totals on the bottom line.



            Now, suppose that you test positive. That means that you’re one of the $14.75$% represented by the first column of the table, and you want to know your chance of being one of the $0.98$% who test positive and have the disease. That probability is $dfrac{0.0098}{0.0593}approx 0.1653$: you have almost one chance in six of having the disease.



            Bayes’ rule boils all of this down to a single formula. We ended up calculating the ratio $$frac{mathrm{Pr}(Dcap T)}{mathrm{Pr}(T)};,$$ but we got the numerator by calculating $mathrm{Pr}(T|D)mathrm{Pr}(D)$, so in fact we calculated



            $$mathrm{Pr}(D|T)=frac{mathrm{Pr}(T|D)mathrm{Pr}(D)}{mathrm{Pr}(T)};,$$



            which is Bayes’ rule.



            In this case we also had to work a bit to get the denominator; that’s typical.






            share|cite|improve this answer























            • So first off, thanks for taking the time to write out this answer. Second, .98 * .01 = .0098 right?
              – user13327
              Sep 18 '12 at 20:03










            • @Silver: It is indeed. sigh Fixed now. Thanks.
              – Brian M. Scott
              Sep 18 '12 at 20:13















            up vote
            6
            down vote













            To get a handle on what Bayes’ rule is really doing in a simple case like your first problem, look at a little table:



            $$begin{array}{r|cc|c}
            &T&lnot T&text{Total}\ hline
            D&color{red}{0.0098}&color{red}{0.0002}&0.01\
            lnot D&color{red}{0.0495}&color{red}{0.9405}&color{blue}{0.99}\ hline
            text{Total}&color{green}{0.0593}&color{green}{0.9407}&color{blue}{1}
            end{array}$$



            What’s in black shows the basic setup: the number in row $D$ and column $T$ will be the probability that you have the disease and test positive, for instance. (I’ve used $lnot D$, meaning $text{not }D$, for the event of not having the disease.) I’ve also written in black the one number that you were explicitly given that goes in the table, namely, the probability that a randomly chosen person has the disease. Obviously the probability in the lower righthand corner must be $1$, and the probability that a randomly chosen person does not have the disease must be $1-0.01=0.99$, so I added those in blue.



            Next, we know that $98$% of the $1$% who have the test will test positive, so the probability that a randomly chosen person both has the disease and tests positive is $0.98cdot0.01=0.0098$, and the probability that such a person both has the disease and tests negative must be $0.01-0.0098=0.0002$; I’ve added these in red.



            Similar reasoning tells us that the probability that a randomly chosen person does not have the disease and tests negative is $0.95cdot0.99=0.9405$, so the probability that such a person does not have the disease but tests positive is $0.99-0.9405=0.0495$; I’ve added these in red as well.



            At this point we can complete the table by adding the $T$ and $lnot T$ columns to get the missing totals on the bottom line.



            Now, suppose that you test positive. That means that you’re one of the $14.75$% represented by the first column of the table, and you want to know your chance of being one of the $0.98$% who test positive and have the disease. That probability is $dfrac{0.0098}{0.0593}approx 0.1653$: you have almost one chance in six of having the disease.



            Bayes’ rule boils all of this down to a single formula. We ended up calculating the ratio $$frac{mathrm{Pr}(Dcap T)}{mathrm{Pr}(T)};,$$ but we got the numerator by calculating $mathrm{Pr}(T|D)mathrm{Pr}(D)$, so in fact we calculated



            $$mathrm{Pr}(D|T)=frac{mathrm{Pr}(T|D)mathrm{Pr}(D)}{mathrm{Pr}(T)};,$$



            which is Bayes’ rule.



            In this case we also had to work a bit to get the denominator; that’s typical.






            share|cite|improve this answer























            • So first off, thanks for taking the time to write out this answer. Second, .98 * .01 = .0098 right?
              – user13327
              Sep 18 '12 at 20:03










            • @Silver: It is indeed. sigh Fixed now. Thanks.
              – Brian M. Scott
              Sep 18 '12 at 20:13













            up vote
            6
            down vote










            up vote
            6
            down vote









            To get a handle on what Bayes’ rule is really doing in a simple case like your first problem, look at a little table:



            $$begin{array}{r|cc|c}
            &T&lnot T&text{Total}\ hline
            D&color{red}{0.0098}&color{red}{0.0002}&0.01\
            lnot D&color{red}{0.0495}&color{red}{0.9405}&color{blue}{0.99}\ hline
            text{Total}&color{green}{0.0593}&color{green}{0.9407}&color{blue}{1}
            end{array}$$



            What’s in black shows the basic setup: the number in row $D$ and column $T$ will be the probability that you have the disease and test positive, for instance. (I’ve used $lnot D$, meaning $text{not }D$, for the event of not having the disease.) I’ve also written in black the one number that you were explicitly given that goes in the table, namely, the probability that a randomly chosen person has the disease. Obviously the probability in the lower righthand corner must be $1$, and the probability that a randomly chosen person does not have the disease must be $1-0.01=0.99$, so I added those in blue.



            Next, we know that $98$% of the $1$% who have the test will test positive, so the probability that a randomly chosen person both has the disease and tests positive is $0.98cdot0.01=0.0098$, and the probability that such a person both has the disease and tests negative must be $0.01-0.0098=0.0002$; I’ve added these in red.



            Similar reasoning tells us that the probability that a randomly chosen person does not have the disease and tests negative is $0.95cdot0.99=0.9405$, so the probability that such a person does not have the disease but tests positive is $0.99-0.9405=0.0495$; I’ve added these in red as well.



            At this point we can complete the table by adding the $T$ and $lnot T$ columns to get the missing totals on the bottom line.



            Now, suppose that you test positive. That means that you’re one of the $14.75$% represented by the first column of the table, and you want to know your chance of being one of the $0.98$% who test positive and have the disease. That probability is $dfrac{0.0098}{0.0593}approx 0.1653$: you have almost one chance in six of having the disease.



            Bayes’ rule boils all of this down to a single formula. We ended up calculating the ratio $$frac{mathrm{Pr}(Dcap T)}{mathrm{Pr}(T)};,$$ but we got the numerator by calculating $mathrm{Pr}(T|D)mathrm{Pr}(D)$, so in fact we calculated



            $$mathrm{Pr}(D|T)=frac{mathrm{Pr}(T|D)mathrm{Pr}(D)}{mathrm{Pr}(T)};,$$



            which is Bayes’ rule.



            In this case we also had to work a bit to get the denominator; that’s typical.






            share|cite|improve this answer














            To get a handle on what Bayes’ rule is really doing in a simple case like your first problem, look at a little table:



            $$begin{array}{r|cc|c}
            &T&lnot T&text{Total}\ hline
            D&color{red}{0.0098}&color{red}{0.0002}&0.01\
            lnot D&color{red}{0.0495}&color{red}{0.9405}&color{blue}{0.99}\ hline
            text{Total}&color{green}{0.0593}&color{green}{0.9407}&color{blue}{1}
            end{array}$$



            What’s in black shows the basic setup: the number in row $D$ and column $T$ will be the probability that you have the disease and test positive, for instance. (I’ve used $lnot D$, meaning $text{not }D$, for the event of not having the disease.) I’ve also written in black the one number that you were explicitly given that goes in the table, namely, the probability that a randomly chosen person has the disease. Obviously the probability in the lower righthand corner must be $1$, and the probability that a randomly chosen person does not have the disease must be $1-0.01=0.99$, so I added those in blue.



            Next, we know that $98$% of the $1$% who have the test will test positive, so the probability that a randomly chosen person both has the disease and tests positive is $0.98cdot0.01=0.0098$, and the probability that such a person both has the disease and tests negative must be $0.01-0.0098=0.0002$; I’ve added these in red.



            Similar reasoning tells us that the probability that a randomly chosen person does not have the disease and tests negative is $0.95cdot0.99=0.9405$, so the probability that such a person does not have the disease but tests positive is $0.99-0.9405=0.0495$; I’ve added these in red as well.



            At this point we can complete the table by adding the $T$ and $lnot T$ columns to get the missing totals on the bottom line.



            Now, suppose that you test positive. That means that you’re one of the $14.75$% represented by the first column of the table, and you want to know your chance of being one of the $0.98$% who test positive and have the disease. That probability is $dfrac{0.0098}{0.0593}approx 0.1653$: you have almost one chance in six of having the disease.



            Bayes’ rule boils all of this down to a single formula. We ended up calculating the ratio $$frac{mathrm{Pr}(Dcap T)}{mathrm{Pr}(T)};,$$ but we got the numerator by calculating $mathrm{Pr}(T|D)mathrm{Pr}(D)$, so in fact we calculated



            $$mathrm{Pr}(D|T)=frac{mathrm{Pr}(T|D)mathrm{Pr}(D)}{mathrm{Pr}(T)};,$$



            which is Bayes’ rule.



            In this case we also had to work a bit to get the denominator; that’s typical.







            share|cite|improve this answer














            share|cite|improve this answer



            share|cite|improve this answer








            edited Sep 18 '12 at 20:13

























            answered Sep 18 '12 at 19:51









            Brian M. Scott

            454k38505906




            454k38505906












            • So first off, thanks for taking the time to write out this answer. Second, .98 * .01 = .0098 right?
              – user13327
              Sep 18 '12 at 20:03










            • @Silver: It is indeed. sigh Fixed now. Thanks.
              – Brian M. Scott
              Sep 18 '12 at 20:13


















            • So first off, thanks for taking the time to write out this answer. Second, .98 * .01 = .0098 right?
              – user13327
              Sep 18 '12 at 20:03










            • @Silver: It is indeed. sigh Fixed now. Thanks.
              – Brian M. Scott
              Sep 18 '12 at 20:13
















            So first off, thanks for taking the time to write out this answer. Second, .98 * .01 = .0098 right?
            – user13327
            Sep 18 '12 at 20:03




            So first off, thanks for taking the time to write out this answer. Second, .98 * .01 = .0098 right?
            – user13327
            Sep 18 '12 at 20:03












            @Silver: It is indeed. sigh Fixed now. Thanks.
            – Brian M. Scott
            Sep 18 '12 at 20:13




            @Silver: It is indeed. sigh Fixed now. Thanks.
            – Brian M. Scott
            Sep 18 '12 at 20:13


















            draft saved

            draft discarded




















































            Thanks for contributing an answer to Mathematics Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            Use MathJax to format equations. MathJax reference.


            To learn more, see our tips on writing great answers.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f198677%2fhow-to-calculate-prdiseased-2-positive-tests%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Ellipse (mathématiques)

            Quarter-circle Tiles

            Mont Emei