chapter 20: testing hypotheses about proportions

40
Chapter 20: Testing Hypotheses About Proporti ons AP Statistics Unit 5

Upload: affrica

Post on 07-Feb-2016

144 views

Category:

Documents


1 download

DESCRIPTION

Chapter 20: Testing Hypotheses About Proportions. Unit 5. AP Statistics. Hypotheses. Hypotheses are working models that we adopt temporarily. Our starting hypothesis is called the null hypothesis . - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Chapter  20:  Testing Hypotheses About  Proportions

Chapter 20: Testing Hypotheses About ProportionsAP Statistics

Unit 5

Page 2: Chapter  20:  Testing Hypotheses About  Proportions

Hypotheses0Hypotheses are working models that we adopt temporarily.

0Our starting hypothesis is called the null hypothesis.

0The null hypothesis, that we denote by H0, specifies a population model parameter of interest and proposes a value for that parameter.

0We usually write down the null hypothesis in the form H0: parameter = hypothesized value.

0The alternative hypothesis, which we denote by HA, contains the values of the parameter that we consider plausible if we reject the null hypothesis.

Page 3: Chapter  20:  Testing Hypotheses About  Proportions

Hypotheses (cont.)0The null hypothesis, specifies a population model

parameter of interest and proposes a value for that parameter. 0 We might have, for example, H0: p = 0.20.

0We want to compare our data to what we would expect given that H0 is true. 0 We can do this by finding out how many standard deviations

away from the proposed value we are.

0We then ask how likely it is to get results like we did if the null hypothesis were true.

Page 4: Chapter  20:  Testing Hypotheses About  Proportions

A Trial as a Hypothesis Test 0 Think about the logic of jury trials:

0 To prove someone is guilty, we start by assuming they are innocent.

0 We retain that hypothesis until the facts make it unlikely beyond a reasonable doubt.

0 Then, and only then, we reject the hypothesis of innocence and declare the person guilty.

Page 5: Chapter  20:  Testing Hypotheses About  Proportions

A Trial as a Hypothesis Test (cont.)

0 The same logic used in jury trials is used in statistical tests of hypotheses: 0 We begin by assuming that a hypothesis is true.

0 Next we consider whether the data are consistent with the hypothesis.

0 If they are, all we can do is retain the hypothesis we started with. If they are not, then like a jury, we ask whether they are unlikely beyond a reasonable doubt.

Page 6: Chapter  20:  Testing Hypotheses About  Proportions

P-Values

0 The statistical twist is that we can quantify our level of doubt.0 We can use the model proposed by our hypothesis to

calculate the probability that the event we’ve witnessed could happen.

0 That’s just the probability we’re looking for—it quantifies exactly how surprised we are to see our results.

0 This probability is called a P-value.

Page 7: Chapter  20:  Testing Hypotheses About  Proportions

P-Values (cont.)0 When the data are consistent with the model from the null

hypothesis, the P-value is high and we are unable to reject the null hypothesis.

0 In that case, we have to “retain” the null hypothesis we started with.

0 We can’t claim to have proved it; instead we “fail to reject the null hypothesis” when the data are consistent with the null hypothesis model and in line with what we would expect from natural sampling variability.

0 If the P-value is low enough, we’ll “reject the null hypothesis,” since what we observed would be very unlikely were the null model true.

Page 8: Chapter  20:  Testing Hypotheses About  Proportions

What to Do with an “Innocent” Defendant

0 If the evidence is not strong enough to reject the presumption of innocent, the jury returns with a verdict of “not guilty.”0 The jury does not say that the defendant is innocent.

0 All it says is that there is not enough evidence to convict, to reject innocence.

0 The defendant may, in fact, be innocent, but the jury has no way to be sure.

Page 9: Chapter  20:  Testing Hypotheses About  Proportions

What to Do with an “Innocent” Defendant (cont.)0 Said statistically, we will fail to reject the null

hypothesis.

0 We never declare the null hypothesis to be true, because we simply do not know whether it’s true or not.

0 Sometimes in this case we say that the null hypothesis has been retained.

Page 10: Chapter  20:  Testing Hypotheses About  Proportions

What to Do with an “Innocent” Defendant (cont.)0 In a trial, the burden of proof is on the prosecution.

0 In a hypothesis test, the burden of proof is on the unusual claim.

0 The null hypothesis is the ordinary state of affairs, so it’s the alternative to the null hypothesis that we consider unusual (and for which we must marshal evidence).

Page 11: Chapter  20:  Testing Hypotheses About  Proportions

Examples1. A research team wants to know if aspirin helps to thin blood. The

null hypothesis says that it doesn’t. They test 12 patients, observe the proportion with thinner blood, and get a P-value of 0.32. They proclaim that aspirin doesn’t work. What would you say?

2. An allergy drug has been tested and found to give relief to 75% of the patients in a large clinical trial. Now the scientists want to see if the new, improved version works even better. What would the null hypothesis be?

3. The new drug is tested and the P-value is 0.0001. What would you conclude about the new drug?

Page 12: Chapter  20:  Testing Hypotheses About  Proportions

The Reasoning of Hypothesis Testing

0 There are four basic parts to a hypothesis test:

1. Hypotheses2. Model3. Mechanics4. Conclusion

0 Let’s look at these parts in detail…

Page 13: Chapter  20:  Testing Hypotheses About  Proportions

The Reasoning of Hypothesis Testing (cont.)

1. Hypotheses0 The null hypothesis: To perform a hypothesis test,

we must first translate our question of interest into a statement about model parameters.

0 In general, we have H0: parameter = hypothesized value.

0 The alternative hypothesis: The alternative hypothesis, HA, contains the values of the parameter we consider plausible when we reject the null.

Page 14: Chapter  20:  Testing Hypotheses About  Proportions

Hypothesis ExampleA 1996 report from the U.S. Consumer Product Safety Commission claimed that at least 90% of all American homes have at least one smoke detector. A city’s fire department has been running a public safety campaign about smoke detectors consisting of posters, billboards, and ads on radio and TV and in the newspaper. The city wonders if this concerted effort has raised the local level above the 90% national rate. Building inspectors visit 400 randomly selected homes and find that 376 have smoke detectors. Is this strong evidence that the local rate is higher than the national rate? Set up the hypotheses.

Page 15: Chapter  20:  Testing Hypotheses About  Proportions

The Reasoning of Hypothesis Testing (cont.)

2. Model

0 To plan a statistical hypothesis test, specify the model you will use to test the null hypothesis and the parameter of interest.

0 All models require assumptions, so state the assumptions and check any corresponding conditions.

0 Your model step should end with a statement such

0 Because the conditions are satisfied, I can model the sampling distribution of the proportion with a Normal model.

0 Watch out, though. It might be the case that your model step ends with “Because the conditions are not satisfied, I can’t proceed with the test.” If that’s the case, stop and reconsider.

Page 16: Chapter  20:  Testing Hypotheses About  Proportions

The Reasoning of Hypothesis Testing (cont.)

2. Model (cont.)

0 Each test we discuss in the book has a name that you should include in your report.

0 The test about proportions is called a one-proportion z-test.

Page 17: Chapter  20:  Testing Hypotheses About  Proportions

One-Proportion z-Test0 The conditions for the one-proportion z-test are the same as

for the one proportion z-interval. We

test the hypothesis H0: p = p0

using the statistic

where

0 When the conditions are met and the null hypothesis is true, this statistic follows the standard Normal model, so we can use that model to obtain a P-value.

z p̂ p0 SD p̂

SD p̂ p0q0n

Page 18: Chapter  20:  Testing Hypotheses About  Proportions

The Reasoning of Hypothesis Testing (cont.)

3. Mechanics

0 Under “mechanics” we place the actual calculation of our test statistic from the data.

0 Different tests will have different formulas and different test statistics.

0 Usually, the mechanics are handled by a statistics program or calculator, but it’s good to know the formulas.

Page 19: Chapter  20:  Testing Hypotheses About  Proportions

The Reasoning of Hypothesis Testing (cont.)

3. Mechanics (continued)0 The ultimate goal of the calculation is to obtain a P-value.

0 The P-value is the probability that the observed statistic value (or an even more extreme value) could occur if the null model were correct.

0 If the P-value is small enough, we’ll reject the null hypothesis.

0 Note: The P-value is a conditional probability—it’s the probability that the observed results could have happened if the null hypothesis is true.

Page 20: Chapter  20:  Testing Hypotheses About  Proportions

P-value Example0 A large city’s DMV claimed that 80% of candidates pass driving tests,

but a survey of 90 randomly selected local teens who had taken the test found only 61 who passed. Does this finding suggest that the passing rate for teenagers is lower than the DMV reported? What is the P-value for the one-proportion z-test? Don’t forget to check the conditions for inference!

Page 21: Chapter  20:  Testing Hypotheses About  Proportions

The Reasoning of Hypothesis Testing (cont.)

4. Conclusion0 The conclusion in a hypothesis test is always a statement

about the null hypothesis.

0 The conclusion must state either that we reject or that we fail to reject the null hypothesis.

0 And, as always, the conclusion should be stated in context.

Page 22: Chapter  20:  Testing Hypotheses About  Proportions

The Reasoning of Hypothesis Testing (cont.)

4. Conclusion0 Your conclusion about the null hypothesis should never

be the end of a testing procedure.

0 Often there are actions to take or policies to change.

Page 23: Chapter  20:  Testing Hypotheses About  Proportions

Conclusion Example0 Recap: A large city’s DMV claimed that 80% of candidates pass driving

tests. Data from a reporter’s survey of randomly selected local teens who had taken the test produced a P-value of 0.002. What can the reporter conclude? And how might the reporter explain what the P-value means for the newspaper story?

Page 24: Chapter  20:  Testing Hypotheses About  Proportions

Alternatives Hypotheses

0 There are three possible alternative hypotheses:

0HA: parameter < hypothesized value

0HA: parameter ≠ hypothesized value

0HA: parameter > hypothesized value

Page 25: Chapter  20:  Testing Hypotheses About  Proportions

Alternatives Hypotheses (cont.)0 HA: parameter ≠ value is known as a two-sided alternative because we

are equally interested in deviations on either side of the null hypothesis value.

0 For two-sided alternatives, the P-value is the probability of deviating in either direction from the null hypothesis value.

Page 26: Chapter  20:  Testing Hypotheses About  Proportions

Alternatives Hypotheses (cont.)0 The other two alternative hypotheses are called one-sided alternatives.

0 A one-sided alternative focuses on deviations from the null hypothesis value in only one direction.

0 Thus, the P-value for one-sided alternatives is the probability of deviating only in the direction of the alternative away from the null hypothesis value.

Page 27: Chapter  20:  Testing Hypotheses About  Proportions

1. Check Conditions and show that you have checked these!• Random Sample: Can we assume this?• 10% Condition: Do you believe that your sample size is

less than 10% of the population size?• Success/Failure:

0 and 2. State the test you are about to conduct

0Ex) One-proportion z-test3. Set up your hypotheses

0 H0:

0 HA:

Steps for Hypothesis Testing for One-Proportion z-Tests

Page 28: Chapter  20:  Testing Hypotheses About  Proportions

4. Calculate your test statistic

0 5. Draw a picture of your desired area under the Normal

model, and calculate your P-value.

6. Make your conclusion.0 When your P-value is small enough (or below α, if given),

reject the null hypothesis.

0 When your P-value is not small enough, fail to reject the null hypothesis.

Steps for Hypothesis Testing for One-Proportion z-Tests (cont.)

Page 29: Chapter  20:  Testing Hypotheses About  Proportions

Testing a Hypothesis ExampleHome field advantage –teams tend to win more often when the

play at home. Or do they?If there were no home field advantage, the home teams would

win about half of all games played. In the 2007 Major League Baseball season, there were 2431 regular-season games. It turns out that the home team won 1319 of the 2431 games, or 54.26% of the time.

Could this deviation from 50% be explained from natural sampling variability, or is it evidence to suggest that there really is a home field advantage, at least in professional baseball?

Page 30: Chapter  20:  Testing Hypotheses About  Proportions

Graphing Calculator Shortcuts

0One Proportion Z-Test:0 Stat TESTS0 5: 1-Prop ZTest

0Po = hypothesized proportion

0x = number of successes0n = sample size0Determine the tail0Calculate

Page 31: Chapter  20:  Testing Hypotheses About  Proportions

P-Values and Decisions: What to Tell About a Hypothesis Test

0 How small should the P-value be in order for you to reject the null hypothesis?

0 It turns out that our decision criterion is context-dependent.

0 When we’re screening for a disease and want to be sure we treat all those who are sick, we may be willing to reject the null hypothesis of no disease with a fairly large P-value (0.10).

0 A longstanding hypothesis, believed by many to be true, needs stronger evidence (and a correspondingly small P-value) to reject it.

0 Another factor in choosing a P-value is the importance of the issue being tested.

Page 32: Chapter  20:  Testing Hypotheses About  Proportions

P-Values and Decisions (cont.)0 Your conclusion about any null hypothesis should be accompanied

by the P-value of the test.

0 If possible, it should also include a confidence interval for the parameter of interest.

0 Don’t just declare the null hypothesis rejected or not rejected.

0 Report the P-value to show the strength of the evidence against the hypothesis.

0 This will let each reader decide whether or not to reject the null hypothesis.

Page 33: Chapter  20:  Testing Hypotheses About  Proportions

Examples1. A bank is testing a new method for getting delinquent customers to pay their

past-due credit card bills. The standard way was to send a letter (costing about $0.40) asking the customer to pay. That worked 30% of the time. They want top test a new method that involves sending a DVD to customers encouraging them to contact the bank and set up a payment plan. Developing and sending the video costs about $10 per customer. What is the parameter of interest? What are the null and alternative hypotheses?

2. The bank sets up an experiment to test the effectiveness of the DVD. They mail it out to several randomly selected delinquent customers and keep track of how many actually do contact the bank to arrange payments. The bank’s statistician calculates a P-value of 0.003. What does this P-value suggest about the DVD?

3. The statistician tells the bank’s management that the results are clear and they should switch to the DVD method. Do you agree? What else might you want to know?

Page 34: Chapter  20:  Testing Hypotheses About  Proportions

What Can Go Wrong?0 Hypothesis tests are so widely used—and so widely

misused—that the issues involved are addressed in their own chapter (Chapter 21).

0 There are a few issues that we can talk about already, though:

Page 35: Chapter  20:  Testing Hypotheses About  Proportions

What Can Go Wrong? (cont.)0 Don’t base your null hypothesis on what you see in

the data.

0 Think about the situation you are investigating and develop your null hypothesis appropriately.

0 Don’t base your alternative hypothesis on the data, either.

0 Again, you need to Think about the situation.

Page 36: Chapter  20:  Testing Hypotheses About  Proportions

What Can Go Wrong? (cont.)0Don’t accept the null hypothesis.

0If you fail to reject the null hypothesis, don’t think a bigger sample would be more likely to lead to rejection.

0Each sample is different, and a larger sample won’t necessarily duplicate your current observations.

Page 37: Chapter  20:  Testing Hypotheses About  Proportions

Recap

0 We can use what we see in a random sample to test a particular hypothesis about the world.

0 Hypothesis testing complements our use of confidence intervals.

0 Testing a hypothesis involves proposing a model, and seeing whether the data we observe are consistent with that model or so unusual that we must reject it.

0 We do this by finding a P-value—the probability that data like ours could have occurred if the model is correct.

Page 38: Chapter  20:  Testing Hypotheses About  Proportions

Recap (cont.)

0We’ve learned:0 Start with a null hypothesis.0 Alternative hypothesis can be one- or two-sided.0 Check assumptions and conditions.0 Data are out of line with H0, small P-value, reject the

null hypothesis.0 Data are consistent with H0, large P-value, don’t reject

the null hypothesis.0 State the conclusion in the context of the original

question.

Page 39: Chapter  20:  Testing Hypotheses About  Proportions

Recap (cont.)

0 We know that confidence intervals and hypothesis tests go hand in hand in helping us think about models.

0 A hypothesis test makes a yes/no decision about the plausibility of a parameter value.

0 A confidence interval shows us the range of plausible values for the parameter.

Page 40: Chapter  20:  Testing Hypotheses About  Proportions

Assignments: pp. 476 – 479

0Day 1: # 1-3, 9, 11

0Day 2: # 4, 5, 12, 14, 18

0Day 3: # 16, 20, 22