Hypothesis Testing for Proportions - Hampden-Sydney Collegepeople.hsc.edu/faculty-staff/robbk/Math121/Lectures/Spring 2010/Le… · The seven steps of hypothesis testing. 1 State

Post on 19-Oct-2020

2 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

Transcript

Hypothesis Testing for ProportionsLecture 29

Sections 9.1 - 9.2

Robb T. Koether

Hampden-Sydney College

Fri, Mar 5, 2010

Robb T. Koether (Hampden-Sydney College) Hypothesis Testing for Proportions Fri, Mar 5, 2010 1 / 46

Outline

1 Homework Review

2 Introduction

3 The Hypothesis Testing Procedure

4 ExampleThe HypothesesThe Significance LevelThe Test StatisticThe Value of the Test StatisticThe p-ValueThe DecisionThe Conclusion

5 Assignment

Robb T. Koether (Hampden-Sydney College) Hypothesis Testing for Proportions Fri, Mar 5, 2010 2 / 46

Outline

1 Homework Review

2 Introduction

3 The Hypothesis Testing Procedure

4 ExampleThe HypothesesThe Significance LevelThe Test StatisticThe Value of the Test StatisticThe p-ValueThe DecisionThe Conclusion

5 Assignment

Robb T. Koether (Hampden-Sydney College) Hypothesis Testing for Proportions Fri, Mar 5, 2010 3 / 46

Homework Review

Exercise 8.24, page 552.Suppose that for a population, the response variable X has a N(−1,2)distribution.(a) Draw the distribution of X . Clearly indicate in your drawing the

mean and the standard deviation.

-6 -4 -2 2 4

0.05

0.10

0.15

0.20

Robb T. Koether (Hampden-Sydney College) Hypothesis Testing for Proportions Fri, Mar 5, 2010 4 / 46

Homework Review

Exercise 8.24, page 552.Suppose that for a population, the response variable X has a N(−1,2)distribution.(a) Draw the distribution of X . Clearly indicate in your drawing the

mean and the standard deviation.

-6 -4 -2 2 4

0.05

0.10

0.15

0.20

Robb T. Koether (Hampden-Sydney College) Hypothesis Testing for Proportions Fri, Mar 5, 2010 4 / 46

Homework Review

Exercise 8.24, page 552.(b) Suppose that a simple random sample of size n = 100 is selected

from this population. Let X represent the sample mean response.

(i) What is the distribution of X for a simple random sample of sizen = 100? Give all relevant features of the distribution.The CLT says that

µx = µ = −1

andσx =

σ√n

=2√100

= 0.2.

So the distribution of x is N(−1,0.2).

Robb T. Koether (Hampden-Sydney College) Hypothesis Testing for Proportions Fri, Mar 5, 2010 5 / 46

Homework Review

Exercise 8.24, page 552.(b) Suppose that a simple random sample of size n = 100 is selected

from this population. Let X represent the sample mean response.(i) What is the distribution of X for a simple random sample of size

n = 100? Give all relevant features of the distribution.

The CLT says thatµx = µ = −1

andσx =

σ√n

=2√100

= 0.2.

So the distribution of x is N(−1,0.2).

Robb T. Koether (Hampden-Sydney College) Hypothesis Testing for Proportions Fri, Mar 5, 2010 5 / 46

Homework Review

Exercise 8.24, page 552.(b) Suppose that a simple random sample of size n = 100 is selected

from this population. Let X represent the sample mean response.(i) What is the distribution of X for a simple random sample of size

n = 100? Give all relevant features of the distribution.The CLT says that

µx = µ = −1

andσx =

σ√n

=2√100

= 0.2.

So the distribution of x is N(−1,0.2).

Robb T. Koether (Hampden-Sydney College) Hypothesis Testing for Proportions Fri, Mar 5, 2010 5 / 46

Homework Review

Exercise 8.24, page 552.(ii) Draw the distribution of X . Clearly indicate in your drawing the

model, the mean, and the standard deviation.

-1.4 -1.2 -1.0 -0.8 -0.6 -0.4

0.5

1.0

1.5

2.0

Calculate P(X > −0.9). Show all steps used to get your answer.normalcdf(-0.9,E99,-1,0.2) = 0.3085.

Robb T. Koether (Hampden-Sydney College) Hypothesis Testing for Proportions Fri, Mar 5, 2010 6 / 46

Homework Review

Exercise 8.24, page 552.(iii) (ii) Draw the distribution of X . Clearly indicate in your drawing the

model, the mean, and the standard deviation.

-1.4 -1.2 -1.0 -0.8 -0.6 -0.4

0.5

1.0

1.5

2.0

Calculate P(X > −0.9). Show all steps used to get your answer.normalcdf(-0.9,E99,-1,0.2) = 0.3085.

Robb T. Koether (Hampden-Sydney College) Hypothesis Testing for Proportions Fri, Mar 5, 2010 6 / 46

Homework Review

Exercise 8.24, page 552.(iii) (ii) Draw the distribution of X . Clearly indicate in your drawing the

model, the mean, and the standard deviation.

-1.4 -1.2 -1.0 -0.8 -0.6 -0.4

0.5

1.0

1.5

2.0

Calculate P(X > −0.9). Show all steps used to get your answer.

normalcdf(-0.9,E99,-1,0.2) = 0.3085.

Robb T. Koether (Hampden-Sydney College) Hypothesis Testing for Proportions Fri, Mar 5, 2010 6 / 46

Homework Review

Exercise 8.24, page 552.(iii) (ii) Draw the distribution of X . Clearly indicate in your drawing the

model, the mean, and the standard deviation.

-1.4 -1.2 -1.0 -0.8 -0.6 -0.4

0.5

1.0

1.5

2.0

Calculate P(X > −0.9). Show all steps used to get your answer.normalcdf(-0.9,E99,-1,0.2) = 0.3085.

Robb T. Koether (Hampden-Sydney College) Hypothesis Testing for Proportions Fri, Mar 5, 2010 6 / 46

Homework Review

Exercise 8.24, page 552.

(iii) -6 -4 -2 0 2 4

0.5

1.0

1.5

2.0

The distributions of X and X

Robb T. Koether (Hampden-Sydney College) Hypothesis Testing for Proportions Fri, Mar 5, 2010 7 / 46

Outline

1 Homework Review

2 Introduction

3 The Hypothesis Testing Procedure

4 ExampleThe HypothesesThe Significance LevelThe Test StatisticThe Value of the Test StatisticThe p-ValueThe DecisionThe Conclusion

5 Assignment

Robb T. Koether (Hampden-Sydney College) Hypothesis Testing for Proportions Fri, Mar 5, 2010 8 / 46

Introduction

Any question about a population must first be stated in terms of apopulation parameter.We will work with only two parameters:

I The population mean µ.I The population proportion p.

Robb T. Koether (Hampden-Sydney College) Hypothesis Testing for Proportions Fri, Mar 5, 2010 9 / 46

Introduction

There are only two basic questions that we ask:What is the value of the parameter? (Estimation)Does the evidence support or refute a claim about the value of theparameter? (Hypothesis testing)

Robb T. Koether (Hampden-Sydney College) Hypothesis Testing for Proportions Fri, Mar 5, 2010 10 / 46

Outline

1 Homework Review

2 Introduction

3 The Hypothesis Testing Procedure

4 ExampleThe HypothesesThe Significance LevelThe Test StatisticThe Value of the Test StatisticThe p-ValueThe DecisionThe Conclusion

5 Assignment

Robb T. Koether (Hampden-Sydney College) Hypothesis Testing for Proportions Fri, Mar 5, 2010 11 / 46

The Steps of Testing a Hypothesisp-Value Approach

The seven steps of hypothesis testing.

1 State the null and alternative hypotheses.2 State the significance level.3 State the formula for the test statistic.4 Compute the value of the test statistic.5 Compute the p-value.6 Make a decision.7 State the conclusion.

Robb T. Koether (Hampden-Sydney College) Hypothesis Testing for Proportions Fri, Mar 5, 2010 12 / 46

The Steps of Testing a Hypothesisp-Value Approach

The seven steps of hypothesis testing.1 State the null and alternative hypotheses.

2 State the significance level.3 State the formula for the test statistic.4 Compute the value of the test statistic.5 Compute the p-value.6 Make a decision.7 State the conclusion.

Robb T. Koether (Hampden-Sydney College) Hypothesis Testing for Proportions Fri, Mar 5, 2010 12 / 46

The Steps of Testing a Hypothesisp-Value Approach

The seven steps of hypothesis testing.1 State the null and alternative hypotheses.2 State the significance level.

3 State the formula for the test statistic.4 Compute the value of the test statistic.5 Compute the p-value.6 Make a decision.7 State the conclusion.

Robb T. Koether (Hampden-Sydney College) Hypothesis Testing for Proportions Fri, Mar 5, 2010 12 / 46

The Steps of Testing a Hypothesisp-Value Approach

The seven steps of hypothesis testing.1 State the null and alternative hypotheses.2 State the significance level.3 State the formula for the test statistic.

4 Compute the value of the test statistic.5 Compute the p-value.6 Make a decision.7 State the conclusion.

Robb T. Koether (Hampden-Sydney College) Hypothesis Testing for Proportions Fri, Mar 5, 2010 12 / 46

The Steps of Testing a Hypothesisp-Value Approach

The seven steps of hypothesis testing.1 State the null and alternative hypotheses.2 State the significance level.3 State the formula for the test statistic.4 Compute the value of the test statistic.

5 Compute the p-value.6 Make a decision.7 State the conclusion.

Robb T. Koether (Hampden-Sydney College) Hypothesis Testing for Proportions Fri, Mar 5, 2010 12 / 46

The Steps of Testing a Hypothesisp-Value Approach

The seven steps of hypothesis testing.1 State the null and alternative hypotheses.2 State the significance level.3 State the formula for the test statistic.4 Compute the value of the test statistic.5 Compute the p-value.

6 Make a decision.7 State the conclusion.

Robb T. Koether (Hampden-Sydney College) Hypothesis Testing for Proportions Fri, Mar 5, 2010 12 / 46

The Steps of Testing a Hypothesisp-Value Approach

The seven steps of hypothesis testing.1 State the null and alternative hypotheses.2 State the significance level.3 State the formula for the test statistic.4 Compute the value of the test statistic.5 Compute the p-value.6 Make a decision.

7 State the conclusion.

Robb T. Koether (Hampden-Sydney College) Hypothesis Testing for Proportions Fri, Mar 5, 2010 12 / 46

The Steps of Testing a Hypothesisp-Value Approach

The seven steps of hypothesis testing.1 State the null and alternative hypotheses.2 State the significance level.3 State the formula for the test statistic.4 Compute the value of the test statistic.5 Compute the p-value.6 Make a decision.7 State the conclusion.

Robb T. Koether (Hampden-Sydney College) Hypothesis Testing for Proportions Fri, Mar 5, 2010 12 / 46

Outline

1 Homework Review

2 Introduction

3 The Hypothesis Testing Procedure

4 ExampleThe HypothesesThe Significance LevelThe Test StatisticThe Value of the Test StatisticThe p-ValueThe DecisionThe Conclusion

5 Assignment

Robb T. Koether (Hampden-Sydney College) Hypothesis Testing for Proportions Fri, Mar 5, 2010 13 / 46

Example

Example (Hypothesis testing)Are male births more common than female births?Suppose a random sample of 1000 live births shows that 520 aremales and 480 are females.Test the hypothesis that male births are more common thanfemale births, at the 5% level of significance.

Robb T. Koether (Hampden-Sydney College) Hypothesis Testing for Proportions Fri, Mar 5, 2010 14 / 46

Outline

1 Homework Review

2 Introduction

3 The Hypothesis Testing Procedure

4 ExampleThe HypothesesThe Significance LevelThe Test StatisticThe Value of the Test StatisticThe p-ValueThe DecisionThe Conclusion

5 Assignment

Robb T. Koether (Hampden-Sydney College) Hypothesis Testing for Proportions Fri, Mar 5, 2010 15 / 46

The Hypotheses

Select the appropriate parameter (p) and describe what itrepresents.The null hypothesis should state a hypothetical value p0 for thepopulation proportion.

H0 : p = p0.

Robb T. Koether (Hampden-Sydney College) Hypothesis Testing for Proportions Fri, Mar 5, 2010 16 / 46

The Hypotheses

The alternative hypothesis must contradict the null hypothesis inone of three ways:

I H1 : p < p0. (if direction of extreme is left.)I H1 : p > p0. (if direction of extreme is right.)I H1 : p 6= p0. (if direction of extreme is left and right.)

Robb T. Koether (Hampden-Sydney College) Hypothesis Testing for Proportions Fri, Mar 5, 2010 17 / 46

The Hypotheses

Example (Step 1)(1) Let p = proportion of births that are male.

H0 : p = 0.50.H1 : p > 0.50.

Robb T. Koether (Hampden-Sydney College) Hypothesis Testing for Proportions Fri, Mar 5, 2010 18 / 46

Outline

1 Homework Review

2 Introduction

3 The Hypothesis Testing Procedure

4 ExampleThe HypothesesThe Significance LevelThe Test StatisticThe Value of the Test StatisticThe p-ValueThe DecisionThe Conclusion

5 Assignment

Robb T. Koether (Hampden-Sydney College) Hypothesis Testing for Proportions Fri, Mar 5, 2010 19 / 46

The Level of Significance

Specify the level of significance α.

Robb T. Koether (Hampden-Sydney College) Hypothesis Testing for Proportions Fri, Mar 5, 2010 20 / 46

The Level of Significance

Example (Step 2)(2) α = 0.05.

Robb T. Koether (Hampden-Sydney College) Hypothesis Testing for Proportions Fri, Mar 5, 2010 21 / 46

Outline

1 Homework Review

2 Introduction

3 The Hypothesis Testing Procedure

4 ExampleThe HypothesesThe Significance LevelThe Test StatisticThe Value of the Test StatisticThe p-ValueThe DecisionThe Conclusion

5 Assignment

Robb T. Koether (Hampden-Sydney College) Hypothesis Testing for Proportions Fri, Mar 5, 2010 22 / 46

The Test Statistic

According to the Central Limit Theorem, the statistic p̂ has anormal distribution with

µp̂ = p

and

σp̂ =

√p(1− p)

n.

Robb T. Koether (Hampden-Sydney College) Hypothesis Testing for Proportions Fri, Mar 5, 2010 23 / 46

The Test Statistic

That is, p̂ is N(

p,√

p(1−p)n

).

Therefore, if the null hypothesis is true, then

p̂ is N

(p0,

√p0(1− p0)

n

).

Robb T. Koether (Hampden-Sydney College) Hypothesis Testing for Proportions Fri, Mar 5, 2010 24 / 46

The Test Statistic

The z-score of p̂ is computed as

z =p̂ − p0√p0(1−p0)

n

.

Because p̂ is normal, the z-score is standard normal.That is, z is N(0,1).

Robb T. Koether (Hampden-Sydney College) Hypothesis Testing for Proportions Fri, Mar 5, 2010 25 / 46

The Test Statistic

Definition (Test statistic)The test statistic is the statistic that is used to perform the hypothesistest.

If the original statistic (e.g., p̂) is normal, then the test statistic isthe z-score of that statistic.Write the name of the statistic and state the formula to be used.

Robb T. Koether (Hampden-Sydney College) Hypothesis Testing for Proportions Fri, Mar 5, 2010 26 / 46

The Test Statistic

Example (Step 3)(3) The test statistic is

Z =p̂ − p0√p0(1−p0)

n

.

Robb T. Koether (Hampden-Sydney College) Hypothesis Testing for Proportions Fri, Mar 5, 2010 27 / 46

Outline

1 Homework Review

2 Introduction

3 The Hypothesis Testing Procedure

4 ExampleThe HypothesesThe Significance LevelThe Test StatisticThe Value of the Test StatisticThe p-ValueThe DecisionThe Conclusion

5 Assignment

Robb T. Koether (Hampden-Sydney College) Hypothesis Testing for Proportions Fri, Mar 5, 2010 28 / 46

The Value of the Test Statistic

To compute the value of the test statistic, substitute the valuesobtained from the sample and from the null hypothesis.In this case, use the values of p̂, p0, and n.

Robb T. Koether (Hampden-Sydney College) Hypothesis Testing for Proportions Fri, Mar 5, 2010 29 / 46

The Value of the Test Statistic

Example (Step 4)(4) Given

p0 = 0.50,

p̂ =520

1000= 0.52,

n = 1000,

Compute

Z =0.52− 0.50√(0.50)(1−0.50)

1000

=0.02

0.01581= 1.265.

Robb T. Koether (Hampden-Sydney College) Hypothesis Testing for Proportions Fri, Mar 5, 2010 30 / 46

Outline

1 Homework Review

2 Introduction

3 The Hypothesis Testing Procedure

4 ExampleThe HypothesesThe Significance LevelThe Test StatisticThe Value of the Test StatisticThe p-ValueThe DecisionThe Conclusion

5 Assignment

Robb T. Koether (Hampden-Sydney College) Hypothesis Testing for Proportions Fri, Mar 5, 2010 31 / 46

The p-Value

To find the p-value, use the normalcdf function and the value ofthe test statistic (z).Pay attention to the direction of extreme as indicated by thealternative hypothesis.

I To the left: p-value = normalcdf(-E99,z).I To the right: p-value = normalcdf(z,E99).I Two-sided: Find the area in the appropriate tail and then double it.

Robb T. Koether (Hampden-Sydney College) Hypothesis Testing for Proportions Fri, Mar 5, 2010 32 / 46

The p-Value

Example (Step 5)(5) p-value = normalcdf(1.265,E99) = 0.1029.

Robb T. Koether (Hampden-Sydney College) Hypothesis Testing for Proportions Fri, Mar 5, 2010 33 / 46

Outline

1 Homework Review

2 Introduction

3 The Hypothesis Testing Procedure

4 ExampleThe HypothesesThe Significance LevelThe Test StatisticThe Value of the Test StatisticThe p-ValueThe DecisionThe Conclusion

5 Assignment

Robb T. Koether (Hampden-Sydney College) Hypothesis Testing for Proportions Fri, Mar 5, 2010 34 / 46

The Decision

The decision states whether to accept or reject the null hypothesis.If the p-value is less than α, then write “Reject H0.”If the p-value is greater than α, then write “Accept H0.”

Robb T. Koether (Hampden-Sydney College) Hypothesis Testing for Proportions Fri, Mar 5, 2010 35 / 46

The Decision

Example (Step 6)(6) Accept H0.

Robb T. Koether (Hampden-Sydney College) Hypothesis Testing for Proportions Fri, Mar 5, 2010 36 / 46

Outline

1 Homework Review

2 Introduction

3 The Hypothesis Testing Procedure

4 ExampleThe HypothesesThe Significance LevelThe Test StatisticThe Value of the Test StatisticThe p-ValueThe DecisionThe Conclusion

5 Assignment

Robb T. Koether (Hampden-Sydney College) Hypothesis Testing for Proportions Fri, Mar 5, 2010 37 / 46

The Conclusion

The conclusion restates the decision in the language of theoriginal problem, without using any statistical jargon.It is enough to restate in plain English the hypothesis that wasaccepted.

Robb T. Koether (Hampden-Sydney College) Hypothesis Testing for Proportions Fri, Mar 5, 2010 38 / 46

The Conclusion

Example (Step 7)(7) The proportion of male births is equal to 50%.

Robb T. Koether (Hampden-Sydney College) Hypothesis Testing for Proportions Fri, Mar 5, 2010 39 / 46

Summary

Example (The seven steps)(1) Let p = proportion of births that are male.

H0 : p = 0.50.H1 : p > 0.50.

(2) α = 0.05.

(3) The test statistic is Z =p̂ − p0√p0(1−p0)

n

.

(4) Z = 0.52−0.50√(0.50)(1−0.50)

1000

= 0.020.01581 = 1.265.

(5) p-value = normalcdf(1.265,E99) = 0.1029.(6) Accept H0.(7) The proportion of male births is equal to 50%.

Robb T. Koether (Hampden-Sydney College) Hypothesis Testing for Proportions Fri, Mar 5, 2010 40 / 46

Outline

1 Homework Review

2 Introduction

3 The Hypothesis Testing Procedure

4 ExampleThe HypothesesThe Significance LevelThe Test StatisticThe Value of the Test StatisticThe p-ValueThe DecisionThe Conclusion

5 Assignment

Robb T. Koether (Hampden-Sydney College) Hypothesis Testing for Proportions Fri, Mar 5, 2010 41 / 46

Assignment

HomeworkRead Sections 9.1 - 9.2, pages 563 - 580.Let’s Do It! 9.1, 9.2, 9.3, 9.4.Exercises 1 - 12, 14, page 580.

Robb T. Koether (Hampden-Sydney College) Hypothesis Testing for Proportions Fri, Mar 5, 2010 42 / 46

Assignment

Answers2. (a) True.

(b) False.(c) True.(d) False.

4. Type II.6. (a) Two sided.

(b) 0.6038.(c) 0.0306.(d) The percent of all shoppers in the U.S. that think that “Made in

America” means that 100% of labor plus materials are from the U.S.is not 70%.

Robb T. Koether (Hampden-Sydney College) Hypothesis Testing for Proportions Fri, Mar 5, 2010 43 / 46

Assignment

Answers8. (a) The population is all pregnant women working with a computer 1 to

20 hours per week.(b) The seven steps:

(1) p is proportion of miscarriages among women in the abovepopulation.

H0 : p = 0.20.H1 : p > 0.20.

(2) α = 0.01.(3) Z = p̂−p0√

p0(1−p0)

n

.

(4) Z = 1.4772.(5) p-value = 0.0698.(6) Accept H0.(7) The proportion of miscarriages in the above population is 0.20.

(c) No. The p-value is greater than α, so the results are not statisticallysignificant.

Robb T. Koether (Hampden-Sydney College) Hypothesis Testing for Proportions Fri, Mar 5, 2010 44 / 46

Assignment

Answers10. (a) p is proportion of all students who feel that encouraging team or

group work is important to good teaching.H0 : p = 0.50.H1 : p > 0.50.

(b) Let Z = p̂−p0√p0(1−p0)

n

. The value of Z is 4.0943.

(c) p-value = 2.1184× 10−5.(d) Reject H0. The proportion of all students who feel that encouraging

team or group work is important to good teaching is more than 0.50.

Robb T. Koether (Hampden-Sydney College) Hypothesis Testing for Proportions Fri, Mar 5, 2010 45 / 46

Assignment

Answers12. The seven steps:

(1) p is the proportion of all workers willing to work fewer hours for lesspay to obtain more time for personal leisure activities.

H0 : p = 0.20.H1 : p < 0.20.

(2) α = 0.05.(3) Z = p̂−p0√

p0(1−p0)

n

.

(4) Z = −3.6742.(5) p-value = 1.1931× 10−4.(6) Reject H0.(7) Less than 20% of all workers are willing to work fewer hours for less

pay to obtain more time for personal leisure activities.

Robb T. Koether (Hampden-Sydney College) Hypothesis Testing for Proportions Fri, Mar 5, 2010 46 / 46

Assignment

Answers14. (a) No. The p-value measures the likelihood that the observed value

would occur if H0 were true. It does not measure the likelihood thatH1 is true.

(b) 0.66.

Robb T. Koether (Hampden-Sydney College) Hypothesis Testing for Proportions Fri, Mar 5, 2010 47 / 46

top related