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

Post on 18-Feb-2016

14 views 1 download

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.

1

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

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?

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

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.

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.

7

Example

p = % of users who will experience side effects

Q. What are Ho and Ha here?

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

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

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

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

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.

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)

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%

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

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(ˆ

17

Computing the p-Value for the Z-Test

18

Computing the p-Value for the Z-Test

19

Computing the p-Value for the Z-Test

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

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

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)

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

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

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