+ Reply to Thread
Page 4 of 4 FirstFirst 1 2 3 4
Results 46 to 49 of 49

Thread: Help with Bayesian question please

  1. #46
    Omega Contributor
    Points: 38,413, Level: 100
    Level completed: 0%, Points required for next Level: 0
    hlsmith's Avatar
    Location
    Not Ames, IA
    Posts
    7,004
    Thanks
    398
    Thanked 1,186 Times in 1,147 Posts

    Re: Help with Bayesian question please




    Silly, silly, silly me! I never checked your guys numbers. I made the mistake of trusting your arithmetic over mine. Probably because you usually seem correct and there were two of you. I was just getting ready to type out a huge reply with how I used the Simple Bayes Theorem based on odds. Then I went back to write out the results every way you could calculate them and was going to reference your calculations. That is when I saw you both had your numbers mixed up. I will show you below. If you are interested in my approach, Google search: Bayes Likelihood Ratio, you will get hundreds of thousands of hits. Also, below I once again included the calculation for repeated testing.


    Quote Originally Posted by Dason View Post
    I hate to keep this going but I'm going to just flat out say that your number for P(D+ | T+) is wrong.

    P(D+ | T+) = \frac{P(T+ | D+)P(D+)}{P(T+ | D+)P(D+) + P(T+ | D-)P(D-)}
    = \frac{.98*.0001}{.98*.0001 + (1 - .9)*(1 - .0001)} = .0009791384

    Rogojel and I both come to that solution.

    The formula is correct you just switched numbers around. It should be:


    = \frac{0.90*0.0001}{0.90*0.0001 + ((1 - 0.98)*(1 - 0.0001))} = .0045






    Original Information:


    Prevalence or Pre-Test Probability or Prior: 0.0001


    Given the increased sample size of 1,000,000


    Sensitivity (P(T+|D+): 90/100 = 0.90


    Specificity (P(T+|D-): 979902/999900 = .98


    Positive Likelihood Ratio (+LR): SEN/(1-SPEC): 0.90/0.02 = 45




    Simple Bayes Theorem based on Odds:


    P(D+|T+) = Pre-Test Odds * +LR = Post-Test Odds


    Post-Test Odds: (0.0001/(1+0.0001)) * 45 = 0.0045


    Post-Test Probability: 0.0045 / (1-0.0045) = 0.0045




    Formula For Serial Tests:


    Post-Test Odds = Pre-test Odds * +LR1 * +LR2


    +LR due to repeat test will always by 45 in this case, so:


    0.0001 * 45 * 45


    ~ 0.167, after two positive tests.


    _____________________________________________________________________

    Lastly, a very very simple way to get at the Post-Test Probability after a test is just to report the Positive Predictive Value, which is just the first cell in the 2x2 classification table divided by the first row total.


    Stop cowardice, ban guns!

  2. #47
    Devorador de queso
    Points: 95,940, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Awards:
    Posting AwardCommunity AwardDiscussion EnderFrequent Poster
    Dason's Avatar
    Location
    Tampa, FL
    Posts
    12,937
    Thanks
    307
    Thanked 2,630 Times in 2,246 Posts

    Re: Help with Bayesian question please

    I disagree that I got the numbers mixed up. OP says sensitivity is .98 which is the true positive rate which is P(T+ | D+).

    Also in your last post you say
    Specificity (P(T+|D-)
    but specificity is P(T- | D-)
    I don't have emotions and sometimes that makes me very sad.

  3. #48
    Omega Contributor
    Points: 38,413, Level: 100
    Level completed: 0%, Points required for next Level: 0
    hlsmith's Avatar
    Location
    Not Ames, IA
    Posts
    7,004
    Thanks
    398
    Thanked 1,186 Times in 1,147 Posts

    Re: Help with Bayesian question please

    Well there is the issue, I was switching the two numbers around in my head. You typically present the SEN before the SPEC in results and I was erroneously switching them in my calculations. I will repost #46
    Stop cowardice, ban guns!

  4. #49
    Omega Contributor
    Points: 38,413, Level: 100
    Level completed: 0%, Points required for next Level: 0
    hlsmith's Avatar
    Location
    Not Ames, IA
    Posts
    7,004
    Thanks
    398
    Thanked 1,186 Times in 1,147 Posts

    Re: Help with Bayesian question please


    Yup, writing that out definitely helped me figure out where my issue was. You two were totally right!


    Original Information:


    Prevalence or Pre-Test Probability or Prior: 0.0001


    Given the increased sample size of 1,000,000


    Sensitivity (P(T+|D+): 98/100 = 0.98


    Specificity (P(T-|D-): 899910/899912 = .90


    Positive Likelihood Ratio (+LR): SEN/(1-SPEC): 0.98/0.10 = 9.8




    Simple Bayes Theorem based on Odds:


    P(D+|T+) = Pre-Test Odds * +LR = Post-Test Odds


    Post-Test Odds: (0.0001/(1+0.0001)) * 9.8 = 0.00098


    Post-Test Probability: 0.00098 / (1-0.00098) = 0.00098




    Formula For Serial Tests:


    Post-Test Odds = Pre-test Odds * +LR1 * +LR2


    +LR due to repeat test will always by 9.8 in this case, so:


    0.0001 * 9.8 * 9.8


    ~ 0.0096, after two positive tests.
    Stop cowardice, ban guns!

+ Reply to Thread
Page 4 of 4 FirstFirst 1 2 3 4

           




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts






Advertise on Talk Stats