56
1 統統統 Spring 2004 授授授授 授授授授授授 授授2004 授 2 授 17 授 授授 授授授授 一:

統計學 Spring 2004

Embed Size (px)

DESCRIPTION

統計學 Spring 2004. 授課教師:統計系余清祥 日期:2004年2月17日 第一週:假設檢定. Chapter 9 Hypothesis Testing. Developing Null and Alternative Hypotheses Type I and Type II Errors One-Tailed Tests About a Population Mean: Large-Sample Case Two-Tailed Tests About a Population Mean: - PowerPoint PPT Presentation

Citation preview

Page 1: 統計學           Spring 2004

1 1 Slide Slide

統計學 Spring 2004

授課教師:統計系余清祥 日期: 2004 年 2 月 17 日 第一週:假設檢定

Page 2: 統計學           Spring 2004

2 2 Slide Slide

Page 3: 統計學           Spring 2004

3 3 Slide Slide

Chapter 9Chapter 9 Hypothesis Testing Hypothesis Testing

Developing Null and Alternative HypothesesDeveloping Null and Alternative Hypotheses Type I and Type II ErrorsType I and Type II Errors One-Tailed Tests About a Population Mean:One-Tailed Tests About a Population Mean:

Large-Sample CaseLarge-Sample Case Two-Tailed Tests About a Population Mean:Two-Tailed Tests About a Population Mean:

Large-Sample CaseLarge-Sample Case Tests About a Population Mean:Tests About a Population Mean:

Small-Sample CaseSmall-Sample Case

continuedcontinued

Page 4: 統計學           Spring 2004

4 4 Slide Slide

Chapter 9Chapter 9 Hypothesis Testing Hypothesis Testing

Tests About a Population ProportionTests About a Population Proportion Hypothesis Testing and Decision MakingHypothesis Testing and Decision Making Calculating the Probability of Type II ErrorsCalculating the Probability of Type II Errors Determining the Sample Size for a Hypothesis Determining the Sample Size for a Hypothesis

TestTest

about a Population Meanabout a Population Mean

Page 5: 統計學           Spring 2004

5 5 Slide Slide

Developing Null and Alternative Developing Null and Alternative HypothesesHypotheses

Hypothesis testingHypothesis testing can be used to determine can be used to determine whether a statement about the value of a whether a statement about the value of a population parameter should or should not be population parameter should or should not be rejected.rejected.

The The null hypothesisnull hypothesis, , denoted by denoted by HH0 0 , , is a tentative is a tentative assumption about a population parameter.assumption about a population parameter.

The The alternative hypothesisalternative hypothesis, denoted by , denoted by HHaa, is the , is the opposite of what is stated in the null hypothesis.opposite of what is stated in the null hypothesis.

Hypothesis testing is similar to a criminal trial. Hypothesis testing is similar to a criminal trial. The hypotheses are:The hypotheses are:

HH00: The defendant is innocent: The defendant is innocent

HHaa: The defendant is guilty: The defendant is guilty

Page 6: 統計學           Spring 2004

6 6 Slide Slide

Population

Assume thepopulationmean age is 50.(Null Hypothesis)

REJECT

The SampleMean Is 20

SampleNull Hypothesis

50?20 XIs

Hypothesis Testing Process

No, not likely!

Page 7: 統計學           Spring 2004

7 7 Slide Slide

Definitions-IDefinitions-I

Null Hypothesis (HNull Hypothesis (H00):): The hypothesis that The hypothesis that depicts the traditional belief or the depicts the traditional belief or the conventional wisdom and is conventional wisdom and is maintainedmaintained unless there is sufficient evidence to prove unless there is sufficient evidence to prove otherwise.otherwise.

Alternative Hypothesis (HAlternative Hypothesis (H11):): The hypothesis The hypothesis which serves as a which serves as a plausible alternativeplausible alternative to to replace the null hypothesis given there is replace the null hypothesis given there is sufficient evidence against the null sufficient evidence against the null hypothesis.hypothesis.

Page 8: 統計學           Spring 2004

8 8 Slide Slide

Definitions-IIDefinitions-II

Type I Error:Type I Error: The error which occurs when The error which occurs when you reject Hyou reject H00 given that it is indeed true. given that it is indeed true.

Type II Error:Type II Error: The error which occurs when The error which occurs when you do not reject Hyou do not reject H00 given that it is indeed given that it is indeed false.false.

Level of Significance Level of Significance (()) : : The maximum The maximum probability of committing a Type I Error. probability of committing a Type I Error. Sometimes Sometimes (1-(1- is called is called confidence confidence coefficientcoefficient..

Power Power (1-(1-)) : : The probability of correctly The probability of correctly rejecting the null hypothesis when it is rejecting the null hypothesis when it is really false. really false.

Page 9: 統計學           Spring 2004

9 9 Slide Slide

Decision Making and ConsequencesDecision Making and Consequences

HH0 0 TrueTrue HH0 0 FalseFalse

Do Not Reject Do Not Reject HH00

CorrectCorrect

Confidence=1-Confidence=1-Type II ErrorType II Error

P( Type II)=P( Type II)=

Reject HReject H00 Type I ErrorType I Error

P(Type I)=P(Type I)=CorrectCorrect

Power=1-Power=1-

STATES OF NATUREA

C

T

I

O

N

S

Page 10: 統計學           Spring 2004

10 10 Slide Slide

Reduce probability of one error and the other one goes up.

& Have an Inverse Relationship

Page 11: 統計學           Spring 2004

11 11 Slide Slide

To buy a mp3 playerTo buy a mp3 player

Napster aroundNapster around Napster deadNapster dead

Buy mp3 playerBuy mp3 player Confidence level of Confidence level of the testthe test

=1-=1-

P( Type II error)=P( Type II error)=

Don’t buy mp3 Don’t buy mp3 playerplayer

P(Type I error)=P(Type I error)= Power of the test =1-Power of the test =1-0.1=0.90.1=0.9

STATES OF NATUREA

C

T

I

O

N

S

Page 12: 統計學           Spring 2004

12 12 Slide Slide

Testing Research HypothesesTesting Research Hypotheses

• The research hypothesis should be The research hypothesis should be expressed as the alternative hypothesis.expressed as the alternative hypothesis.

• The conclusion that the research hypothesis The conclusion that the research hypothesis is true comes from sample data that is true comes from sample data that contradict the null hypothesis.contradict the null hypothesis.

Developing Null and Alternative Developing Null and Alternative HypothesesHypotheses

Page 13: 統計學           Spring 2004

13 13 Slide Slide

Developing Null and Alternative Developing Null and Alternative HypothesesHypotheses

Testing the Validity of a ClaimTesting the Validity of a Claim

• Manufacturers’ claims are usually given the Manufacturers’ claims are usually given the benefit of the doubt and stated as the null benefit of the doubt and stated as the null hypothesis.hypothesis.

• The conclusion that the claim is false comes The conclusion that the claim is false comes from sample data that contradict the null from sample data that contradict the null hypothesis.hypothesis.

Page 14: 統計學           Spring 2004

14 14 Slide Slide

Testing in Decision-Making SituationsTesting in Decision-Making Situations

• A decision maker might have to choose A decision maker might have to choose between two courses of action, one between two courses of action, one associated with the null hypothesis and associated with the null hypothesis and another associated with the alternative another associated with the alternative hypothesis.hypothesis.

• Example: Accepting a shipment of goods Example: Accepting a shipment of goods from a supplier or returning the shipment of from a supplier or returning the shipment of goods to the supplier.goods to the supplier.

Developing Null and Alternative Developing Null and Alternative HypothesesHypotheses

Page 15: 統計學           Spring 2004

15 15 Slide Slide

A Summary of Forms for Null and A Summary of Forms for Null and Alternative Hypotheses about a Alternative Hypotheses about a

Population MeanPopulation Mean

The equality part of the hypotheses always The equality part of the hypotheses always appears in the null hypothesis.appears in the null hypothesis.

In general, a hypothesis test about the value of a In general, a hypothesis test about the value of a population mean population mean must take one of the following must take one of the following three forms (where three forms (where 00 is the hypothesized value of is the hypothesized value of the population mean). the population mean).

HH00: : >> 00 HH00: : << 0 0 HH00: : = = 00

HHaa: : < < 00 HHaa: : > > 00 HHaa: :

00

Page 16: 統計學           Spring 2004

16 16 Slide Slide

Example: Metro EMSExample: Metro EMS

Null and Alternative HypothesesNull and Alternative Hypotheses

A major west coast city provides one of A major west coast city provides one of the most comprehensive emergency medical the most comprehensive emergency medical services in the world. Operating in a multiple services in the world. Operating in a multiple hospital system with approximately 20 mobile hospital system with approximately 20 mobile medical units, the service goal is to respond to medical units, the service goal is to respond to medical emergencies with a mean time of 12 medical emergencies with a mean time of 12 minutes or less.minutes or less.

The director of medical services wants to The director of medical services wants to formulate a hypothesis test that could use a formulate a hypothesis test that could use a sample of emergency response times to sample of emergency response times to determine whether or not the service goal of 12 determine whether or not the service goal of 12 minutes or less is being achieved.minutes or less is being achieved.

Page 17: 統計學           Spring 2004

17 17 Slide Slide

Example: Metro EMSExample: Metro EMS

Null and Alternative HypothesesNull and Alternative Hypotheses

HypothesesHypotheses Conclusion and ActionConclusion and Action

HH00: : The emergency service is meeting The emergency service is meeting

the response goal; no follow-upthe response goal; no follow-up

action is necessary.action is necessary.

HHaa:: The emergency service is not The emergency service is not

meeting the response goal;meeting the response goal;

appropriate follow-up action isappropriate follow-up action is

necessary.necessary.

Where: Where: = mean response time for the population = mean response time for the population

of medical emergency requests.of medical emergency requests.

Page 18: 統計學           Spring 2004

18 18 Slide Slide

Type I and Type II ErrorsType I and Type II Errors

Since hypothesis tests are based on sample data, Since hypothesis tests are based on sample data, we must allow for the possibility of errors.we must allow for the possibility of errors.

A A Type I errorType I error is rejecting is rejecting HH00 when it is true. when it is true. A A Type II errorType II error is accepting is accepting HH00 when it is false. when it is false. The person conducting the hypothesis test The person conducting the hypothesis test

specifies the maximum allowable probability of specifies the maximum allowable probability of making amaking aType I error, denoted by Type I error, denoted by and called the and called the level of level of significancesignificance..

Generally, we cannot control for the probability of Generally, we cannot control for the probability of making a Type II error, denoted by making a Type II error, denoted by ..

Statistician avoids the risk of making a Type II Statistician avoids the risk of making a Type II error by using “do not reject error by using “do not reject HH00” and not “accept ” and not “accept HH00”.”.

Page 19: 統計學           Spring 2004

19 19 Slide Slide

Type I and Type II ErrorsType I and Type II Errors

Population ConditionPopulation Condition

HH0 0 TrueTrue HHa a TrueTrue

ConclusionConclusion (( ) ) (( ) )

AcceptAccept HH00 CorrectCorrect Type II Type II

(Conclude (Conclude Conclusion Conclusion Error Error

RejectReject HH00 Type IType I Correct Correct

(Conclude (Conclude rrorrror Conclusion Conclusion

Example: Metro EMSExample: Metro EMS

Page 20: 統計學           Spring 2004

20 20 Slide Slide

The Use of The Use of pp-Values-Values

The The pp-value-value is the probability of obtaining a is the probability of obtaining a sample result that is at least as unlikely as sample result that is at least as unlikely as what is observed.what is observed.

The The pp-value can be used to make the decision -value can be used to make the decision in a hypothesis test by noting that:in a hypothesis test by noting that:• if the if the pp-value is less than the level of -value is less than the level of

significance significance , the value of the test statistic , the value of the test statistic is in the rejection region.is in the rejection region.

• if the if the pp-value is greater than or equal to -value is greater than or equal to , , the value of the test statistic is not in the the value of the test statistic is not in the rejection region.rejection region.

Reject Reject HH00 if the if the pp-value < -value < ..

Page 21: 統計學           Spring 2004

21 21 Slide Slide

The Steps of Hypothesis TestingThe Steps of Hypothesis Testing

Determine the appropriate hypotheses.Determine the appropriate hypotheses. Select the test statistic for deciding whether or Select the test statistic for deciding whether or

not to reject the null hypothesis.not to reject the null hypothesis. Specify the level of significance Specify the level of significance for the test. for the test. Use Use to develop the rule for rejecting to develop the rule for rejecting HH00.. Collect the sample data and compute the Collect the sample data and compute the

value of the test statistic.value of the test statistic. a) Compare the test statistic to the critical a) Compare the test statistic to the critical

value(s) in the rejection rule, or value(s) in the rejection rule, or b) Compute the b) Compute the pp-value based on the test -value based on the test statistic and compare it to statistic and compare it to to determine to determine whether or not to reject whether or not to reject HH00..

Page 22: 統計學           Spring 2004

22 22 Slide Slide

HypothesesHypotheses

HH00: : oror HH00: :

HHaa::HHaa::

Test StatisticTest Statistic

KnownKnown Unknown Unknown

Rejection RuleRejection Rule

Reject Reject HH0 0 if if zz > > zzReject Reject HH0 0 if if zz < - < -zz

One-Tailed Tests about a Population One-Tailed Tests about a Population Mean: Large-Sample Case (Mean: Large-Sample Case (nn >> 30) 30)

z xn

0

/z x

n

0

/z xs n

0

/z xs n

0

/

Page 23: 統計學           Spring 2004

23 23 Slide Slide

Example: Metro EMSExample: Metro EMS

One-Tailed Test about a Population Mean: One-Tailed Test about a Population Mean: Large Large nn

Let Let = = PP(Type I Error) = .05 (Type I Error) = .05

Sampling distribution of (assuming H0 is true and = 12)

Sampling distribution of (assuming H0 is true and = 12)

xx

1212 c c

Reject H0Reject H0

Do Not Reject H0Do Not Reject H0

xx1.6451.645xx

(Critical value)(Critical value)

Page 24: 統計學           Spring 2004

24 24 Slide Slide

Example: Metro EMSExample: Metro EMS

One-Tailed Test about a Population Mean: Large One-Tailed Test about a Population Mean: Large nn

Let Let nn = 40, = 13.25 minutes, = 40, = 13.25 minutes, ss = 3.2 = 3.2 minutesminutes

(The sample standard deviation (The sample standard deviation ss can be used to can be used to

estimate the population standard deviation estimate the population standard deviation .).)

Since 2.47 > 1.645, we reject Since 2.47 > 1.645, we reject HH00..

ConclusionConclusion: : We are 95% confident that Metro We are 95% confident that Metro EMSEMS

is not meeting the response goal of 12 minutes;is not meeting the response goal of 12 minutes;

appropriate action should be taken to improveappropriate action should be taken to improve

service.service.

xx

zx

n /

.. /

.13 25 123 2 40

2 47zx

n /

.. /

.13 25 123 2 40

2 47

Page 25: 統計學           Spring 2004

25 25 Slide Slide

Example: Metro EMSExample: Metro EMS

Using the Using the pp-value to Test the Hypothesis-value to Test the Hypothesis

Recall that Recall that zz = 2.47 for = 13.25. Then = 2.47 for = 13.25. Then pp--value = .0068.value = .0068.

Since Since pp-value < -value < , that is .0068 < .05, , that is .0068 < .05, we we reject reject HH00..

Using the Using the pp-value to Test the Hypothesis-value to Test the Hypothesis

Recall that Recall that zz = 2.47 for = 13.25. Then = 2.47 for = 13.25. Then pp--value = .0068.value = .0068.

Since Since pp-value < -value < , that is .0068 < .05, , that is .0068 < .05, we we reject reject HH00..

xx

p-valuep-value

00 1.645 1.645

Do Not Reject H0Do Not Reject H0

Reject H0Reject H0

zz2.472.47

Page 26: 統計學           Spring 2004

26 26 Slide Slide

HypothesesHypotheses

HH00: :

HHaa::

Test StatisticTest Statistic KnownKnown Unknown Unknown

Rejection RuleRejection Rule

Reject Reject HH0 0 if |if |zz| > | > zz

Two-Tailed Tests about a Population Two-Tailed Tests about a Population Mean: Mean:

Large-Sample Case (Large-Sample Case (nn >> 30) 30)

z xn

0

/z x

n

0

/z xs n

0

/z xs n

0

/

Page 27: 統計學           Spring 2004

27 27 Slide Slide

Example: Glow ToothpasteExample: Glow Toothpaste

Two-Tailed Tests about a Population Mean: Large Two-Tailed Tests about a Population Mean: Large nn

The production line for Glow toothpaste is The production line for Glow toothpaste is designed to fill tubes of toothpaste with a mean designed to fill tubes of toothpaste with a mean weight of 6 ounces. weight of 6 ounces.

Periodically, a sample of 30 tubes will be Periodically, a sample of 30 tubes will be selected in order to check the filling process. selected in order to check the filling process. Quality assurance procedures call for the Quality assurance procedures call for the continuation of the filling process if the sample continuation of the filling process if the sample results are consistent with the assumption that the results are consistent with the assumption that the mean filling weight for the population of mean filling weight for the population of toothpaste tubes is 6 ounces; otherwise the filling toothpaste tubes is 6 ounces; otherwise the filling process will be stopped and adjusted.process will be stopped and adjusted.

Page 28: 統計學           Spring 2004

28 28 Slide Slide

Example: Glow ToothpasteExample: Glow Toothpaste

Two-Tailed Tests about a Population Mean: Large Two-Tailed Tests about a Population Mean: Large nn

A hypothesis test about the population mean A hypothesis test about the population mean can be used to help determine when the filling can be used to help determine when the filling process should continue operating and when it process should continue operating and when it should be stopped and corrected.should be stopped and corrected.

• HypothesesHypotheses

HH00: :

HHaa::

• Rejection RuleRejection Rule

ssuming a .05 level of significance, ssuming a .05 level of significance,

Reject Reject HH0 0 if if z z < -1.96 or if < -1.96 or if zz > 1.96 > 1.96

Page 29: 統計學           Spring 2004

29 29 Slide Slide

Example: Glow ToothpasteExample: Glow Toothpaste

Two-Tailed Test about a Population Mean: Two-Tailed Test about a Population Mean: Large Large nn

Sampling distribution of (assuming H0 is true and = 6)

Sampling distribution of (assuming H0 is true and = 6)

xx

00 1.96 1.96

Reject H0Reject H0Do Not Reject H0Do Not Reject H0

zz

Reject H0Reject H0

-1.96 -1.96

Page 30: 統計學           Spring 2004

30 30 Slide Slide

Example: Glow ToothpasteExample: Glow Toothpaste

Two-Tailed Test about a Population Mean: Large Two-Tailed Test about a Population Mean: Large nn

Assume that a sample of 30 toothpaste tubesAssume that a sample of 30 toothpaste tubes

provides a sample mean of 6.1 ounces and provides a sample mean of 6.1 ounces and standardstandard

deviation of 0.2 ounces.deviation of 0.2 ounces.

Let Let nn = 30, = 6.1 ounces, = 30, = 6.1 ounces, ss = .2 = .2 ouncesounces

Since 2.74 > 1.96, we reject Since 2.74 > 1.96, we reject HH00..

ConclusionConclusion: : We are 95% confident that the mean We are 95% confident that the mean filling weight of the toothpaste tubes is not 6 filling weight of the toothpaste tubes is not 6 ounces. The filling process should be stopped and ounces. The filling process should be stopped and the filling mechanism adjusted.the filling mechanism adjusted.

Two-Tailed Test about a Population Mean: Large Two-Tailed Test about a Population Mean: Large nn

Assume that a sample of 30 toothpaste tubesAssume that a sample of 30 toothpaste tubes

provides a sample mean of 6.1 ounces and provides a sample mean of 6.1 ounces and standardstandard

deviation of 0.2 ounces.deviation of 0.2 ounces.

Let Let nn = 30, = 6.1 ounces, = 30, = 6.1 ounces, ss = .2 = .2 ouncesounces

Since 2.74 > 1.96, we reject Since 2.74 > 1.96, we reject HH00..

ConclusionConclusion: : We are 95% confident that the mean We are 95% confident that the mean filling weight of the toothpaste tubes is not 6 filling weight of the toothpaste tubes is not 6 ounces. The filling process should be stopped and ounces. The filling process should be stopped and the filling mechanism adjusted.the filling mechanism adjusted.

74.230/2.

61.6

/0

ns

xz

74.2

30/2.

61.6

/0

ns

xz

xx

Page 31: 統計學           Spring 2004

31 31 Slide Slide

Example: Glow ToothpasteExample: Glow Toothpaste

Using the Using the pp-Value for a Two-Tailed Hypothesis Test-Value for a Two-Tailed Hypothesis Test

Suppose we define the Suppose we define the pp-value for a two-tailed test as -value for a two-tailed test as double double the area found in the tail of the distribution.the area found in the tail of the distribution.

With With zz = 2.74, the standard normal probability = 2.74, the standard normal probability

table shows there is a .5000 - .4969 = .0031 probabilitytable shows there is a .5000 - .4969 = .0031 probability

of a difference larger than .1 in the upper tail of theof a difference larger than .1 in the upper tail of the

distribution.distribution.

Considering the same probability of a larger difference in Considering the same probability of a larger difference in the lower tail of the distribution, we havethe lower tail of the distribution, we have

pp-value = 2(.0031) = .0062-value = 2(.0031) = .0062

The The pp-value .0062 is less than -value .0062 is less than = .05, so = .05, so HH00 is rejected. is rejected.

Page 32: 統計學           Spring 2004

32 32 Slide Slide

Confidence Interval Approach to aConfidence Interval Approach to aTwo-Tailed Test about a Population MeanTwo-Tailed Test about a Population Mean

Select a simple random sample from the Select a simple random sample from the population and use the value of the sample population and use the value of the sample mean to develop the confidence interval for mean to develop the confidence interval for the population mean the population mean ..

If the confidence interval contains the If the confidence interval contains the hypothesized value hypothesized value 00, do not reject , do not reject HH00. . Otherwise, reject Otherwise, reject HH00..

xx

Page 33: 統計學           Spring 2004

33 33 Slide Slide

Example: Glow ToothpasteExample: Glow Toothpaste

Confidence Interval Approach to a Two-Tailed Confidence Interval Approach to a Two-Tailed Hypothesis TestHypothesis Test

The 95% confidence interval for The 95% confidence interval for is is

or 6.0284 to 6.1716or 6.0284 to 6.1716

Since the hypothesized value for the Since the hypothesized value for the population mean, population mean, 00 = 6, is not in this interval, = 6, is not in this interval, the hypothesis-testing conclusion is that the null the hypothesis-testing conclusion is that the null hypothesis,hypothesis,

HH00: : = 6, can be rejected. = 6, can be rejected.

x zn

/ . . (. ) . .2 6 1 1 96 2 30 6 1 0716x zn

/ . . (. ) . .2 6 1 1 96 2 30 6 1 0716

Page 34: 統計學           Spring 2004

34 34 Slide Slide

Test StatisticTest Statistic KnownKnown Unknown Unknown

This test statistic has a This test statistic has a tt distribution with distribution with nn - 1 - 1 degrees of freedom.degrees of freedom.

Rejection RuleRejection Rule

One-TailedOne-Tailed Two-TailedTwo-Tailed

HH00: : Reject Reject HH0 0 if if tt > > tt HH00: : Reject Reject HH0 0 if if tt < - < -tt HH00: : Reject Reject HH0 0 if |if |tt| > | > tt

Tests about a Population Mean:Tests about a Population Mean:Small-Sample Case (Small-Sample Case (nn < 30) < 30)

tx

n

0

/tx

n

0

/txs n

0

/txs n

0

/

Page 35: 統計學           Spring 2004

35 35 Slide Slide

p p -Values and the -Values and the tt Distribution Distribution

The format of the The format of the tt distribution table provided distribution table provided in most statistics textbooks does not have in most statistics textbooks does not have sufficient detail to determine the sufficient detail to determine the exactexact p p-value -value for a hypothesis test.for a hypothesis test.

However, we can still use the However, we can still use the tt distribution distribution table to identify a table to identify a rangerange for the for the pp-value.-value.

An advantage of computer software packages An advantage of computer software packages is that the computer output will provide the is that the computer output will provide the pp--value for thevalue for the

tt distribution. distribution.

Page 36: 統計學           Spring 2004

36 36 Slide Slide

Example: Highway PatrolExample: Highway Patrol

One-Tailed Test about a Population Mean: Small One-Tailed Test about a Population Mean: Small nn

A State Highway Patrol periodically samples A State Highway Patrol periodically samples vehicle speeds at various locations on a particular vehicle speeds at various locations on a particular roadway. The sample of vehicle speeds is used to roadway. The sample of vehicle speeds is used to test the hypothesis test the hypothesis

HH00: : << 65. 65.

The locations where The locations where HH00 is rejected are deemed the is rejected are deemed the best locations for radar traps.best locations for radar traps.

At Location F, a sample of 16 vehicles shows At Location F, a sample of 16 vehicles shows a mean speed of 68.2 mph with a standard a mean speed of 68.2 mph with a standard deviation of 3.8 mph. Use an deviation of 3.8 mph. Use an = .05 to test the = .05 to test the hypothesis.hypothesis.

Page 37: 統計學           Spring 2004

37 37 Slide Slide

Example: Highway PatrolExample: Highway Patrol

One-Tailed Test about a Population Mean: Small One-Tailed Test about a Population Mean: Small nn

Let Let nn = 16, = 68.2 mph, = 16, = 68.2 mph, ss = 3.8 mph = 3.8 mph

= .05, d.f. = 16-1 = 15, = .05, d.f. = 16-1 = 15, tt = 1.753 = 1.753

Since 3.37 > 1.753, we reject Since 3.37 > 1.753, we reject HH00..

ConclusionConclusion: : We are 95% confident that the mean We are 95% confident that the mean speed of vehicles at Location F is greater than 65 speed of vehicles at Location F is greater than 65 mph. Location F is a good candidate for a radar mph. Location F is a good candidate for a radar trap. trap.

37.316/8.3

652.68

/0

ns

xt

37.3

16/8.3

652.68

/0

ns

xt

xx

Page 38: 統計學           Spring 2004

38 38 Slide Slide

Summary of Test Statistics to be Used in aSummary of Test Statistics to be Used in aHypothesis Test about a Population MeanHypothesis Test about a Population Mean

n n >> 30 ? 30 ?

known ?known ?

Popul. Popul. approx.approx.normal normal

?? known ?known ?

Use Use ss to toestimate estimate

Use Use ss to toestimate estimate

Increase Increase nnto to >> 30 30/

xz

n

/

xz

n

/

xzs n

/

xzs n

/

xz

n

/

xz

n

/

xts n

/

xts n

YesYes

YesYes

YesYes

YesYes

NoNo

NoNo

NoNo

NoNo

Page 39: 統計學           Spring 2004

39 39 Slide Slide

Z0

Reject H0

Z0

Reject H0

H0: H1: < 0

H0: 0 H1: > 0

Must Be Significantly Below = 0

Small values don’t contradict H0

Don’t Reject H0!

Rejection Region

Page 40: 統計學           Spring 2004

40 40 Slide Slide

Does an average box of cereal contain more than 368 grams of cereal? A random sample of 25 boxes showed X = 372.5. The company has specified to be 15 grams. Test at the 0.05 level.

368 gm.

Example: One Tail Test

H0: 368 H1: > 368

_

Page 41: 統計學           Spring 2004

41 41 Slide Slide

= 0.025n = 25Critical Value: 1.645

Test Statistic:

Decision:

Conclusion:

Do Not Reject at = .05

No Evidence True Mean Is More than 368Z0 1.645

.05

Reject

Example Solution: One Tail

H0: 368 H1: > 368 50.1

n

XZ

Page 42: 統計學           Spring 2004

42 42 Slide Slide

Z0 1.50

p Value.0668

Z Value of Sample Statistic

From Z Table: Lookup 1.50

.9332

Use the alternative hypothesis to find the direction of the test.

1.0000 - .9332 .0668

p Value is P(Z 1.50) = 0.0668

p Value Solution

Page 43: 統計學           Spring 2004

43 43 Slide Slide

A Summary of Forms for Null and A Summary of Forms for Null and Alternative Hypotheses about a Alternative Hypotheses about a

Population ProportionPopulation Proportion The equality part of the hypotheses always The equality part of the hypotheses always

appears in the null hypothesis.appears in the null hypothesis. In general, a hypothesis test about the value of In general, a hypothesis test about the value of

a population proportion a population proportion pp must take one of the must take one of the following three forms (where following three forms (where pp00 is the is the hypothesized value of the population hypothesized value of the population proportion). proportion).

HH00: : pp >> pp00 HH00: : pp << pp00 HH00: : pp = = pp00

HHaa: : pp < < pp00 HHaa: : pp > > pp00 HHaa: : pp

pp00

Page 44: 統計學           Spring 2004

44 44 Slide Slide

Tests about a Population Proportion:Tests about a Population Proportion:Large-Sample Case (Large-Sample Case (npnp >> 5 and 5 and nn(1 - (1 - pp) ) >>

5)5) Test StatisticTest Statistic

where:where:

Rejection RuleRejection Rule

One-TailedOne-Tailed Two-TailedTwo-Tailed

HH00: : pppp Reject Reject HH0 0 if z > zif z > z

HH00: : pppp Reject Reject HH0 0 if z < -zif z < -z

HH00: : pppp Reject Reject HH0 0 if |z| > if |z| > zz

zp p

p

0

z

p p

p

0

pp p

n

0 01( ) pp p

n

0 01( )

Page 45: 統計學           Spring 2004

45 45 Slide Slide

Example: NSCExample: NSC

Two-Tailed Test about a Population Proportion: Two-Tailed Test about a Population Proportion: Large Large nn

For a Christmas and New Year’s week, For a Christmas and New Year’s week, the National Safety Council estimated that 500 the National Safety Council estimated that 500 people would be killed and 25,000 injured on people would be killed and 25,000 injured on the nation’s roads. The NSC claimed that 50% the nation’s roads. The NSC claimed that 50% of the accidents would be caused by drunk of the accidents would be caused by drunk driving.driving.

A sample of 120 accidents showed that A sample of 120 accidents showed that 67 were caused by drunk driving. Use these 67 were caused by drunk driving. Use these data to test the NSC’s claim with data to test the NSC’s claim with = 0.05. = 0.05.

Page 46: 統計學           Spring 2004

46 46 Slide Slide

Example: NSCExample: NSC

Two-Tailed Test about a Population Proportion: Two-Tailed Test about a Population Proportion: Large Large nn

• HypothesisHypothesis

HH00: : pp = .5 = .5

HHaa: : pp .5 .5

• Test StatisticTest Statistic

0 (67/ 120) .51.278

.045644p

p pz

0 (67/ 120) .51.278

.045644p

p pz

0 0(1 ) .5(1 .5).045644

120p

p p

n

0 0(1 ) .5(1 .5)

.045644120p

p p

n

Page 47: 統計學           Spring 2004

47 47 Slide Slide

Example: NSCExample: NSC

Two-Tailed Test about a Population Proportion: Two-Tailed Test about a Population Proportion: Large Large nn

• Rejection RuleRejection Rule

Reject Reject HH00 if if zz < -1.96 or < -1.96 or zz > 1.96 > 1.96

• ConclusionConclusion

Do not reject Do not reject HH00. .

For For zz = 1.278, the = 1.278, the pp-value is .201. If -value is .201. If we rejectwe reject

HH00, we exceed the maximum allowed , we exceed the maximum allowed risk of risk of committing a Type I error (committing a Type I error (pp--value > .050).value > .050).

Page 48: 統計學           Spring 2004

48 48 Slide Slide

Hypothesis Testing and Decision MakingHypothesis Testing and Decision Making

In many decision-making situations the In many decision-making situations the decision maker may want, and in some cases decision maker may want, and in some cases may be forced, to take action with both the may be forced, to take action with both the conclusion do not reject conclusion do not reject HH00 and the conclusion and the conclusion reject reject HH00..

In such situations, it is recommended that the In such situations, it is recommended that the hypothesis-testing procedure be extended to hypothesis-testing procedure be extended to include consideration of making a Type II error.include consideration of making a Type II error.

Page 49: 統計學           Spring 2004

49 49 Slide Slide

Calculating the Probability of a Type II Calculating the Probability of a Type II Error Error

in Hypothesis Tests about a Population in Hypothesis Tests about a Population MeanMean1. 1. Formulate the null and alternative hypotheses.Formulate the null and alternative hypotheses.

2. Use the level of significance 2. Use the level of significance to establish a to establish a rejection rule based on the test statistic.rejection rule based on the test statistic.

3. Using the rejection rule, solve for the value of 3. Using the rejection rule, solve for the value of the sample mean that identifies the rejection the sample mean that identifies the rejection region.region.

4. Use the results from step 3 to state the values of 4. Use the results from step 3 to state the values of the sample mean that lead to the acceptance of the sample mean that lead to the acceptance of HH00; this defines the acceptance region.; this defines the acceptance region.

5. Using the sampling distribution of for any 5. Using the sampling distribution of for any value of value of from the alternative hypothesis, and from the alternative hypothesis, and the acceptance region from step 4, compute the the acceptance region from step 4, compute the probability that the sample mean will be in the probability that the sample mean will be in the acceptance region.acceptance region.

xx

Page 50: 統計學           Spring 2004

50 50 Slide Slide

Example: Metro EMS (revisited)Example: Metro EMS (revisited)

Calculating the Probability of a Type II ErrorCalculating the Probability of a Type II Error

1. Hypotheses are: 1. Hypotheses are: HH00: : and and HHaa::

2. Rejection rule is: Reject 2. Rejection rule is: Reject HH00 if if zz > 1.645 > 1.645

3. Value of the sample mean that identifies the 3. Value of the sample mean that identifies the rejection region:rejection region:

4. We will accept 4. We will accept HH00 when when xx << 12.8323 12.8323

121.645

3.2/ 40x

z

12

1.6453.2/ 40

xz

3.212 1.645 12.8323

40x

3.212 1.645 12.8323

40x

Page 51: 統計學           Spring 2004

51 51 Slide Slide

Example: Metro EMS (revisited)Example: Metro EMS (revisited)

Calculating the Probability of a Type II ErrorCalculating the Probability of a Type II Error

5. Probabilities that the sample mean will be in 5. Probabilities that the sample mean will be in the the acceptance region:acceptance region:

Values of Values of 1- 1-14.014.0 -2.31-2.31 .0104.0104 .9896.989613.613.6 -1.52-1.52 .0643.0643 .9357.935713.213.2 -0.73-0.73 .2327.2327 .7673.767312.8312.83 0.00 0.00 .5000.5000 .5000.500012.812.8 0.06 0.06 .5239.5239 .4761.476112.412.4 0.85 0.85 .8023.8023 .1977.197712.000112.0001 1.645 1.645 .9500.9500 .0500.0500

12.83233.2/ 40

z

12.83233.2/ 40

z

Page 52: 統計學           Spring 2004

52 52 Slide Slide

Example: Metro EMS (revisited)Example: Metro EMS (revisited)

Calculating the Probability of a Type II ErrorCalculating the Probability of a Type II Error

Observations about the preceding table:Observations about the preceding table:

• When the true population mean When the true population mean is close to is close to the null hypothesis value of 12, there is a the null hypothesis value of 12, there is a high probability that we will make a Type II high probability that we will make a Type II error.error.

• When the true population mean When the true population mean is far is far above the null hypothesis value of 12, there above the null hypothesis value of 12, there is a low probability that we will make a Type is a low probability that we will make a Type II error.II error.

Page 53: 統計學           Spring 2004

53 53 Slide Slide

Power of the TestPower of the Test

The probability of correctly rejecting The probability of correctly rejecting HH00 when it when it is false is called the is false is called the powerpower of the test. of the test.

For any particular value of For any particular value of , the power is 1 – , the power is 1 – ..

We can show graphically the power associated We can show graphically the power associated with each value of with each value of ; such a graph is called a ; such a graph is called a power curvepower curve..

Page 54: 統計學           Spring 2004

54 54 Slide Slide

Determining the Sample SizeDetermining the Sample Sizefor a Hypothesis Test About a Population for a Hypothesis Test About a Population

MeanMean

wherewhere

zz = = zz value providing an area of value providing an area of in the tail in the tail

zz = = zz value providing an area of value providing an area of in the tail in the tail= population standard deviation= population standard deviation

00 = value of the population mean in = value of the population mean in HH00

a a = value of the population mean used for = value of the population mean used for thethe Type II error Type II error

Note: In a two-tailed hypothesis test, use Note: In a two-tailed hypothesis test, use zz /2 /2 not not zz

nz z

a

( )

( )

2 2

02

nz z

a

( )

( )

2 2

02

Page 55: 統計學           Spring 2004

55 55 Slide Slide

Relationship among Relationship among , , , and , and nn

Once two of the three values are known, the Once two of the three values are known, the other can be computed.other can be computed.

For a given level of significance For a given level of significance , increasing , increasing the sample size the sample size nn will reduce will reduce ..

For a given sample size For a given sample size nn, decreasing , decreasing will will increase increase , whereas increasing , whereas increasing will decrease will decrease b.b.

Page 56: 統計學           Spring 2004

56 56 Slide Slide

End of Chapter 9End of Chapter 9