Statistics and Quantitative Analysis U4320 · 2001. 1. 31. · Displaying Data n Frequency data can...

20
Copyright Sharyn O'Halloran 2001 Statistics and Quantitative Analysis U4320 Segment 3: Probability Prof. Sharyn O’Halloran

Transcript of Statistics and Quantitative Analysis U4320 · 2001. 1. 31. · Displaying Data n Frequency data can...

Page 1: Statistics and Quantitative Analysis U4320 · 2001. 1. 31. · Displaying Data n Frequency data can be displayed either as a bar chart or as a pie chart. n Example of Homework 1.xls

Copyright Sharyn O'Halloran 2001

Statistics and Quantitative Analysis U4320

Segment 3: ProbabilityProf. Sharyn O’Halloran

Page 2: Statistics and Quantitative Analysis U4320 · 2001. 1. 31. · Displaying Data n Frequency data can be displayed either as a bar chart or as a pie chart. n Example of Homework 1.xls

Copyright Sharyn O'Halloran 2001

Review: Descriptive Statistics

Code book for Measures Religion Employed 1. Catholic 0. Unemployed 2. Protestant 1. Employed 3. Other 9. DK, NA 9. Don't Know, No Answer Income Class Lower Upper Measured in Thousands of $ 1. Lower 0. Other 0. Other -99. DK, NA 2. Middle 1. Lower 1. Upper 3. Upper 9. DK, NA 9. DK, NA 9. DK, NA

Sample Data

Page 3: Statistics and Quantitative Analysis U4320 · 2001. 1. 31. · Displaying Data n Frequency data can be displayed either as a bar chart or as a pie chart. n Example of Homework 1.xls

Copyright Sharyn O'Halloran 2001

Review: Descriptive Statistics Case Religion Employed Class Lower Upper Income 1 1 0 1 1 0 8 2 3 0 3 0 1 35 3 2 0 2 0 0 20 4 1 1 2 0 0 12 5 1 1 3 0 1 37 6 2 1 1 1 0 14 7 3 0 2 0 0 20 8 2 0 2 0 0 18 9 2 9 1 1 0 -99 10 9 0 9 9 9 11 Mode 2 0 2 0 0 20 Median N/A 0 2 0 0 18 Mean N/A .33 N/A .33 .22 19.44 Variance N/A .223 N/A .223 .173 93.36 Standard Deviation

N/A .471 N/A .471 .416 9.66

Survey Data— Matrix of Cases and Measured Variables:

Page 4: Statistics and Quantitative Analysis U4320 · 2001. 1. 31. · Displaying Data n Frequency data can be displayed either as a bar chart or as a pie chart. n Example of Homework 1.xls

Copyright Sharyn O'Halloran 2001

Frequency Tables

RELIGION

RELIGION CODED VALUE FREQUENCY CATHOLIC 1 3

PROTESTANT 2 4 OTHER 3 2 DK, NA 1 MODE PROTESTANT (2) .

CLASS

CLASS CODED VALUE FREQUENCY LOWER 1 3 MIDDLE 2 4 UPPER 3 2 DK, NA 1 MODE MIDDLE (2)

MEDIAN MIDDLE (2)

EMPLOYMENT

EMPLOYED CODED VALUE FREQUENCY UNEMPLOYED 0 6

EMPLOYED 1 3 DK, NA 1 MODE UNEMPLOYED (0)

MEDIAN UNEMPLOYED (0) MEAN 1/3

Mapping raw data into a frequency table

Frequency:Number of times we observe an event

Page 5: Statistics and Quantitative Analysis U4320 · 2001. 1. 31. · Displaying Data n Frequency data can be displayed either as a bar chart or as a pie chart. n Example of Homework 1.xls

Copyright Sharyn O'Halloran 2001

Displaying Data

n Frequency data can be displayed either as a bar chart or as a pie chart.

n Example of Homework 1.xls

Income by Category

00.5

11.5

22.5

33.5

44.5

LOWER MIDDLE UPPER Don't Know/NA

Income Category

Freq

uenc

y

FREQUENCY

Religion

30%

40%

20%

10%

CATHOLIC

PROTESTANT

OTHER

DK, NA

Page 6: Statistics and Quantitative Analysis U4320 · 2001. 1. 31. · Displaying Data n Frequency data can be displayed either as a bar chart or as a pie chart. n Example of Homework 1.xls

Copyright Sharyn O'Halloran 2001

Calculating Descriptive Statistics Mean

XX

N

ii

N

= =∑

1 or Xx f

N

i ii

N

= =∑

1

Variance

( )1

1

2

2

−=∑=

N

XXs

N

ii

or ( )

11

2

2

−=∑=

N

Xxfs

N

ii

n Example of Homework 1.xls

Page 7: Statistics and Quantitative Analysis U4320 · 2001. 1. 31. · Displaying Data n Frequency data can be displayed either as a bar chart or as a pie chart. n Example of Homework 1.xls

Copyright Sharyn O'Halloran 2001

Example: Employment

Calculate Mean: XX

Ni

i

N

= =∑

1 = 3/9 = 0.33

Calculate Variance: ( )

11

2

2

−=∑=

N

XXs

N

ii

19.33)-(1.33)-(1.33)-(1.33)-(0.33)-(0.33)-(0.33)-(0.33)-(0.33)-(0 22 2222222

2

−++++++++=S

= 0.25.

Standard Deviation:

( )1

1

2

−=

∑=

N

XXs

N

ii

5.025.0 ==s

Why is N=9?

Page 8: Statistics and Quantitative Analysis U4320 · 2001. 1. 31. · Displaying Data n Frequency data can be displayed either as a bar chart or as a pie chart. n Example of Homework 1.xls

Copyright Sharyn O'Halloran 2001

Probability Theory: Overviewn Definition of Probability

n The likelihood or chance that a particular event will occur.

n Probabilities in real life?n The chance of rainfall or being hit by lightning.n The chance that an individual selected at random will have

an income of $50,000.n The chance that a new product will be successful.

n Why are we doing this?n Basic concepts of probability provide the foundation needed

to study distributions of events and statistical inference.

Page 9: Statistics and Quantitative Analysis U4320 · 2001. 1. 31. · Displaying Data n Frequency data can be displayed either as a bar chart or as a pie chart. n Example of Homework 1.xls

Copyright Sharyn O'Halloran 2001

Probability Theory: Elementsn Outcome

n The results of the process or phenomenon under study.

n Event n Each possible type of occurrence or outcome.

n Simple event n A single characteristic or occurrence of event.

n Sample Space n The collection of all possible events.

Page 10: Statistics and Quantitative Analysis U4320 · 2001. 1. 31. · Displaying Data n Frequency data can be displayed either as a bar chart or as a pie chart. n Example of Homework 1.xls

Copyright Sharyn O'Halloran 2001

Probability Theory: Factsn Properties

n Any probability is a number between 0 and 1.n All possible outcomes together must have the probability of 1.n The probability that an event does not occur is 1 minus the

probability that the event does occur.

n Addition Rulen If two event have no outcomes in common,

n the probability that one or the other occurs is the sum of theirindividual probabilities.

n Multiplication Rulen If two events are independent,

n the probability that they both occur together is the product of their individual probabilities.

Page 11: Statistics and Quantitative Analysis U4320 · 2001. 1. 31. · Displaying Data n Frequency data can be displayed either as a bar chart or as a pie chart. n Example of Homework 1.xls

Copyright Sharyn O'Halloran 2001

Probability Theory: Random Eventsn Random phenomena:

n Unpredictable events in the short run but display regular behavior when repeated many times.n Probability describes this regular behavior.n The probability of an event is the proportion of

repetitions in which that event occurs.

n Example: Rolling Dicen probabilities2.xlsn The more times you repeat the process, the

probability converges to the target probability.

Page 12: Statistics and Quantitative Analysis U4320 · 2001. 1. 31. · Displaying Data n Frequency data can be displayed either as a bar chart or as a pie chart. n Example of Homework 1.xls

Copyright Sharyn O'Halloran 2001

Probability Theory: Calculating Probabilities

n Simple Probability n The relative frequency with which events

occur when repeated many times.

( ))(xP

Nxf →

n Property of Large Numbers:n As N gets largen Example: toss a coin

n First ten throws may not be exactly 5 heads and 5 tails.

n But as the number of trials increases, the ratio of heads will tend (converge) towards ½.

Page 13: Statistics and Quantitative Analysis U4320 · 2001. 1. 31. · Displaying Data n Frequency data can be displayed either as a bar chart or as a pie chart. n Example of Homework 1.xls

Copyright Sharyn O'Halloran 2001

Probability Theory: Examplen Experiment: Toss a coin 3 times

n Outcome Space {HHH, HHT, HTH, THH, HTT, THT, TTH, TTT}

( )N

AfAP =)(

( )events of# Total

22

HfH)P( =

375.083)2( ==HP

n Simple probability:n The frequency of an event divided

by the total number of outcomes.

n What is the probability of observing 2 heads in 3 tosses?n 3 outcomes out of 8 that fit the

criteria.

Page 14: Statistics and Quantitative Analysis U4320 · 2001. 1. 31. · Displaying Data n Frequency data can be displayed either as a bar chart or as a pie chart. n Example of Homework 1.xls

Copyright Sharyn O'Halloran 2001

Probability Theory: Compound Eventsn Probability of (A and B)

n Intersection of Events (A ∩ B)n The relative frequency of the events that meet both

criteria.

n Formula:N

AfBAP B) and () and ( =

( )821stH) and 2(

1stH and 2H ==N

HfP

AB

Intersectionof A and B

n Example: n What is the probability of exactly two heads AND having

the first toss be heads?

Page 15: Statistics and Quantitative Analysis U4320 · 2001. 1. 31. · Displaying Data n Frequency data can be displayed either as a bar chart or as a pie chart. n Example of Homework 1.xls

Copyright Sharyn O'Halloran 2001

Probability Theory: Compound Eventsn Probability of (A or B)

n Union of Events (A ∪ B)

n Definition: n The probability of A or B is the relative frequency

of the events that meet either criteria.

NAf

BAPB)or (

)or ( =

AB

Union of A and B

21

840H)or 2(

0H)or P(2H ===N

Hf

n Example: n What is the probability of getting either exactly 2

heads or no heads at all?

Page 16: Statistics and Quantitative Analysis U4320 · 2001. 1. 31. · Displaying Data n Frequency data can be displayed either as a bar chart or as a pie chart. n Example of Homework 1.xls

Copyright Sharyn O'Halloran 2001

Probability Theory: Conditional Probability

n Probability of (A given B)n Conditional Probability of A occurring

)() and (

)/(BP

BAPBAP =

32

8382

P(2H)2H) and P(1stH

P(1stH/2H) ===

n Example: n What is the probability that the first toss is a head given that

there are exactly two heads?

AB

Intersectionof A and B

Given B

n Definition: n The probability of A given B has occurred.

Page 17: Statistics and Quantitative Analysis U4320 · 2001. 1. 31. · Displaying Data n Frequency data can be displayed either as a bar chart or as a pie chart. n Example of Homework 1.xls

Copyright Sharyn O'Halloran 2001

Example: Martial Status by Age Group

18 to 24 25 to 64 65 and over TotalMarried 3,046 48,116 7,767 58,929Never Married 9,289 9,252 768 19,309Widowed 19 2,425 8,636 11,080Divorced 260 8,916 1,091 10,267Total 12,614 68,709 18,262 99,585

Age

Women Age 18 and over by age and maritial status (thousands)

010,00020,00030,00040,00050,00060,000

Married NeverMarried

Widowed Divorced

category

Num

ber

in th

ousa

nds

Age 18 to 24

Age 25 to 64

Age 65 and over

n Marital.xls example

24) toP(18

24) to18 P(married24) to18 age | P(Married

and=

Page 18: Statistics and Quantitative Analysis U4320 · 2001. 1. 31. · Displaying Data n Frequency data can be displayed either as a bar chart or as a pie chart. n Example of Homework 1.xls

Copyright Sharyn O'Halloran 2001

Probability Theory: Contingency Tables

DIE 1/6 1/6 1/6 1/6 1/6 1/6 COIN 1 2 3 4 5 6 TOTAL

1/2 Heads 1/12 1/12 1/12 1/12 1/12 1/12 1/2 1/2 Tails 1/12 1/12 1/12 1/12 1/12 1/12 1/2

TOTAL 1/6 1/6 1/6 1/6 1/6 1/6 1

n Example: Roll a Dice and Flip a Coin

n What is the probability of T given that you rolled a 6?1216) and (

)6 and ( ==N

HfHP

n Definitionn The joint probability of tossing a Head and Rolling a 6

1/2 = 1/6

1/12 =P(6)

6) AND P(T = P(T/6)

Page 19: Statistics and Quantitative Analysis U4320 · 2001. 1. 31. · Displaying Data n Frequency data can be displayed either as a bar chart or as a pie chart. n Example of Homework 1.xls

Copyright Sharyn O'Halloran 2001

Probability Theory: Independencen Definition:

n The occurrence of one event does not affect the probability of the other.

n Formula: P(A|B) = P(A)

n Interpretation:n If knowing that B occurs gives no information about A, then

A and B are independent events.

n Example of Independent Events:n Rainfall in Tahiti and the percent change of the Dow.

n Example of Non-independent Events:n Income and education

Page 20: Statistics and Quantitative Analysis U4320 · 2001. 1. 31. · Displaying Data n Frequency data can be displayed either as a bar chart or as a pie chart. n Example of Homework 1.xls

Copyright Sharyn O'Halloran 2001

Probability Theory: Independence (con’t)n Example:

n 20% of the students play football, 50% play basketball, and 15% play both.

n How can we put this into a table? FOOTBALL BASKETBALL YES NO TOTAL

YES

NO

TOTAL 100%

n Are playing basketball and football independent? P(B|F) = P(B)

What's the probability that a student selected at random will:

n Play neither sport?

n Play football or basketball?

20% 80%

50%

50%

15%

5%

35%

45%

45%%55

10015355)or (

)or ( =++==N

BFfBFP

%752015

)() and (

)/( ===FP

FBPFBP

%50≠

No, the events are not independent. If you play basketball, also likely to play football