Tuesday, July 7, 2009

Notes on Bayesian probability

You can find notes on Bayesian probability in three posts from last term you can find through this link. Here are a few more practice problems, with answers in the comments.

A) A trait shows up in 20% of the population and the test has a 2% error rate. Find p(error given test positive) and p(error, given test negative).

B) A trait shows up in 10% of the population and the test has a 1% error rate. Find p(error given test positive) and p(error, given test negative).

2 comments:

  1. I agree with all of the steps taken, but it should be a total of 892 for test -. this comes from subtracting 900-9=891.

    ReplyDelete
  2. You are right, thanks. Here's the correction.

    A) A trait shows up in 20% of the population and the test has a 2% error rate. Find p(error given test positive) and p(error, given test negative).

    20% = 1/5 and 2% = 1/50 so the grand total is 250.

    _______don't have__have
    test +_________________
    test -_________________
    totals_________________ 250

    20% of 250 is 50, and 250-50 = 200.

    _______don't have__have
    test +_________________
    test -_________________
    totals______200_____50_ 250

    1/50*50 = 1, so there will be 1 error in have trait, but test negative. Since there will be 5 errors total, there is a 4 in the don't have but test positive slot.

    _______don't have__have
    test +________4________
    test -_______________1_
    totals______200_____50_ 250

    We can fill in the rest using degrees of freedom.

    _______don't have__have
    test +________4_____49_ 53
    test -______196______1_ 197
    totals______200_____50_ 250

    p(error, given test positive) = 4/53 ~= 7.5%
    p(error given test negative) = 1/197 ~= 0.5%


    B) A trait shows up in 10% of the population and the test has a 1% error rate. Find p(error given test positive) and p(error, given test negative).

    10% = 1/10 and 1% = 1/100 so the grand total is 1000.

    _______don't have__have
    test +_________________
    test -_________________
    totals_________________ 1000

    10% of 1000 is 100, and 100-100 = 900.

    _______don't have__have
    test +_________________
    test -_________________
    totals____900______100_ 1000

    1/100*100 = 1, so there will be 1 error in have trait, but test negative. Since there will be 10 errors total, there is a 9 in the don't have but test positive slot.

    _______don't have__have
    test +______9__________
    test -_______________1_
    totals____900______100_ 1000

    We can fill in the rest using degrees of freedom.

    _______don't have__have
    test +______9_______99_ 108
    test -____891________1_ 892
    totals____900______100_ 1000

    p(error, given test positive) = 9/108 ~= 8.3%
    p(error given test negative) = 1/892 ~= 0.1%

    ReplyDelete