Bayesian Inference I 42312 Law of total probability
Bayesian Inference I 4/23/12 • Law of total probability • Bayes Rule Section 11. 2 (pdf) Professor Kari Lock Morgan Duke University
To Do • Project 2 Paper (Wednesday, 4/25) • FINAL: Monday, 4/30, 9 – 12
Comments on Projects • Conditions apply to overall model; not each variable individually • R 2 is the proportion of variability in the response that is explained by the explanatory variables (not adjusted R 2) • Coefficients and significance of categorical variables are in reference to the reference level (the category left out) • Don’t take significant predictors out of your model!
FINAL MONDAY, APRIL 30 th 9 – 12 pm Bring: • A calculator • 3 double-sided pages of notes, prepared only by you • The final will cover material from the entire course • The format will be similar to the two in-class exams we’ve had so far, only longer • No make-up exam will be given; 0 if you do not take it • STINFs do NOT apply for the final
Disjoint and Independent Assuming that P(A) > 0 and P(B) > 0, then disjoint events are a) Independent b) Not independent c) Need more information to determine whether the events are also independent
Law of Total Probability • If events B 1 through Bk are disjoint and together make up all possibilities, then B 1 B 3 B 2 A
Sexual Orientation Heterosexual Homosexual Bisexual Other Total Male 2325 105 66 25 2521 Female 2348 23 92 58 2521 Total 4673 128 158 83 5042 P(bisexual) = P(bisexual and male) + P(bisexual and female) = 66/5042 + 92/5042 = 158/5042
Craps • Let’s put it all together! • What’s the probability of winning at Craps?
Craps Rules • Each role consists of rolling two dice • On the first role: • You lose (crap out) if your sum is 2, 3, or 12 • You win if your sum is 7 or 11 • Otherwise, your total is your point and you keep on rolling • On subsequent roles: • You win if the sum equals your point (your total from the first role) • You lose if you role a 7 • Otherwise, you keep rolling Play a game!
Craps Option 1: Simulation Did you win? (a) Yes (b) No Option 2: Probability rules. (see handout) Is it smart to play craps? (a) Yes (b) No
Craps 1. Find P(win if first role = ___) for each of the possibilities. First Role 2 3 4 5 6 7 8 9 10 11 12 P(Win if first role = ___) 0 0 3/9 4/10 5/11 1 5/11 4/10 3/9 1 0
Craps 2. Find P(win and first role = ___) for each of the possibilities. First Role 2 3 4 5 6 7 8 9 10 11 12 P(Win and first role = ___) 0 0 . 028. 044. 063. 167. 063. 044. 028. 056 0
Craps 3. Use the law of total probability to find P(win). First Role 2 3 4 5 6 7 8 9 10 11 P(Win and first role = ___) 0 0 . 028. 044. 063. 167. 063. 044. 028. 056 0 4. Assuming you win the same amount you bet, is it smart to play Craps? No. You are more likely to lose than win. 12
Breast Cancer Screening A 40 -year old woman participates in routine screening and has a positive mammography. What’s the probability she has cancer? a) b) c) d) e) 0 -10% 10 -25% 25 -50% 50 -75% 75 -100% 15
Breast Cancer Screening • 1% of women at age 40 who participate in routine screening have breast cancer. • 80% of women with breast cancer get positive mammographies. • 9. 6% of women without breast cancer get positive mammographies. • A 40 -year old woman participates in routine screening and has a positive mammography. What’s the probability she has cancer? 16
Breast Cancer Screening A 40 -year old woman participates in routine screening and has a positive mammography. What’s the probability she has cancer? a) b) c) d) e) 0 -10% 10 -25% 25 -50% 50 -75% 75 -100% 17
Breast Cancer Screening A 40 -year old woman participates in routine screening and has a positive mammography. What’s the probability she has cancer? What is this asking for? a) b) c) d) e) P(cancer if positive mammography) P(positive mammography if cancer) P(positive mammography if no cancer) P(positive mammography) P(cancer)
Bayes Rule • We know P(positive mammography if cancer)… how do we get to P(cancer if positive mammography)? • How do we go from P(A if B) to P(B if A)?
Bayes Rule <- Bayes Rule 20
Rev. Thomas Bayes 1702 - 1761
Breast Cancer Screening • 1% of women at age 40 who participate in routine screening have breast cancer. • 80% of women with breast cancer get positive mammographies. • 9. 6% of women without breast cancer get positive mammographies.
P(positive) 1. Use the law of total probability to find P(positive). 2. Find P(cancer if positive)
- Slides: 23