If we live with a deep sense of gratitude, our life will be greatly embellished.

24
1 If we live with a deep sense of gratitude, our life will be greatly embellished.

description

If we live with a deep sense of gratitude, our life will be greatly embellished. Hypothesis Test I: Z tests. Logic of hypothesis test Rejection region and p-value Test for one proportion Test for two proportions. Example: New Drug. - PowerPoint PPT Presentation

Transcript of If we live with a deep sense of gratitude, our life will be greatly embellished.

Page 1: If we live with a deep sense of gratitude, our life will be greatly embellished.

1

If we live with a deep sense of gratitude, our life will be greatly embellished.

Page 2: If we live with a deep sense of gratitude, our life will be greatly embellished.

2

Hypothesis Test I: Z tests

Logic of hypothesis testRejection region and p-valueTest for one proportionTest for two proportions

Page 3: If we live with a deep sense of gratitude, our life will be greatly embellished.

3

Example: New Drug

A pharmaceutical company wants to be able to claim that for its newest medication the proportion of patients who experience side effects is less than 20%.

Q. What are the two possible conclusions (hypotheses) here?

Page 4: If we live with a deep sense of gratitude, our life will be greatly embellished.

4

The Logic of Hypothesis Test

“Assume Ho is a possible truth until proven false”

Analogical to“Presumed innocent until proven guilty”

The logic of the US judicial system

Page 5: If we live with a deep sense of gratitude, our life will be greatly embellished.

5

Steps in Hypothesis Test

1. Determine the null (Ho) and alternative (Ha) hypotheses2. Find an appropriate test statistic and pre-set the level of

significance (called level)3. Assuming Ho is true, find rejection region. 4. Reject Ho if the test statistic falls into the rejection

region.5. Report the result in the context of the situation

Alternative steps for 3 & 4:3. Assuming Ho is true, find p-value.4. Reject Ho if p-value < level.

Page 6: If we live with a deep sense of gratitude, our life will be greatly embellished.

6

Determine Ho and Ha

Ho: nothing is happening (no relationship, no difference,…)

Ha: something is happening (there is a relationship, there is a difference, …)

Rule of Thumb: The “=“ sign must be in Ho. If possible, set what we hope to prove as Ha.

Page 7: If we live with a deep sense of gratitude, our life will be greatly embellished.

7

Example

p = % of users who will experience side effects

Q. What are Ho and Ha here?

Page 8: If we live with a deep sense of gratitude, our life will be greatly embellished.

8

Example

Logic: Assume Ho is possibly true until proven false.

Data: 17% of 400 patients who have experienced side effects

How likely is if Ho is true (p>20%)?

If very unlikely reject HoIf not very unlikely cannot reject Ho

%17ˆ p

Page 9: If we live with a deep sense of gratitude, our life will be greatly embellished.

9

Rejection Region

How extreme (i.e. unlikely) is the observation is too extreme?

Rejection Region is the region when the test statistic falls in, we will “reject Ho”

The rejection region is the most extreme region, determined by the level and the type of Ha

Page 10: If we live with a deep sense of gratitude, our life will be greatly embellished.

10

Good!Good!(Correct!)(Correct!)

H0 true H0 false

Type II Type II Error, or Error, or ““ Error” Error”

Type I Type I Error, or Error, or ““ Error” Error”

Good!Good!(Correct)(Correct)

we accept H0

we reject H0

Two Types of Errors

Page 11: If we live with a deep sense of gratitude, our life will be greatly embellished.

Level of Significance

Level of significance also called level is the largest tolerable type I error rate

Example of rejection region for a given level

11

Page 12: If we live with a deep sense of gratitude, our life will be greatly embellished.

12

P-Value

p-value is the smallest type I error rate if we reject Ho at the observed value

That is, p-value is the probability of seeing as extreme as (or more extreme) what we observe, given Ho is true.

The smaller p-value is, the less likely that what we observe will occur given Ho is true.

That is, smaller p-value means stronger evidence against Ho.

Page 13: If we live with a deep sense of gratitude, our life will be greatly embellished.

13

P-Value

The level of significance (called level) is usually 0.05

p-value > fail to reject Ho (??) p-value < reject Ho (= accept Ha)

Page 14: If we live with a deep sense of gratitude, our life will be greatly embellished.

14

Report the Conclusion

Reject Ho: the data shows strong evidence supporting Ha

Eg. The data shows strong evidence that the proportion of users who will experience side effects is less than 20%.

Fail to reject Ho: the data does not provide sufficient evidence supporting Ha

Eg. Based on the data, there is not sufficient evidence to support the proportion is less than 20%

Page 15: If we live with a deep sense of gratitude, our life will be greatly embellished.

15

Testing Hypotheses about a Proportion

Three possible Ho and Ha

Ho Ha Type

p = po p = po Two-sided

p > po p < po One-sided (lower-tailed)

p < po p > po One-sided (upper-tailed)

Write them all as p=po in the future

Page 16: If we live with a deep sense of gratitude, our life will be greatly embellished.

16

The z-test for a Proportion

When 1) the sample is a random sample 2) n(po) and n(1-po) are both at least 5,an appropriate test statistic for p is

nppppz

oo

o

)1(ˆ

Page 17: If we live with a deep sense of gratitude, our life will be greatly embellished.

17

Computing the p-Value for the Z-Test

Page 18: If we live with a deep sense of gratitude, our life will be greatly embellished.

18

Computing the p-Value for the Z-Test

Page 19: If we live with a deep sense of gratitude, our life will be greatly embellished.

19

Computing the p-Value for the Z-Test

P-value = P(|Z| > |z*| )= 2 x P(Z > |z*|)

Page 20: If we live with a deep sense of gratitude, our life will be greatly embellished.

20

Example: New Drug (Conti.)

1. Ho: p > 20% vs. Ha: p < 20%2. Z-test statistic; 3. Find rejection region or p-value4. Decide if reject Ho or not5. Report the conclusion in the context of the

situation

Page 21: If we live with a deep sense of gratitude, our life will be greatly embellished.

21

Hypothesis Test for the Difference of Two Population Proportions

Step 1. Set up hypothesesHo: p1 = p2 and three possible Ha’s:

Ha: p1 = p2 (two-tailed)or

Ha: p1 < p2 (lower-tailed)or

Ha: p1 > p2 (upper-tailed)

Page 22: If we live with a deep sense of gratitude, our life will be greatly embellished.

22

Hypothesis Test for the Difference between Two Population Proportions

Step 2. calculate test statistic

where

21

21

11)ˆ1(ˆ

ˆˆ

nnpp

ppz

21

2211 ˆˆˆnnpnpnp

Page 23: If we live with a deep sense of gratitude, our life will be greatly embellished.

23

Hypothesis Test for the Difference between Two Population Proportions

Step 3: Find p value1. Must be two independent random samples;

both are large samples:

And

2. When the above conditions are met, use Z-Table to find p-value.

10)ˆ1(,ˆ 11 pnpn 10)ˆ1(,ˆ 22 pnpn

Page 24: If we live with a deep sense of gratitude, our life will be greatly embellished.

24

Example: Bike to School

For 80 randomly selected men, 30 regularly bicycled to campus; while for 100 randomly selected women, 20 regularly bicycled to campus.

Find the p-value for testing:Ho: p1 = p2 vs. Ha: p1 > p2

Answer: z=2.60, p=0.00471: men; 2: women