Introduction to probability
Advertisement
This presentation is the property of its rightful owner.
1 / 69

Introduction to probability PowerPoint PPT Presentation

Introduction to probability. Probability . Probability – the chance that an uncertain event will occur (always between 0 and 1) Symbols: P(event A) = “the probability that event A will occur” P(red card) = “the probability of a red card”

Download Presentation

Introduction to probability

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


Introduction to probability

Introduction to probability


Probability

Probability

  • Probability – the chance that an uncertain event will occur (always between 0 and 1)

    Symbols:

    P(event A) = “the probability that event A will occur”

    P(red card) = “the probability of a red card”

    P(~event A) = “the probability of NOT getting event A” [complement]

    P(~red card) = “the probability of NOT getting a red card”

    P(A & B) = “the probability that both A and B happen” [joint probability]

    P(red card & ace) = “the probability of getting a red ace”


Assessing probability

Assessing Probability

1. Theoretical probability—based on theory (a priori understanding of a phenomena)

e.g.: theoretical probability of rolling a 2 on a standard die is 1/6

theoretical probability of choosing an ace from a standard deck is 4/52

theoretical probability of getting heads on a regular coin is 1/2

2. Empirical probability—based on empirical data

e.g.: you toss an irregular die (probabilities unknown) 100 times and find that you get a two 25 times; empirical probability of rolling a two is 1/4

empirical probability of a major Earthquake (>=6.7 on the Richter scale) in Bay Area by 2032 is .62 (based on historical data)

empirical probability of a lifetime smoker developing lung cancer is 15 percent (based on empirical data)


Probability example

Probability example

  • Sample space: the set of all possible outcomes.

    For example, in genetics, if both the mother and father carry one copy of a recessive disease-causing mutation (d), there are three possible outcomes (the sample space):

    • child is not a carrier (DD)

    • child is a carrier (Dd)

    • child has the disease (dd).

  • Probabilities: the likelihood of each of the possible outcomes (always 0 P 1.0).

    • P(genotype=DD)=.25

    • P(genotype=Dd)=.50

    • P(genotype=dd)=.25.

Note: mutually exclusive, exhaustive probabilities sum to 1.


U sing a probability tree

Child’s outcome

Father’s allele

Mother’s allele

P(DD)=.5*.5=.25

P(♂D=.5)

P(♀D=.5)

P(♂d=.5)

P(Dd)=.5*.5=.25

P(♂D=.5)

P(dD)=.5*.5=.25

P(♀d=.5)

P(dd)=.5*.5=.25

______________

1.0

P(♂d=.5)

Using a probability tree

Mendel example: What’s the chance of having a heterozygote child (Dd) if both parents are heterozygous (Dd)?

Rule of thumb: in probability, “and” means multiply, “or” means add


Independence

Conditional Probability: Read as “the probability that the father passes a D allele given that the mother passes a d allele.”

Independence

Intuitively, we understand that the mother’s and father’s outcomes are independent. The mother’s and father’s alleles are segregating independently.

Intuitively, independence means that the probability of A happening does not change depending on whether B happens and vice versa.

It’s easy to see on the probability tree: the father’s probabilities are the same regardless of which maternal branch you’re on:

P(♂D/♀D)=.5 and P(♂D/♀d)=.5


Independence1

Joint Probability: The probability of two events happening simultaneously.

Marginal probability: This is the probability that an event happens at all, ignoring all other outcomes.

Independence

Formal definition:

A and B are independent if and only if P(A&B)=P(A)*P(B)

Formally, P(DD)=.25=P(D♂)*P(D♀)


On the tree

Conditional probability

Child’s outcome

Marginal probability: mother

Mother’s allele

Joint probability

P(DD)=.5*.5=.25

P(♀D=.5)

P(Dd)=.5*.5=.25

P(dD)=.5*.5=.25

P(♀d=.5)

P(dd)=.5*.5=.25

______________

1.0

Sum to get Marginal probability for the father

On the tree

Father’s allele

P(♂D/ ♀D )=.5

P(♂d=.5)

P(♂D=.5)

P(♂d=.5)


Probabilities for cards

Probabilities for cards

  • What is the probability of picking 2 aces from a full deck?


On the tree1

P(Ace=3/51)

P(Ace=4/52)

P(~Ace=48/51)

P(Ace=4/51)

P(~Ace=48/52)

P(~Ace=47/51)

On the tree

Outcome

Draw 2

Draw 1

______________

1.0


On the tree2

Outcome

______________

1.0

On the tree

Are the events (draw ace on the first and draw ace on the second) independent?

Intuitively Probabilities change depending on the outcome of the first draw.

Mathematically

P(Ace1)=.0045+.0723 =.0768 (marginal)


On the tree3

Outcome

______________

1.0

On the tree

Are the events (draw ace on the first and draw ace on the second) independent?

Intuitively Probabilities change depending on the outcome of the first draw.

Mathematically

P(Ace1)=.0045+.0723 =.0768 (marginal)

P(Ace2) = .0045 + .0723 = .0768 (marginal)


On the tree4

Outcome

______________

1.0

On the tree

  • Are the events (draw ace on the first and draw ace on the second) independent?

    Intuitively Probabilities change depending on the outcome of the first draw.

    Mathematically

  • P(Ace1)=.0045+.0723 =.0768 (marginal)

  • P(Ace2) = .0045 + .0723 = .0768 (marginal)

  • P(Ace1)* P(Ace2)=.0768*.0768 = .0059

  • P(ace,ace)=.0045 (joint)

  • NOT independent!


Practice problem

Practice problem

If HIV has a prevalence of 3% in San Francisco, and a particular HIV test has a false positive rate of .001 and a false negative rate of .01, what is the probability that a random person selected off the street will test positive?


Answer

Joint probability of being + and testing +

Conditional probability: the probability of testing + given that a person is +

Marginal probability of carrying the virus.

P(test +)=.99

P(+)=.03

P(test - )= .01

P(test +) = .001

P(-)=.97

P(test -) = .999

Marginal probability of testing positive

Answer

P (+, test +)=.0297

P(+, test -)=.003

P(-, test +)=.00097

P(-, test -) = .96903

______________

1.0

P(test +)=.0297+.00097=.03067

P(+&test+)P(+)*P(test+)

.0297 .03*.03067 (=.00092)

 Dependent!


Law of total probability

One of these has to be true (mutually exclusive, collectively exhaustive). They sum to 1.0.

Law of total probability


Review question 1

Review Question 1

  • What is the probability of rolling a total of 8 on two dice?

  • 1/36

  • 8/36

  • 1/6

  • 5/36

  • 4/6


Review question 11

Review Question 1

  • What is the probability of rolling a total of 8 on two dice?

  • 1/36

  • 8/36

  • 1/6

  • 5/36

  • 4/6

36 ways to roll two die (6x6).

5 ways to get an 8:

5-3, 3-5, 4-4, 2-6, 6-2


Review question 2

Review Question 2

  • What is the probability of rolling two sixes in a row?

  • 1/36

  • 8/36

  • 1/6

  • 5/36

  • 4/6


Review question 21

Review Question 2

  • What is the probability of rolling two sixes in a row?

  • 1/36

  • 8/36

  • 1/6

  • 5/36

  • 4/6

P(6&6) = P(6)*P(6)

by independence

So P(6&6) = 1/6*1/6 = 1/36


Review question 3

Review Question 3

  • The probability of getting a straight flush from a fair deck of 52 cards is an example of:

  • An empirical probability

  • A theoretical probability

  • None of the above

  • Both of the above


Review question 31

Review Question 3

  • The probability of getting a straight flush from a fair deck of 52 cards is an example of:

  • An empirical probability

  • A theoretical probability

  • None of the above

  • Both of the above


Review question 4

Review Question 4

  • Which of the following is an example of statistically independent events?

  • P(A)=.2; P(B)=.5; P(A&B) = .07

  • P(A)=.2; P(B)=.5; P(A&B) = .10

  • P(A)=.2; P(B)=.5; P(A&B) = .70

  • P(A)=.2; P(B)=.5; P(A&B) = 0


Review question 41

Review Question 4

  • Which of the following is an example of statistically independent events?

  • P(A)=.2; P(B)=.5; P(A&B) = .07

  • P(A)=.2; P(B)=.5; P(A&B) = .10

  • P(A)=.2; P(B)=.5; P(A&B) = .70

  • P(A)=.2; P(B)=.5; P(A&B) = 0


Review question 5

Review Question 5

The “law of total probability” gives you:

  • A conditional probability

  • A marginal probability

  • A joint probability

  • All of the above

  • None of the above


Review question 51

Review Question 5

The “law of total probability” gives you:

  • A conditional probability

  • A marginal probability

  • A joint probability

  • All of the above

  • None of the above


Bayes rule

Bayes’ rule


Bayes rule derivation optional

Bayes’ Rule derivation (optional)

  • Definition:

    Let A and B be two events with P(B)  0. The conditional probability of A given B is:

The idea: if we are given that the event B occurred, the relevant sample space is reduced to B—eg, the P(B)=1 because we know B is true—and the probability of A is simply the proportion of B that’s also A (joint probability).


Example

40% chance of failing both

50% chance of failing the midterm

50% chance of failing the class

Example:

A

A&B

B

Sample space


Once i ve failed the midterm

Once I’ve failed the midterm…

A&B

B


Once i ve failed the midterm1

Once I’ve failed the midterm…

Sample space is reduced to this 50%.

A&B

B

What’s the probability of A now that we’re restricted to B? It’s the A&B proportion of B:


Bayes rule derivation optional1

Bayes’ Rule derivation (optional)

can be re-arranged to:

and, since also:


Bayes rule1

From the “Law of Total Probability”

Bayes’ Rule:

OR


Bayes rule2

Bayes’ Rule:

  • Why do we care??

  • Why is Bayes’ Rule useful??

  • It turns out that sometimes it is very useful to be able to “flip” conditional probabilities. That is, we may know the probability of A given B, but the probability of B given A may not be obvious. An example will help…


Practice problem1

Practice Problem

  • If HIV has a prevalence of 3% in San Francisco, and a particular HIV test has a false positive rate of .001 and a false negative rate of .01, what is the probability that a random person who tests positive is actually infected (also known as “positive predictive value”)?


Answer using probability tree

P (+, test +)=.0297

P(test +)=.99

P(+)=.03

P(test - = .01)

P(+, test -)=.003

P(test +) = .001

P(-, test +)=.00097

P(-)=.97

P(-, test -) = .96903

P(test -) = .999

______________

1.0

Answer: using probability tree

A positive test places one on either of the two “test +” branches.

But only the top branch also fulfills the event “true infection.”

Therefore, the probability of being infected is the probability of being on the top branch given that you are on one of the two circled branches above.


Equivalently using bayes rule

Equivalently, using Bayes’ rule


In class exercise in groups of 2 3

In-class exercise (in groups of 2-3)

An insurance company believes that drivers can be divided into two classes—those that are of high risk and those that are of low risk. Their statistics show that a high-risk driver will have an accident at some time within a year with probability .4, but this probability is only .1 for low risk drivers.

  • Assuming that 20% of the drivers are high-risk, what is the probability that a new policy holder will have an accident within a year of purchasing a policy?

  • If a new policy holder has an accident within a year of purchasing a policy, what is the probability that he is a high-risk type driver?


Answer to a

Answer to (a)

Assuming that 20% of the drivers are of high-risk, what is the probability that a new policy holder will have an accident within a year of purchasing a policy?

Use law of total probability:

P(accident)=

P(accident/high risk)*P(high risk) +

P(accident/low risk)*P(low risk) =

.40(.20) + .10(.80) = .08 + .08 = .16


Answer to b

P(accident, high risk)=.08

P(accident/HR)=.4

P(high risk)=.20

P( no acc/HR)=.6

P(no accident, high risk)=.12)

P(accident/LR)=.1

P(accident, low risk)=.08

P(low risk)=.80

P( no accident/LR)=.9

P(no accident, low risk)=.72

______________

1.0

Answer to (b)

If a new policy holder has an accident within a year of purchasing a policy, what is the probability that he is a high-risk type driver?

P(high-risk/accident)=

P(accident/high risk)*P(high risk)/P(accident)

=.40(.20)/.16 = 50%

Or use tree:

P(high risk/accident)=.08/.16=50%


The risk ratio and the odds ratio as conditional probability

The Risk Ratio and the Odds Ratio as conditional probability

In epidemiology, the association between a risk factor or protective factor (exposure) and a disease may be evaluated by the “risk ratio” (RR) or the “odds ratio” (OR).

Both are measures of “relative risk”—the general concept of comparing disease risks in exposed vs. unexposed individuals.


Odds vs risk probability

Odds vs. Risk=probability

1:1

3:1

1:9

1:99

Note: An odds is always higher than its corresponding probability, unless the probability is 100%.


Cohort studies

Exposed

Disease-free cohort

Not Exposed

Cohort Studies

Disease

Disease-free

Target population

Disease

Disease-free

TIME


Intro to probability

Exposure (E)

No Exposure (~E)

Disease (D)

a

b

No Disease (~D)

c

d

a+c

b+d

risk to the exposed

risk to the unexposed

The Risk Ratio, or Relative Risk (RR)


Hypothetical data

Normal BP

Congestive Heart Failure

High Systolic BP

No CHF

400

400

1500

3000

1100

2600

Hypothetical Data


The odds ratio

The odds ratio…

  • This risk ratio seems like the perfect measure of relative risk. Why not stop here? Why introduce the more complicated odds ratio??

  • We cannot calculate a risk ratio from a case-control study. Case-control studies are a popular study design in epidemiology, because they are useful for studying rare diseases.

  • In a case-control study, we sample conditional on disease status, so we cannot calculate risk of disease.


Case control studies

Case-Control Studies

Disease

(Cases)

Exposed in past

Not exposed

Target population

Exposed

No Disease

(Controls)

Not Exposed


Intro to probability

Hep C +

Hep C -

Cases: Liver cancer

90

10

Controls

30

70

The Odds Ratio (OR)

100

100

What are P(D/E) and P(D/~E) here?

We can’t tell, because, by design, we have fixed the proportion of liver cancer cases in this sample at 50% simply by selecting half controls and half cases.

All these data give us is: P(E/D) and P(E/~D).


Intro to probability

Hep C +

Hep C -

Cases: Liver cancer

90

10

Controls

30

70

Unfortunately, our sampling scheme precludes calculation of the marginals: P(E) and P(D), but turns out we don’t need these if we use an odds ratio because the marginals cancel out!

The Odds Ratio (OR)

100

100

by Bayes’ Rule…

Luckily, P(E/D) [=the quantity you have] 


Intro to probability

Odds of disease in the exposed

Odds of exposure in the cases

Odds of disease in the unexposed

Odds of exposure in the controls

The Odds Ratio (OR)

This expression is mathematically equivalent to:

Backward from what we want…

The direction of interest!


Intro to probability

Proof:

Odds of exposure in the cases

Odds of exposure in the controls

Bayes’ Rule

Odds of disease in the exposed

What we want!

Odds of disease in the unexposed

=


Intro to probability

Hep C +

Hep C -

Cases: Liver cancer

90

10

Controls

30

70

The odds ratio

100

100

  • Interpretation: there is a 21-fold higher odds of stroke in those who are Hep C +.


Interpretation of the odds ratio

Interpretation of the odds ratio:

  • The odds ratio will always be bigger than the corresponding risk ratio if RR >1 and smaller if RR <1 (the harmful or protective effect always appears larger)

  • The magnitude of the inflation depends on the prevalence of the disease.


The rare disease assumption

1

1

When a disease is rare:

P(~D) = 1 - P(D)  1

The rare disease assumption


The odds ratio vs the risk ratio

Odds ratio

Odds ratio

Odds ratio

Risk ratio

Risk ratio

Odds ratio

Risk ratio

Risk ratio

The odds ratio vs. the risk ratio

Rare Outcome

1.0 (null)

Common Outcome

1.0 (null)


Interpreting ors when the outcome is common

Interpreting ORs when the outcome is common…

  • A cross-sectional study on risk factors for wrinkles found that heavy smoking significantly increases the risk of prominent wrinkles.

    • Adjusted OR=3.92 (heavy smokers vs. nonsmokers)

    • Interpretation: heavy smoking increases risk of prominent wrinkles nearly 4-fold?

    • The prevalence of prominent wrinkles in non-smokers is roughly 45%. So, it’s not possible to have a 4-fold increase in risk!

    • In fact, though the OR=3.92, the RR is closer to 2. Still a huge absolute increase, but not a 4-fold increase!

Raduan et al. J Eur Acad Dermatol Venereol. 2008 Jul 3.


Interpreting ors when the outcome is common1

Interpreting ORs when the outcome is common…

  • If the outcome has a 10% prevalence in the unexposed group, the maximum possible RR=10.0.

  • For 20% prevalence, the maximum possible RR=5.0

  • For 30% prevalence, the maximum possible RR=3.3.

  • For 40% prevalence, maximum possible RR=2.5.

  • For 50% prevalence, maximum possible RR=2.0.

  • The prevalence of the outcome in the unexposed group is often NOT given! So, you have to estimate or consult other data.


Review question 6

Hep C +

Hep C -

Cases: Liver cancer

10

50

Controls

10

100

Review Question 6

What is the odds ratio from this case-control study of liver cancer and Hep C?

  • 2.0

  • 1.5

  • 0.5

  • 3.0

  • Cannot calculate


Review question 61

Hep C +

Hep C -

Cases: Liver cancer

10

50

Controls

10

100

Review Question 6

What is the odds ratio from this case-control study of liver cancer and Hep C?

  • 2.0

  • 1.5

  • 0.5

  • 3.0

  • Cannot calculate


Review question 7

Hep C +

Hep C -

Cases: Liver cancer

10

50

Controls

10

100

Review Question 7

What is the risk ratio from this case-control study of liver cancer and Hep C?

  • 2.0

  • 1.5

  • 0.5

  • 3.0

  • Cannot calculate


Review question 71

Hep C +

Hep C -

Cases: Liver cancer

10

50

Controls

10

100

Review Question 7

What is the risk ratio from this case-control study of liver cancer and Hep C?

  • 2.0

  • 1.5

  • 0.5

  • 3.0

  • Cannot calculate


Review question 8

Review Question 8

If a patient has a 10% chance of a bad outcome, what are her odds of a bad outcome?

  • 1/10

  • 1/9

  • 1/11

  • 1/100

  • Cannot calculate


Review question 81

Review Question 8

If a patient has a 10% chance of a bad outcome, what are her odds of a bad outcome?

  • 1/10

  • 1/9

  • 1/11

  • 1/100

  • Cannot calculate


Review question 9

Review Question 9

If the true risk ratio for the chance of developing breast cancer for exercisers vs. sedentary women is .43, what is a possible value for the true OR?

  • .41

  • .45

  • 1.0

  • 2.0

  • Cannot determine


Review question 91

Review Question 9

If the true risk ratio for the chance of developing breast cancer for exercisers vs. sedentary women is .43, what is a possible value for the true OR?

  • .41

  • .45

  • 1.0

  • 2.0

  • Cannot determine


Thought problem

Thought problem…

  • You are on the Monty Hall show. You are presented with 3 doors (A, B, C), only one of which has something valuable to you behind it. You do not know what is behind any of the doors. You choose door A; Monty Hall opens door B and shows you that there is nothing behind it. Then he gives you the option of sticking with A or switching to C. Do you stay or switch? Does it matter?


Some monty hall links

Some Monty Hall links…

  • http://query.nytimes.com/gst/fullpage.html?res=9D0CEFDD1E3FF932A15754C0A967958260&sec=&spon=&pagewanted=all

  • http://www.nytimes.com/2008/04/08/science/08tier.html?_r=1&em&ex=1207972800&en=81bdecc33f60033e&ei=5087%0A&oref=slogin

  • http://www.nytimes.com/2008/04/08/science/08monty.html#


Homework assignment

Homework assignment…

  • Problem set 2

  • Read the assigned journal article, and fill out a review sheet.


Intro to probability

  • Who wants to lead the journal article discussion next week?


  • Login