STT 200 – Lecture 5, section 23,24 Recitation 13 (4/9/2013)

14
STT 200 – LECTURE 5, SECTION 23,24 RECITATION 13 (4/9/2013) 1 TA: Zhen Zhang [email protected] Office hour: (C500 WH) 3-4 PM Tuesday (office tel.: 432-3342) Help-room: (A102 WH) 9:00AM-1:00PM, Monday Class meet on Tuesday: 12:40 – 1:30PM A224 WH, Section 23 1:50 – 2:40PM A234 WH, Section 24

description

TA: Zhen Zhang [email protected] Office hour: (C500 WH) 3-4 PM Tuesday ( office tel.: 432-3342) Help-room: (A102 WH) 9:00AM-1:00PM , Monday Class meet on Tuesday: 12:40 – 1:30PM A224 WH, Section 23 1:50 – 2:40PM A234 WH, Section 24. - PowerPoint PPT Presentation

Transcript of STT 200 – Lecture 5, section 23,24 Recitation 13 (4/9/2013)

Page 1: STT 200 – Lecture 5, section 23,24 Recitation 13 (4/9/2013)

1

STT 200 – LECTURE 5, SECTION 23,24RECITATION 13

(4/9/2013)

TA: Zhen Zhang

[email protected] hour: (C500 WH) 3-4 PM Tuesday

(office tel.: 432-3342)Help-room: (A102 WH) 9:00AM-1:00PM, Monday

Class meet on Tuesday: 12:40 – 1:30PM A224 WH, Section 231:50 – 2:40PM A234 WH, Section 24

Page 2: STT 200 – Lecture 5, section 23,24 Recitation 13 (4/9/2013)

2

Example (sampling distribution and confidence interval)

Recall that the data we have last time contain “yes/no” responses from a population of 400 persons who were asked if they have wireless internet access at home. The population proportion of “yes” is 0.5575.

We draw many random samples with size , the sampling distribution of can be approximated by

If we really don’t know , we draw sample with size , obtain and construct 95% confidence interval using . We are 95% confident that is between it.

0.3 0.4 0.5 0.6 0.7 0.8

p = 0.5575

0.2

0.4

0.6

0.8

Page 3: STT 200 – Lecture 5, section 23,24 Recitation 13 (4/9/2013)

3

Example (hypothesis testing) What if we have certain hypothesis on, and want to test it? For instance, a survey in 2011 suggests that only 40% residents in this

region have wireless internet access at their house. We want to test if this is true in the data we collected in 2012, or if there is a noticeable increment. That is: versus .

We decide to draw a sample with size to conduct the proportion test.

… But before that, we need to check several conditions.

Page 4: STT 200 – Lecture 5, section 23,24 Recitation 13 (4/9/2013)

4

Example (check conditions)To validate the proportion test, we need to check several conditions once

we determine the sample size :

Independence condition: the responses in the sample are chosen

independently.

Randomness condition: the responses in the sample are chosen

randomly. We used the table of random digits from 1 to 400.

10% condition: the sample size is less than 10% of the population size

400.

Success/failure condition: Both 14.8 and are greater than 10.

Page 5: STT 200 – Lecture 5, section 23,24 Recitation 13 (4/9/2013)

5

Example (hypothesis testing, continued) To test: versus .

We draw a sample with size , and obtain . If is true, that is, , then , and the z-score with P-value .

Which means if really , then an observed proportion as large as would occur at random only 19 times in 1000. With a P-value this small, we reject and conclude .

What if the hypotheses were: versus ? This becomes two-sided, and P-value becomes . and we will still reject

if our significance level is

Page 6: STT 200 – Lecture 5, section 23,24 Recitation 13 (4/9/2013)

6

Interaction with confidence intervalWe can also construct the confidence interval for given significance level :

Determine confidence level . For two-sided test (), ; For one-sided test

( or ), .

The critical value, either using Normal table, or qnorm((C+1)/2) in R,

or invNorm((C+1)/2) in calculator.

Find . Note we use , not , since it is , not .

The margin of error is

The confidence interval is , and check that whether is contained in this

interval.

In our example for v, and , we have ,, , hence the 90% confidence

interval is , which is above .

Page 7: STT 200 – Lecture 5, section 23,24 Recitation 13 (4/9/2013)

7

Errors and powerSome important concepts :

Type I error: reject when it is true.

Type II error: accept when it is false.

Power of the test: the probability of rejecting when it is false (i.e.,

when is true).

In our example for v, and , we will reject if we observe a z-score , or a

proportion . Under the true proportion , , so the power of this test is .

Page 8: STT 200 – Lecture 5, section 23,24 Recitation 13 (4/9/2013)

8

Question #1:

Suppose we want to test whether a coin is fair. We toss it many times,

count the proportion of heads, and find a P-value of 0.32. Which

conclusion is appropriate?

a) There’s a 32% chance that the coin is fair.

b) There’s a 32% chance that the coin is not fair.

c) There’s a 32% chance that natural sampling variation could

produce coin-tossing results like these if the coin is really fair.

d) There’s a 32% chance that natural sampling variation could

produce coin-tossing results like these if the coin is not fair.

Ans: we discussed in class.

Page 9: STT 200 – Lecture 5, section 23,24 Recitation 13 (4/9/2013)

9

Question #2:Many people have trouble setting up all the features of their cell phones, so a company has developed what it hopes will be easier instructions. The goal is to have at least 96% of customers succeed. The company test it on 200 people, and 188 were successful. Is this a strong evidence that their system fails to meet the goal? A student’s test of this hypothesis is shown. How many mistakes can you find?

To test: versus . The sample is SRS, with 0.96(200)>10. . , and the z-score with P-value . There is strong evidence that the new instructions do not work.

Ans: we discussed in class.

Page 10: STT 200 – Lecture 5, section 23,24 Recitation 13 (4/9/2013)

10

Question #3:Many people have trouble setting up all the features of their cell phones, so a company has developed what it hopes will be easier instructions. The goal is to have at least 86% of customers succeed. The company test it on 100 people, and 93 were successful. Is this a strong evidence that their system fails to meet the goal? Our second student’s test of this hypothesis is shown. How many mistakes can you find?

To test: versus . The sample is SRS, with 0.86(100)>10 and 0.14(100)>10 . . , and the z-score with P-value . Since this is significant under 𝛼=0.05, we reject and conclude

there is strong evidence that the new instructions do not work.

Ans: The only error is the P-value should be !

Page 11: STT 200 – Lecture 5, section 23,24 Recitation 13 (4/9/2013)

11

Question #4:A basketball player with a poor foul-shot record practices intensively during the off-season. He tells the coach that he has raised his proficiency from 60% to 80%. Dubious, the coach asks him to take 10 shots, and surprised when the player hits 9 out 10 shots. Did the player prove that he has improved?

a) Suppose the player really is no better than before, still 60% shooter. What’s the probability he can hit at least 9 of 10 shots anyway?

b) If that is what happened, now the coach thinks the player has improved when he has not. Which type of error is that?

c) If the player really can hit 80% now, and it takes at least 9 out of 10 successful shots to convince the coach, what’s the power of the test?

d) List two ways the coach and player could increase the power to detect any improvement.

Page 12: STT 200 – Lecture 5, section 23,24 Recitation 13 (4/9/2013)

12

Question #4 - solution:a) Suppose the player really is no better than before, still 60%

shooter. What’s the probability he can hit at least 9 of 10 shots anyway?

Let X be the number of shots he hits, which follows Binomial model with n=10 and p=0.6 under the null hypothesis. We have , and , so .

b) If that is what happened, now the coach thinks the player has improved when he has not. Which type of error is that?

The null hypothesis is that the player really is no better than before. So if the coach thinks the player has improved (reject the null hypothesis) when he actually has not (when the null hypothesis is true), this is Type I error.

Page 13: STT 200 – Lecture 5, section 23,24 Recitation 13 (4/9/2013)

13

Question #4 – solution (continued):c) If the player really can hit 80% now, and it takes at least 9 out of

10 successful shots to convince the coach, what’s the power of the test?

The power is the probability that we reject the null hypothesis when it is false, i.e., the alternative is true. Since X the number of shots he hits follows Binomial model with n=10 and p=0.8 under the alternative hypothesis, we have , and , so .

d) List two ways the coach and player could increase the power to detect any improvement.

Increases the number of shots but still accept the improvement when he hits more than or equal to 9 shots. Or keep the number of shots at 10, but increase by declaring that 8,9, or 10 will be deemed as having improved, 𝛼then the power will be which is larger than that calculated in c).

Page 14: STT 200 – Lecture 5, section 23,24 Recitation 13 (4/9/2013)

14Thank you.