testing hypothesis about proportions chapter 20. objectives hypothesis null hypothesis alternative...

75
Testing Hypothesis About Proportions Chapter 20

Upload: ellen-payne

Post on 04-Jan-2016

251 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Testing Hypothesis About Proportions Chapter 20. Objectives Hypothesis Null hypothesis Alternative hypothesis Two-sided alternative One-sided alternative

Testing Hypothesis About Proportions

Chapter 20

Page 2: Testing Hypothesis About Proportions Chapter 20. Objectives Hypothesis Null hypothesis Alternative hypothesis Two-sided alternative One-sided alternative

Objectives

• Hypothesis• Null hypothesis• Alternative hypothesis• Two-sided alternative• One-sided alternative• P-value• One-proportion z-test

Page 3: Testing Hypothesis About Proportions Chapter 20. Objectives Hypothesis Null hypothesis Alternative hypothesis Two-sided alternative One-sided alternative

Significance Testing

• Used to investigate preconceived assumptions about some condition in the population.

• Usually this condition can be expressed as a mean of some characteristic or as a proportion of some characteristic of interest.

• Sample data are selected and either the sample mean or proportion is calculated in order to determine if this value could reasonably be assumed to exist w/in the hypothesized population.

Page 4: Testing Hypothesis About Proportions Chapter 20. Objectives Hypothesis Null hypothesis Alternative hypothesis Two-sided alternative One-sided alternative

Logic of Tests of Significance

• In statistical testing, we want to show whether a certain claim about the value of a parameter is reasonable or not.

• For the test, we determine the criteria under which we will conclude that the assumption is unreasonable, take an appropriate sample and calculate the relevant statistic from the data, and then compare the results to our criteria.

Page 5: Testing Hypothesis About Proportions Chapter 20. Objectives Hypothesis Null hypothesis Alternative hypothesis Two-sided alternative One-sided alternative

General Procedure for One-Proportion z-Test

1. Check assumptions/conditions

2. State null and alternative hypothesis

3. Decide on significance level α.

4. Use standard normal curve to calculate P-value.

5. Decision on hypothesis, reject or fail to reject H0.

6. Interpret the results in context of the problem.

Page 6: Testing Hypothesis About Proportions Chapter 20. Objectives Hypothesis Null hypothesis Alternative hypothesis Two-sided alternative One-sided alternative

Hypothesis

• A statement of a condition which is assumed to exist in a population and is tested using the results from a randomly selected sample.

Page 7: Testing Hypothesis About Proportions Chapter 20. Objectives Hypothesis Null hypothesis Alternative hypothesis Two-sided alternative One-sided alternative

Hypotheses

• Hypotheses are working models that we adopt temporarily.

• Our starting hypothesis is called the null hypothesis. • The null hypothesis, that we denote by H0, specifies a

population model parameter of interest and proposes a value for that parameter.

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

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

Page 8: Testing Hypothesis About Proportions Chapter 20. Objectives Hypothesis Null hypothesis Alternative hypothesis Two-sided alternative One-sided alternative

Null and Alternative Hypothesis1. Null Hypothesis (H0) – the hypothesis being

tested. • Usually a “no change” or “no difference” statement

about a parameter (mean or proportion) of the distribution.

• Example: p = p0 (an equal sign should appear in the null hypothesis).

• Generally, it is the null hypothesis that the researcher is hoping to reject in favor of a proposed alternative hypothesis.

Page 9: Testing Hypothesis About Proportions Chapter 20. Objectives Hypothesis Null hypothesis Alternative hypothesis Two-sided alternative One-sided alternative

2. Alternative Hypothesis (Ha or H1) – the alternative to the null hypothesis.

• Often it is this hypothesis that the researcher hopes to prove true.

• Three choices possible for the alternative hypothesis.

1. If the primary concern is deciding whether a population proportion, p, is different from a specified value p0, the alternative hypothesis should be p≠p0.• Express as: Ha:p≠p0

• A hypothesis test of this form is called a two-tailed or two-sided test.

Page 10: Testing Hypothesis About Proportions Chapter 20. Objectives Hypothesis Null hypothesis Alternative hypothesis Two-sided alternative One-sided alternative

2. If the primary concern is deciding whether a population proportion, p, is less than a specified value p0, the alternative hypothesis should be p<p0. • Express as: Ha:p<p0

• A hypothesis test of this form is called a one-sided or one-tailed (left-tailed) test.

3. If the primary concern is deciding whether a population proportion, p, is greater than a specified value p0, the alternative hypothesis should be p>p0.• Express as: Ha:p>p0

• A hypothesis test of this form is called a one-sided or one-tailed (right-tailed) test.

• A hypothesis test is called a one-tailed test if it is either left-tailed or right-tailed, that is, if it is not two-tailed.

Page 11: Testing Hypothesis About Proportions Chapter 20. Objectives Hypothesis Null hypothesis Alternative hypothesis Two-sided alternative One-sided alternative

Illustration

Page 12: Testing Hypothesis About Proportions Chapter 20. Objectives Hypothesis Null hypothesis Alternative hypothesis Two-sided alternative One-sided alternative

Summary:Null Hypotheses• The null hypothesis, specifies a population

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

0.20.• We want to compare our data to what we

would expect given that H0 is true. • We can do this by finding out how many

standard deviations away from the proposed value we are.

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

Page 13: Testing Hypothesis About Proportions Chapter 20. Objectives Hypothesis Null hypothesis Alternative hypothesis Two-sided alternative One-sided alternative

Summary: Alternative Alternatives

• There are three possible alternative hypotheses:

• HA: parameter < hypothesized value

• HA: parameter ≠ hypothesized value

• HA: parameter > hypothesized value

Page 14: Testing Hypothesis About Proportions Chapter 20. Objectives Hypothesis Null hypothesis Alternative hypothesis Two-sided alternative One-sided alternative

Summary:Alternative Alternatives

• 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.

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

Page 15: Testing Hypothesis About Proportions Chapter 20. Objectives Hypothesis Null hypothesis Alternative hypothesis Two-sided alternative One-sided alternative

Summary:Alternative Alternatives

• The other two alternative hypotheses are called one-sided alternatives.

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

• Thus, a one-sided alternative is the probability of deviating only in the direction of the alternative away from the null hypothesis value.

Page 16: Testing Hypothesis About Proportions Chapter 20. Objectives Hypothesis Null hypothesis Alternative hypothesis Two-sided alternative One-sided alternative

1 - Choosing the Null and Alternative Hypotheses

• A large city’s Department of Motor Vehicle’s claimed that 80% of candidates pass driving tests, but a newspaper’s survey of 90 randomly selected local teens who had taken the test found only 61 (68%) who passed. Does this finding suggest that the passing rate for teenagers is lower than the DMV reported?

a) Determine the null hypothesis for the hypothesis test.

b) Determine the alternative hypothesis for the hypothesis test.

c) Classify the hypothesis test as two-tailed, left-tailed, or right-tailed.

Page 17: Testing Hypothesis About Proportions Chapter 20. Objectives Hypothesis Null hypothesis Alternative hypothesis Two-sided alternative One-sided alternative

1 - Solution

• The null hypothesis is: The passing rate for teenagers is 80%, as the DMV claimed.• H0: p = .80

• The alternative hypothesis is: The passing rate for teenagers is less than the 80% claimed by the DMV.• Ha: p < .80

• This hypothesis test is (single-tail) left-tailed.

Page 18: Testing Hypothesis About Proportions Chapter 20. Objectives Hypothesis Null hypothesis Alternative hypothesis Two-sided alternative One-sided alternative

2 - Choosing the Null and Alternative Hypotheses

• Advances in medical care such as prenatal ultrasound examination now make it possible to determine a child’s sex early in pregnancy. There is a fear that in some cultures some parents may use this technology to select the sex of their children. A study for India reports that, in 1993, in one hospital, 56.9% of the live births that year were boys. It’s a medical fact that male babies are slightly more common than female babies. The study’s authors report a baseline for this region of 51.7% male live births. Is there evidence that the proportion of male births has changed?

a) Determine the null hypothesis for the hypothesis test.

b) Determine the alternative hypothesis for the hypothesis test.

c) Classify the hypothesis test as two-tailed, left-tailed, or right-tailed.

Page 19: Testing Hypothesis About Proportions Chapter 20. Objectives Hypothesis Null hypothesis Alternative hypothesis Two-sided alternative One-sided alternative

2 - Solution

• The null hypothesis is: The proportion of male births has not changed and is still equal to the baseline of 51.7%.• H0: p = .517

• The alternative hypothesis is: The proportion of male births has changed and is no longer equal to the baseline of 51.7%.• Ha: p ≠ .517

• This hypothesis test is two-tailed.

Page 20: Testing Hypothesis About Proportions Chapter 20. Objectives Hypothesis Null hypothesis Alternative hypothesis Two-sided alternative One-sided alternative

3 - Choosing the Null and Alternative Hypotheses

• Anyone who plays or watches sports has heard of the “home field advantage.” Teams tend to win more often when they 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 MLB 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 just from natural sampling variability, or is it evidence to suggest that there really is a home field advantage, at least in ML baseball?

a) Determine the null hypothesis for the hypothesis test.

b) Determine the alternative hypothesis for the hypothesis test.

c) Classify the hypothesis test as two-tailed, left-tailed, or right-tailed.

Page 21: Testing Hypothesis About Proportions Chapter 20. Objectives Hypothesis Null hypothesis Alternative hypothesis Two-sided alternative One-sided alternative

3 - Solution

• The null hypothesis is: There is no home field advantage and the proportion of home wins is 50%.• H0: p = .50

• The alternative hypothesis is: There is a home field advantage and the proportion of home wins is greater than 50%.• Ha: p > .50

• This hypothesis test is (single-tail) right-tailed.

Page 22: Testing Hypothesis About Proportions Chapter 20. Objectives Hypothesis Null hypothesis Alternative hypothesis Two-sided alternative One-sided alternative

Test Statistic

• A sample statistic or value based on the sample data.

• The test statistic is used as a basis for deciding whether the null hypothesis should be rejected or not.

•Is a z value for the sample

Page 23: Testing Hypothesis About Proportions Chapter 20. Objectives Hypothesis Null hypothesis Alternative hypothesis Two-sided alternative One-sided alternative

Rejection Region, Non-rejection Region and Critical Values

• Rejection region – The set of values for the test statistic that leads to rejection of the null hypothesis.

• Non-rejection region – The set of values for the test statistic that leads to not rejecting the null hypothesis.

• Critical Value – the value of the test statistic that separates the rejection and non-rejection regions. A critical value is considered part of the rejection region.

Page 24: Testing Hypothesis About Proportions Chapter 20. Objectives Hypothesis Null hypothesis Alternative hypothesis Two-sided alternative One-sided alternative

Illustration:

Page 25: Testing Hypothesis About Proportions Chapter 20. Objectives Hypothesis Null hypothesis Alternative hypothesis Two-sided alternative One-sided alternative

More Illustrations:

Page 26: Testing Hypothesis About Proportions Chapter 20. Objectives Hypothesis Null hypothesis Alternative hypothesis Two-sided alternative One-sided alternative

Critical Value or P-Value?

• The decision to reject or fail to reject the null hypothesis can be made by comparing the test statistic to a critical value (based on a confidence level) or by comparing a p-value (based on the test statistic) to a significance level.

Page 27: Testing Hypothesis About Proportions Chapter 20. Objectives Hypothesis Null hypothesis Alternative hypothesis Two-sided alternative One-sided alternative

P-Values

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

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

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

• This probability is called a P-value.

Page 28: Testing Hypothesis About Proportions Chapter 20. Objectives Hypothesis Null hypothesis Alternative hypothesis Two-sided alternative One-sided alternative

P-Values

• The probability that we obtain the value of the test statistic that we observed or a value that is more extreme in the direction of Ha, given that H0 is true.

• A P-value is a conditional probability.• It is the probability of the observed test

statistic given that the null hypothesis is true.

• P-value = (observed statistic value[or more extreme]|H0)

• The P-value is not the probability that the null hypothesis is true.

Page 29: Testing Hypothesis About Proportions Chapter 20. Objectives Hypothesis Null hypothesis Alternative hypothesis Two-sided alternative One-sided alternative

P-Values

• The smaller the P-value, the more strongly we are inclined to reject H0. If the P-value is very small, it is very unlikely that a value as extreme as the observed value of the test statistic would be the outcome if H0 were true.

• To obtain the P-value of a hypothesis test, we assume that the null hypothesis is true and compute the probability of observing a value of the test statistic as extreme or more extreme than that observed.

• This is the area of the tail (relative to the test statistic observed) under the standard normal curve.

Page 30: Testing Hypothesis About Proportions Chapter 20. Objectives Hypothesis Null hypothesis Alternative hypothesis Two-sided alternative One-sided alternative

Illustration:

z0 is the observed value of the test statistic z

Page 31: Testing Hypothesis About Proportions Chapter 20. Objectives Hypothesis Null hypothesis Alternative hypothesis Two-sided alternative One-sided alternative

Example:Calculating P-value

• Test Statistic z = 1.71 (two-tailed)• P-value = 2•P(z>1.71)• P-value = 2•normalcdf(1.71,100)• P-value = .08727

Page 32: Testing Hypothesis About Proportions Chapter 20. Objectives Hypothesis Null hypothesis Alternative hypothesis Two-sided alternative One-sided alternative

Example:Calculating P-value

• Test Statistic z = 2.85 (right-tailed)• P-value = P(z>2.85)• P-value = normalcdf(2.85,100)• P-value = .002186

Page 33: Testing Hypothesis About Proportions Chapter 20. Objectives Hypothesis Null hypothesis Alternative hypothesis Two-sided alternative One-sided alternative

Example:Calculating P-value

• Test Statistic z = .88 (left-tailed)• P-value = (z>.88)• P-value = normalcdf(.88,100)• P-value = .3789

Page 34: Testing Hypothesis About Proportions Chapter 20. Objectives Hypothesis Null hypothesis Alternative hypothesis Two-sided alternative One-sided alternative

P-Values • 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.• In that case, we have to “retain” the null hypothesis we

started with.• 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.

• 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 35: Testing Hypothesis About Proportions Chapter 20. Objectives Hypothesis Null hypothesis Alternative hypothesis Two-sided alternative One-sided alternative

A Trial as a Hypothesis Test – The Logic of a Significance Test

• Think about the logic of jury trials: • To prove someone is guilty, we start by

assuming they are innocent. • We retain that hypothesis until the facts

make it unlikely beyond a reasonable doubt.

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

Page 36: Testing Hypothesis About Proportions Chapter 20. Objectives Hypothesis Null hypothesis Alternative hypothesis Two-sided alternative One-sided alternative

A Trial as a Hypothesis Test

• The same logic used in jury trials is used in statistical tests of hypotheses: • We begin by assuming that a

hypothesis is true. • Next we consider whether the data are

consistent with the hypothesis. • 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 37: Testing Hypothesis About Proportions Chapter 20. Objectives Hypothesis Null hypothesis Alternative hypothesis Two-sided alternative One-sided alternative

What to Do with an “Innocent” Defendant

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

defendant is innocent.• All it says is that there is not enough

evidence to convict, to reject innocence.

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

Page 38: Testing Hypothesis About Proportions Chapter 20. Objectives Hypothesis Null hypothesis Alternative hypothesis Two-sided alternative One-sided alternative

What to Do with an “Innocent” Defendant

• Said statistically, we will fail to reject the null hypothesis.• We never declare the null hypothesis to

be true, because we simply do not know whether it’s true or not.

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

Page 39: Testing Hypothesis About Proportions Chapter 20. Objectives Hypothesis Null hypothesis Alternative hypothesis Two-sided alternative One-sided alternative

What to Do with an “Innocent” Defendant

• In a trial, the burden of proof is on the prosecution.

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

• 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 40: Testing Hypothesis About Proportions Chapter 20. Objectives Hypothesis Null hypothesis Alternative hypothesis Two-sided alternative One-sided alternative

The Reasoning of Hypothesis Testing

• There are four basic parts to a hypothesis test:

1. Hypotheses

2. Model

3. Mechanics

4. Conclusion• Let’s look at these parts in detail…

Page 41: Testing Hypothesis About Proportions Chapter 20. Objectives Hypothesis Null hypothesis Alternative hypothesis Two-sided alternative One-sided alternative

The Reasoning of Hypothesis Testing

1. Hypotheses• The null hypothesis: To perform a

hypothesis test, we must first translate our question of interest into a statement about model parameters. • In general, we have

H0: parameter = hypothesized value.• The alternative hypothesis: The

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

Page 42: Testing Hypothesis About Proportions Chapter 20. Objectives Hypothesis Null hypothesis Alternative hypothesis Two-sided alternative One-sided alternative

The Reasoning of Hypothesis Testing2. Model

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

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

• Your model step should end with a statement such• Because the conditions are satisfied, I can model

the sampling distribution of the proportion with a Normal model.

• 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 43: Testing Hypothesis About Proportions Chapter 20. Objectives Hypothesis Null hypothesis Alternative hypothesis Two-sided alternative One-sided alternative

The Reasoning of Hypothesis Testing

2. Model• Each test we discuss in the book has

a name that you should include in your report.

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

Page 44: Testing Hypothesis About Proportions Chapter 20. Objectives Hypothesis Null hypothesis Alternative hypothesis Two-sided alternative One-sided alternative

One-Proportion z-Test

• 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 test statistic

where

• 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 45: Testing Hypothesis About Proportions Chapter 20. Objectives Hypothesis Null hypothesis Alternative hypothesis Two-sided alternative One-sided alternative

Why Standard Deviation and Not Standard Error

• Because we haven’t estimated anything.• When we assume that the null hypothesis

is true, it gives us a value for the model parameter p.

• With proportions, if we know p, then we also know its standard deviation. And because we find the standard deviation from the model parameter, this is a standard deviation and not a standard error.

ˆSD p

ˆSE p

Page 46: Testing Hypothesis About Proportions Chapter 20. Objectives Hypothesis Null hypothesis Alternative hypothesis Two-sided alternative One-sided alternative

The Reasoning of Hypothesis Testing

3. Mechanics• Under “mechanics” we place the

actual calculation of our test statistic from the data.

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

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

Page 47: Testing Hypothesis About Proportions Chapter 20. Objectives Hypothesis Null hypothesis Alternative hypothesis Two-sided alternative One-sided alternative

The Reasoning of Hypothesis Testing

3. Mechanics• The ultimate goal of the calculation is to obtain a P-

value.• 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.

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

• 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 48: Testing Hypothesis About Proportions Chapter 20. Objectives Hypothesis Null hypothesis Alternative hypothesis Two-sided alternative One-sided alternative

The Reasoning of Hypothesis Testing

4. Conclusion• The conclusion in a hypothesis test is

always a statement about the null hypothesis.

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

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

Page 49: Testing Hypothesis About Proportions Chapter 20. Objectives Hypothesis Null hypothesis Alternative hypothesis Two-sided alternative One-sided alternative

The Reasoning of Hypothesis Testing

4. Conclusion• Your conclusion about the null

hypothesis should never be the end of a testing procedure.

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

Page 50: Testing Hypothesis About Proportions Chapter 20. Objectives Hypothesis Null hypothesis Alternative hypothesis Two-sided alternative One-sided alternative

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

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

• It turns out that our decision criterion is context-dependent.• 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).

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

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

Page 51: Testing Hypothesis About Proportions Chapter 20. Objectives Hypothesis Null hypothesis Alternative hypothesis Two-sided alternative One-sided alternative

P-Values and Decisions

• Your conclusion about any null hypothesis should be accompanied by the P-value of the test. • If possible, it should also include a confidence interval

for the parameter of interest.• Don’t just declare the null hypothesis rejected or not

rejected.• Report the P-value to show the strength of the

evidence against the hypothesis. • This will let each reader decide whether or not to

reject the null hypothesis.

Page 52: Testing Hypothesis About Proportions Chapter 20. Objectives Hypothesis Null hypothesis Alternative hypothesis Two-sided alternative One-sided alternative

Assumptions and Conditions for One-Proportion z-Test

• The same as for the sampling distribution of sample proportions and the one-proportion z-interval.

• The assumptions and the corresponding conditions must be checked before conducting a Hypothesis Test for a proportion:

• Independence Assumption: We first need to Think about whether the Independence Assumption is plausible. It’s not one you can check by looking at the data. Instead, we check two conditions to decide whether independence is reasonable.

Page 53: Testing Hypothesis About Proportions Chapter 20. Objectives Hypothesis Null hypothesis Alternative hypothesis Two-sided alternative One-sided alternative

Assumptions and Conditions for One-Proportion z-Test

• Randomization Condition: Were the data sampled at random or generated from a properly randomized experiment? Proper randomization can help ensure independence.

• 10% Condition: Is the sample size no more than 10% of the population?

Sample Size Assumption: The sample needs to be large enough for us to be able to use the CLT.• Success/Failure Condition: We must expect at least

10 “successes” and at least 10 “failures.”

Page 54: Testing Hypothesis About Proportions Chapter 20. Objectives Hypothesis Null hypothesis Alternative hypothesis Two-sided alternative One-sided alternative

Procedure: Hypothesis Test for Population Proportions

1. Check conditions

2. Hypothesis

3. Test Statistic• Z test statistic

4. P-value

5. Conclusion

z p̂ p0 SD p̂

Page 55: Testing Hypothesis About Proportions Chapter 20. Objectives Hypothesis Null hypothesis Alternative hypothesis Two-sided alternative One-sided alternative

Example 1

• A large city’s Department of Motor Vehicle’s claimed that 80% of candidates pass driving tests, but a newspaper’s survey of 90 randomly selected local teens who had taken the test found only 61 (68%) who passed. Does this finding suggest that the passing rate for teenagers is lower than the DMV reported?

Page 56: Testing Hypothesis About Proportions Chapter 20. Objectives Hypothesis Null hypothesis Alternative hypothesis Two-sided alternative One-sided alternative

Solution

1. Check conditions The 90 teens were a random sample 90 is less than 10% of teeagers taking

driving tests in a large city np0=90(.80)=72>10 and

nq0=90(.20)=18>10. The conditions are satisfied, so it’s okay to use a Normal model and perform a one-proportion z-test.

Page 57: Testing Hypothesis About Proportions Chapter 20. Objectives Hypothesis Null hypothesis Alternative hypothesis Two-sided alternative One-sided alternative

Solution

2. Hypothesis• null hypothesis: The passing rate for

teenagers is 80%, as the DMV claimed.• H0: p = .80

• alternative hypothesis: The passing rate for teenagers is less than the 80% claimed by the DMV.

• Ha: p < .80

Page 58: Testing Hypothesis About Proportions Chapter 20. Objectives Hypothesis Null hypothesis Alternative hypothesis Two-sided alternative One-sided alternative

Solution

3. Test statistic

ˆ

p pz

SD p

0 0ˆ

p qSD p

n

61ˆ .67890

p 0 .80p 90n

(.8)(.2)ˆ .0422

90SD p

.678 .82.891

.0422z

2.891z

Page 59: Testing Hypothesis About Proportions Chapter 20. Objectives Hypothesis Null hypothesis Alternative hypothesis Two-sided alternative One-sided alternative

Solution

4. P-value

P-value = .00192

( 2.891) .00192P value P z

Page 60: Testing Hypothesis About Proportions Chapter 20. Objectives Hypothesis Null hypothesis Alternative hypothesis Two-sided alternative One-sided alternative

Solution

5. Conclusion

Because the P-value of .00192 is very low, I reject the null hypothesis. This data provides strong evidence that the passing rate for teenagers taking the driving test is less the 80%.

If the passing rate for teenage driving candidates were actually 80%, we’d expect to get our sample results in only .192% of the samples, which is very unlikely.

Page 61: Testing Hypothesis About Proportions Chapter 20. Objectives Hypothesis Null hypothesis Alternative hypothesis Two-sided alternative One-sided alternative

Your Turn:

• In a given year, 13.55 of employed people in the United States reported belonging to a union. Officials from a large city contacted a random sample of 2000 city workers and 240 claimed union membership. Is there sufficient evidence to conclude that the proportion of works in this city who are union members is different from the national rate?

Page 62: Testing Hypothesis About Proportions Chapter 20. Objectives Hypothesis Null hypothesis Alternative hypothesis Two-sided alternative One-sided alternative

Solution

• Null hypothesis:• H0: p=.135

• H0: The proportion of union members in this city is equal to the national rate of .135.

• Alternative hypothesis:• Ha: p≠.135

• Ha: The proportion of union members in this city is different from the national rate of .135.

Page 63: Testing Hypothesis About Proportions Chapter 20. Objectives Hypothesis Null hypothesis Alternative hypothesis Two-sided alternative One-sided alternative

Solution

• Check ConditionsRandomization: random sample is

stated.Population size, 10% condition: 10n≤N,

20,000 is less than all the city workers if the city is large.

Sample size:

np0=2000(.135)=270>10

n(1-p0)=2000(.865)=1730>10

Page 64: Testing Hypothesis About Proportions Chapter 20. Objectives Hypothesis Null hypothesis Alternative hypothesis Two-sided alternative One-sided alternative

Solution

• Specify the sampling distribution• • p0=.135

• Calculate the test statistic

0 0(1 ) (.135)(.865)ˆ( ) .0076

2000

p pSD p

n

0 ˆ( , ( ))N p SD p

0ˆ .12 .1351.97

ˆ( ) .0076

p pzSD p

240ˆ .122000

p

Page 65: Testing Hypothesis About Proportions Chapter 20. Objectives Hypothesis Null hypothesis Alternative hypothesis Two-sided alternative One-sided alternative

Solution

• Calculate the p-value• Because it is a two-sided test, the

p-value = 2 [normalcdf(1.97,10)] or p-value = .0488

• Conclusion• The p-value is small enough to reject

the null hypothesis in favor of the alternative.

• Conclusion in context of the problem• There is sufficient evidence to conclude

that, in this city, the proportion of workers who are union members is different from the national value.

Page 66: Testing Hypothesis About Proportions Chapter 20. Objectives Hypothesis Null hypothesis Alternative hypothesis Two-sided alternative One-sided alternative

Using the TI-84

• STAT/TESTS/1-PropZTest• Input

• p0:

• x: the number selected• n: the sample size• Select type of test: ≠,<,>

• Calculate

Page 67: Testing Hypothesis About Proportions Chapter 20. Objectives Hypothesis Null hypothesis Alternative hypothesis Two-sided alternative One-sided alternative

Solve using the TI-84

1. A large city’s Department of Motor Vehicle’s claimed that 80% of candidates pass driving tests, but a newspaper’s survey of 90 randomly selected local teens who had taken the test found only 61 (68%) who passed. Does this finding suggest that the passing rate for teenagers is lower than the DMV reported?

2. In a given year, 13.55 of employed people in the United States reported belonging to a union. Officials from a large city contacted a random sample of 2000 city workers and 240 claimed union membership. Is there sufficient evidence to conclude that the proportion of works in this city who are union members is different from the national rate?

Page 68: Testing Hypothesis About Proportions Chapter 20. Objectives Hypothesis Null hypothesis Alternative hypothesis Two-sided alternative One-sided alternative

What Can Go Wrong?

• Hypothesis tests are so widely used—and so widely misused—that the issues involved are addressed in their own chapter (Chapter 21).

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

Page 69: Testing Hypothesis About Proportions Chapter 20. Objectives Hypothesis Null hypothesis Alternative hypothesis Two-sided alternative One-sided alternative

What Can Go Wrong?

• Don’t base your null hypothesis on what you see in the data.• Think about the situation you are

investigating and develop your null hypothesis appropriately.

• Don’t base your alternative hypothesis on the data, either.• Again, you need to Think about the

situation.

Page 70: Testing Hypothesis About Proportions Chapter 20. Objectives Hypothesis Null hypothesis Alternative hypothesis Two-sided alternative One-sided alternative

What Can Go Wrong?

• Don’t make your null hypothesis what you want to show to be true.• You can reject the null hypothesis, but

you can never “accept” or “prove” the null.

• Don’t forget to check the conditions.• We need randomization, independence,

and a sample that is large enough to justify the use of the Normal model.

Page 71: Testing Hypothesis About Proportions Chapter 20. Objectives Hypothesis Null hypothesis Alternative hypothesis Two-sided alternative One-sided alternative

What Can Go Wrong?

• Don’t accept the null hypothesis. • If you fail to reject the null

hypothesis, don’t think a bigger sample would be more likely to lead to rejection.• Each sample is different, and a

larger sample won’t necessarily duplicate your current observations.

Page 72: Testing Hypothesis About Proportions Chapter 20. Objectives Hypothesis Null hypothesis Alternative hypothesis Two-sided alternative One-sided alternative

What have we learned?

• We can use what we see in a random sample to test a particular hypothesis about the world.• Hypothesis testing complements our use of

confidence intervals.• 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.• We do this by finding a P-value—the probability that

data like ours could have occurred if the model is correct.

Page 73: Testing Hypothesis About Proportions Chapter 20. Objectives Hypothesis Null hypothesis Alternative hypothesis Two-sided alternative One-sided alternative

What have we learned?

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

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

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

question.

Page 74: Testing Hypothesis About Proportions Chapter 20. Objectives Hypothesis Null hypothesis Alternative hypothesis Two-sided alternative One-sided alternative

What have we learned?

• We know that confidence intervals and hypothesis tests go hand in hand in helping us think about models.• A hypothesis test makes a yes/no

decision about the plausibility of a parameter value.

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

Page 75: Testing Hypothesis About Proportions Chapter 20. Objectives Hypothesis Null hypothesis Alternative hypothesis Two-sided alternative One-sided alternative

Assignment

• Pg. 476 – 479: #1, 5 – 17 odd, 21, 23