proportions. first, some more probability! why were there so many birthday pairs? 14 people 91 pairs

46
Proportions

Post on 21-Dec-2015

212 views

Category:

Documents


0 download

TRANSCRIPT

Proportions

First, some more probability!

• Why were there so many birthday pairs?

14 people91 pairs

Permutation

An ordered set of events

Boy, Girl Girl, Boy

Combination

An unordered set of events

Boy, Girl Girl, Boyor

If we have a total of N events, the number of permutations

that give k successes and

N - k failures is

Nk ⎛ ⎝ ⎜

⎞ ⎠ ⎟= N!k!N−k( )!.

Permutations - Example

• If you have five children, three boys and two girls, how many possible birth orders are there?

• Example: BGBGB

5

3

⎝ ⎜

⎠ ⎟=

5!

3! 5 − 3( )!=

5 ⋅4 ⋅3⋅2 ⋅13⋅2 ⋅1( ) ⋅ 2 ⋅1( )

=10

Checking...

BBBGG BBGBG BBGGB BGBBG BGBGB

BGGBB GBBBG GBBGB GBGBB GGBBB

Answer = 10 permutationsOne combination (three boys, two girls)

0!=11!=1

Multiplication rule

If two events A and B are independent, then

Pr[A and B] = Pr[A] x Pr[B]

Permutations and probabilities

• The multiplication rule also holds for permutations

• As long as the events are independent!

Pr[BBBGG]=Pr[B]*Pr[B]*Pr[B]*Pr[G]*Pr[G]

=0.512*0.512*0.512*0.488*0.488

=(0.512)3*(0.488)2

Probability of a combination

• Consider the previous example:

• What is the probability of the combination three boys, two girls?

Probability of a combination

= (Number of permutations giving that combination)

(Probability of one of those permutations)

* Assumes that events are independent

Probability of a combination

= 10

0.031

* Assumes that events are independent

= 0.31

Generalizing…

=

px (1-p)n-x

* Assumes that events are independent

n

x

⎝ ⎜

⎠ ⎟

The probability of a combination of

independent events

P(x) =n

x

⎝ ⎜

⎠ ⎟px 1− p( )

n−x

The binomial distribution

P(x) =n

x

⎝ ⎜

⎠ ⎟px 1− p( )

n−x

Binomial distribution

• The probability distribution for the number of “successes” in a fixed number of independent trials, when the probability of success is the same in each trial

The binomial distribution:

P(x) = probability of a total of x successesp = probability of success in each trialn = total number of trials

P(x) =n

x

⎝ ⎜

⎠ ⎟px 1− p( )

n−x

0

0.02

0.04

0.06

0.08

0.1

0.12

0.14

0.16

0.18

0.2

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

Number of correct choices

Frequency

Sheep null distribution from computer simulation

0

0.02

0.04

0.06

0.08

0.1

0.12

0.14

0.16

0.18

0.2

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

Number of correct choices

Frequency

Binomial distribution, n = 20, p = 0.5

Remember:

n

x

⎝ ⎜

⎠ ⎟=

n!

x!(n − x)!

Example: Paradise flycatchers

QuickTime™ and aTIFF (Uncompressed) decompressor

are needed to see this picture.

QuickTime™ and aTIFF (Uncompressed) decompressor

are needed to see this picture.

Example: Paradise flycatchers

QuickTime™ and aTIFF (Uncompressed) decompressor

are needed to see this picture.

QuickTime™ and aTIFF (Uncompressed) decompressor

are needed to see this picture.

A population of paradise flycatchers has 80% brown males And 20% white. You capture 5 male flycatchers at random. What is the probability that 3 of these are brown and 2 are white?

Example: Paradise flycatchers

A population of paradise flycatchers has 80% brown males And 20% white. You capture 5 male flycatchers at random. What is the probability that 3 of these are brown and 2 are white?

P(x) =n

x

⎝ ⎜

⎠ ⎟px 1− p( )

n−x

n = 5 x = 3 p = 0.8

Example: Paradise flycatchers

A population of paradise flycatchers has 80% brown males And 20% white. You capture 5 male flycatchers at random. What is the probability that 3 of these are brown and 2 are white?

P(x) =5

3

⎝ ⎜

⎠ ⎟0.83 1− 0.8( )

5−3

n = 5 x = 3 p = 0.8

Example: Paradise flycatchers

A population of paradise flycatchers has 80% brown males And 20% white. You capture 5 male flycatchers at random. What is the probability that 3 of these are brown and 2 are white?

P(x) = 0.205

n = 5 x = 3 p = 0.8

Binomial distribution, n=5, p=0.8

0

0.05

0.1

0.15

0.2

0.25

0.3

0.35

0.4

0.45

0 1 2 3 4 5

Number of successes (x)

P(x)

• Mean:

• Variance:

Properties of the binomial distribution

μ =np

σ 2 = np 1− p( )

A proportion is the fraction of individuals having a

particular attribute.

Proportion of successes in a sample

ˆ p =x

n

Example: A coin is flipped 8 times; 5

were heads

Proportion of heads = 5/8

Properties of proportions

• Mean = p

• Variance =

• Standard error = €

p 1− p( )n

p 1− p( )n

Sampling distribution of a proportion

The law of large numbers

The greater the sample size, the closer an estimate of a proportion is likely to be to its true value.

Sample size

ˆ p

Estimating a proportion

ˆ p =x

n

Confidence interval for a proportion*

′ p =X + 2

n + 4

′ p − Z′ p 1− ′ p ( )

n + 4

⎝ ⎜ ⎜

⎠ ⎟ ⎟≤ p ≤ ′ p + Z

′ p 1− ′ p ( )

n + 4

⎝ ⎜ ⎜

⎠ ⎟ ⎟

where Z = 1.96 for a 95% confidence interval

* The Agresti-Couli method

Example: The daughters of radiologists

30 out of 87 offspring of radiologists are males, and the rest female. What is the best estimate of the proportion of sons among radiologists?

Hypothesis testing on proportions

The binomial test

Binomial test

The binomial test uses data to test whether a population

proportion p matches a null expectation for the proportion.

Example

An example: Imagine a student takes a mul tipl e choice test before

starting a statistics class. Each of the 10 questions on the test have

5 possible answers, only one of which is correct. This student gets 4

answers right. Can we deduce from this that this student knows

anything at all about statistics?

Hypotheses

H0: Student got correct answers randomly.

HA: Student got more answers correct than random.

H0: p=0.2.

HA: p>0.2

N =10, p0 =0.2

P = Pr[4] + Pr[5] + Pr[6] + ...+ Pr[10]

=10

4

⎝ ⎜

⎠ ⎟ 0.2( )

40.8( )

6+

10

5

⎝ ⎜

⎠ ⎟ 0.2( )

50.8( )

5+

10

6

⎝ ⎜

⎠ ⎟ 0.2( )

60.8( )

4+ ...

= 0.12

P =0.12

The is greater than the common value of 0.05, so we would not reject the null hypothesis.

Summary

P(x) =n

x

⎝ ⎜

⎠ ⎟px 1− p( )

n−x

μ =np

σ 2 = np 1− p( )€

ˆ p =x

n

se =p 1− p( )

n

′ p =X + 2

n + 4€

′ p − Z′ p 1− ′ p ( )

n + 4

⎝ ⎜ ⎜

⎠ ⎟ ⎟≤ p ≤ ′ p + Z

′ p 1− ′ p ( )

n + 4

⎝ ⎜ ⎜

⎠ ⎟ ⎟