1. ## Help with Bayesian question please

Just got a question with Bayes problem, I always struggle to understand the actual question in Bayes problems so that could be why I'm stuck, but would really appreciate your help

specificity of 0.90 and sensitivity of 0.98. population prevalence is 1/10 000

Question is what is the prob. that a person who has got two consecutive positive results is ill?

and another one is support you want the prob. of a person being ill after one positive test result to be 0.80, keeping sensitivity and prevalence constant. What is the minimal level of specificity to guarantee that outcome?

Thanks guys!

2. ## Re: Help with Bayesian question please

For the first I think you may just multiply the SEN times itself.

I thik you need to write out the second question verbatim, I am missing something.

3. ## The Following User Says Thank You to hlsmith For This Useful Post:

jamessuh36 (07-23-2015)

4. ## Re: Help with Bayesian question please

hi,
there is a rather easy way to calculate the numbers: imagine you test one million people. You have in total 100 with the illness, out of those 98 will be recognized. You also have a 10% false alarms so in total 100 098 positive cases oit of which 98 are real so the probability is 98/100098 of being actually ill after a first test.

Now imagine repeating the test with those who tested positive the first time - you have 100098 cases out of which 98 are real. Of thos 96 will be recognized by the test ( 98*0.98) and you will again have a 10% false alarms i.e. 10000. So your probability of being ill will be 96/10096.

As for the second question: again taking the case of one million you will get 98 real cases plus x false alarms. In order to get a probability of 0.8 of being a real case after one test you need to solve 98/(98+x) =0.8 for x and you get x= 245. so out of 1 million tests you are allowed to have 245 false alarms .

Regards

5. ## The Following User Says Thank You to rogojel For This Useful Post:

JesperHP (07-23-2015)

6. ## Re: Help with Bayesian question please

rogojel, I like your style, but you are going to have to sell me on this one. I admit that I did not give it enough thought last night. What I meant to say was square PPV, so 90/19,998 - given your numbers. I will investigate this further, but I don't know that you need to assume a whole population took the test and adjust the pre-test probability for the second test. I say this just based on the presented wording. You would perhaps do that if a the test was applied to a whole, sample, but I may be wrong. Though if you adjusted the numbers based on 1 person, then I would imagine that there would not be a noticeable difference and you would get the same probability, thus square the PPV.

7. ## Re: Help with Bayesian question please

Is this a homework question?

8. ## Re: Help with Bayesian question please

No Dason, peoples lives are on the line. We have to solve this ASAP, but first I have to go to a baseball game.

9. ## Re: Help with Bayesian question please

Well I just ask because they should find out from their professor if they are supposed to assume that the readings are iid with the same specificity and sensitivity. In real life I wouldn't assume that consecutive draws are independent.

10. ## Re: Help with Bayesian question please

I get what you are saying, but jamesuh36 needs us, and I love the number 36 - who doesn't.

I am assuming that the test are independent and the outcome of the first does not change the pretest probability of the second test. And the probability after the first test is 0.0045. So given this, I believe you would take 0.0045*0.0045.

11. ## Re: Help with Bayesian question please

I am ranting, but you could take

pre-test odds * +LR = .0004 * 45 = 1.8% then multiply again by 45 to account for the second test and get: 81%

That approach would take into account prior 0.0004 and new prior 1.8%, AKA the results of the first test.

12. ## Re: Help with Bayesian question please

I don't get .0045 as the answer and I don't believe you are correct in saying that you would just square the PPV.

What you would do is repeat the calculation but you would square the sensitivity and specificity and use those as the "new" sensitivity and specificity.

13. ## Re: Help with Bayesian question please

hi hlsmith,
this is a way to do the bayes calculations in an easy way. You do not actually assume sampling any number, you just have to imagine a large enough population that your probability numbers come out as integers e.g. for a prevalence of 10^-4 imagining 10^6 samples is just handy because you get exactly 100 true cases, and so on. To me this way of calculating seems quite easy to follow and it should give the same probabilities as a rigorous Bayes-based calculation.

I have the method from the book Risk by Gerd Gigerenzer , he devised it as a way to enable doctors to use bayes calculation in practice.

14. ## Re: Help with Bayesian question please

I like the method of using integers and thinking of them as cases to make it more concrete. But with that said I think your math got mixed up somewhere along the line - I'm getting different answers.

15. ## Re: Help with Bayesian question please

hi Dason,
you are right, the numbers are slightly off.
if I test 1 000 000 cases, there are 100 true illnesses and 999 900 healthy cases. Out of those 99 990 wil be falsely identified as ill. So the probability of being ill if tested positively is 98/(99990+98) ...and so on. I forgot to deduct the true illnesses from the tested population. I hope it works now.

regards

16. ## The Following User Says Thank You to rogojel For This Useful Post:

jamessuh36 (07-23-2015)

17. ## Re: Help with Bayesian question please

That looks better to me.

18. ## The Following User Says Thank You to Dason For This Useful Post:

rogojel (07-23-2015)

19. ## Re: Help with Bayesian question please

Hey guys, thanks for your help.

- it is a homework problem lol
- we do need to assume that it's independent
- i dont think ppv comes into this question just yet, or am I wrong on that one? because we haven't had a class on PPV yet

Cheers