48
Hypothesis Testing Developing Null and Alternative Hypotheses Developing Null and Alternative Hypotheses Type I and Type II Errors Type I and Type II Errors One-Tailed Tests About a Population Mean: One-Tailed Tests About a Population Mean: Large-Sample Case Large-Sample Case Two-Tailed Tests About a Population Mean: Two-Tailed Tests About a Population Mean: Large-Sample Case Large-Sample Case Tests About a Population Mean: Tests About a Population Mean: Small-Sample Case Small-Sample Case

Hypothesis Testing Developing Null and Alternative Hypotheses Developing Null and Alternative Hypotheses Type I and Type II Errors Type I and Type II Errors

Embed Size (px)

Citation preview

Page 1: Hypothesis Testing Developing Null and Alternative Hypotheses Developing Null and Alternative Hypotheses Type I and Type II Errors Type I and Type II Errors

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

Page 2: Hypothesis Testing Developing Null and Alternative Hypotheses Developing Null and Alternative Hypotheses Type I and Type II Errors Type I and Type II Errors

Developing Null and Alternative Hypotheses Hypothesis testingHypothesis testing can be used to determine whether can be used to determine whether a statement about the value of a population parametera statement about the value of a population parameter should or should not be rejected.should or should not be rejected. The The null hypothesisnull hypothesis, , denoted by denoted by HH0 0 , , is a tentativeis a tentative assumption about a population parameter.assumption about a population parameter. The The alternative hypothesis,alternative 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. The alternative hypothesis is what the test isThe alternative hypothesis is what the test is attempting to establish.attempting to establish.

Page 3: Hypothesis Testing Developing Null and Alternative Hypotheses Developing Null and Alternative Hypotheses Type I and Type II Errors Type I and Type II Errors

• Testing Research Hypotheses

Developing Null and Alternative Hypotheses

• Hypothesis testing is proof by contradiction.Hypothesis testing is proof by contradiction.

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

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

Page 4: Hypothesis Testing Developing Null and Alternative Hypotheses Developing Null and Alternative Hypotheses Type I and Type II Errors Type I and Type II Errors

Developing Null and Alternative Hypotheses

• Testing the Validity of a Claim

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

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

Page 5: Hypothesis Testing Developing Null and Alternative Hypotheses Developing Null and Alternative Hypotheses Type I and Type II Errors Type I and Type II Errors

• Testing in Decision-Making Situations

Developing Null and Alternative Hypotheses

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

• Example: Accepting a shipment of goods from aExample: Accepting a shipment of goods from a supplier or returning the shipment of goods to thesupplier or returning the shipment of goods to the suppliersupplier

Page 6: Hypothesis Testing Developing Null and Alternative Hypotheses Developing Null and Alternative Hypotheses Type I and Type II Errors Type I and Type II Errors

One-tailedOne-tailed(lower-tail)(lower-tail)

One-tailedOne-tailed(upper-tail)(upper-tail)

Two-tailedTwo-tailed

0 0: H 0 0: H

0: aH 0: aH 0 0: H 0 0: H

0: aH 0: aH 0 0: H 0 0: H

0: aH 0: aH

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

Population MeanPopulation Mean The equality part of the hypotheses always appearsThe equality part of the hypotheses always appears

in the null hypothesis.in the null hypothesis. In general, a hypothesis test about the value of aIn general, a hypothesis test about the value of a population mean population mean must take one of the followingmust 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).

Page 7: Hypothesis Testing Developing Null and Alternative Hypotheses Developing Null and Alternative Hypotheses Type I and Type II Errors Type I and Type II Errors

• Null and Alternative Hypotheses A major west coast city providesone of the most comprehensiveemergency medical services inthe world. Operating in a multiplehospital system with approximately 20 mobile medicalunits, the service goal is to respond to medicalemergencies with a mean time of 12 minutes or less.

Example: Metro EMS

Page 8: Hypothesis Testing Developing Null and Alternative Hypotheses Developing Null and Alternative Hypotheses Type I and Type II Errors Type I and Type II Errors

Null and Alternative HypothesesNull and Alternative Hypotheses

The director of medical servicesThe director of medical services

wants to formulate a hypothesiswants to formulate a hypothesis

test that could use a sample oftest that could use a sample of

emergency response times toemergency response times to

determine whether or not thedetermine whether or not the

service goal of 12 minutes or lessservice goal of 12 minutes or less

is being achieved.is being achieved.

Example: Metro EMSExample: Metro EMS

Page 9: Hypothesis Testing Developing Null and Alternative Hypotheses Developing Null and Alternative Hypotheses Type I and Type II Errors Type I and Type II Errors

Null and Alternative HypothesesNull and Alternative Hypotheses

The emergency service is meetingThe emergency service is meeting

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

action is necessary.action is necessary.

The emergency service is notThe emergency service is not

meeting the response goal;meeting the response goal;

appropriate follow-up action isappropriate follow-up action is

necessary.necessary.

HH00: :

HHaa::

where: where: = mean response time for the population = mean response time for the population of medical emergency requestsof medical emergency requests

Page 10: Hypothesis Testing Developing Null and Alternative Hypotheses Developing Null and Alternative Hypotheses Type I and Type II Errors Type I and Type II Errors

Type I and Type II Errors

Because hypothesis tests are based on sample data,Because 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.

The person conducting the hypothesis test specifiesThe person conducting the hypothesis test specifies

the maximum allowable probability of making athe maximum allowable probability of making a

Type I error, denoted by Type I error, denoted by and called the and called the level oflevel of

significancesignificance..

Page 11: Hypothesis Testing Developing Null and Alternative Hypotheses Developing Null and Alternative Hypotheses Type I and Type II Errors Type I and Type II Errors

Type I and Type II ErrorsType I and Type II Errors

A A Type II errorType II error is accepting is accepting HH00 when it is false. when it is false.

It is difficult to control for the probability of makingIt is difficult to control for the probability of making

a Type II error, denoted by a Type II error, denoted by ..

Statisticians avoid the risk of making a Type IIStatisticians avoid 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 12: Hypothesis Testing Developing Null and Alternative Hypotheses Developing Null and Alternative Hypotheses Type I and Type II Errors Type I and Type II Errors

Type I and Type II ErrorsType I and Type II Errors

CorrectCorrectDecisionDecision Type II ErrorType II Error

CorrectCorrectDecisionDecisionType I ErrorType I Error

RejectReject HH00

(Conclude (Conclude > 12) > 12)

AcceptAccept HH00

(Conclude(Conclude << 12) 12)

HH0 0 TrueTrue(( << 12) 12)

HH0 0 FalseFalse

(( > 12) > 12)ConclusionConclusion

Population Condition Population Condition

Page 13: Hypothesis Testing Developing Null and Alternative Hypotheses Developing Null and Alternative Hypotheses Type I and Type II Errors Type I and Type II Errors

Using the Test StatisticUsing the Test Statistic

The test statistic The test statistic zz has a standard normal probability has a standard normal probability distribution.distribution.

We can use the standard normal probabilityWe can use the standard normal probability distribution table to find the distribution table to find the zz-value with an -value with an areaarea of of in the lower (or upper) tail of the in the lower (or upper) tail of the distribution.distribution.

The value of the test statistic that established theThe value of the test statistic that established the boundary of the rejection region is called theboundary of the rejection region is called the critical valuecritical value for the test. for the test.

The rejection rule is:The rejection rule is:• Lower tail: Reject Lower tail: Reject HH00 if if zz < < zz..• Upper tail: Reject Upper tail: Reject HH00 if if zz > > zz..

Page 14: Hypothesis Testing Developing Null and Alternative Hypotheses Developing Null and Alternative Hypotheses Type I and Type II Errors Type I and Type II Errors

Using the Using the pp-Value-Value

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

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

If the If the pp-value is less than the level of significance -value is less than the level of significance ,, the value of the test statistic is in the rejection region.the value of the test statistic is in the rejection region.

Page 15: Hypothesis Testing Developing Null and Alternative Hypotheses Developing Null and Alternative Hypotheses Type I and Type II Errors Type I and Type II Errors

Steps of Hypothesis TestingSteps of Hypothesis Testing

1.1. Determine the null and alternative hypotheses. Determine the null and alternative hypotheses.

2.2. Specify the level of significance Specify the level of significance ..

3.3. Select the test statistic that will be used to Select the test statistic that will be used to test thetest the hypothesis.hypothesis.

Using the Test StatisticUsing the Test Statistic

4.4. Use Use to determine the critical value for to determine the critical value for the testthe test statistic and state the rejection rule for statistic and state the rejection rule for HH00..5.5. Collect the sample data and compute Collect the sample data and compute

the valuethe value of the test statistic.of the test statistic.6.6. Use the value of the test statistic and the rejection Use the value of the test statistic and the rejection

rule to determine whether to reject rule to determine whether to reject HH00..

Page 16: Hypothesis Testing Developing Null and Alternative Hypotheses Developing Null and Alternative Hypotheses Type I and Type II Errors Type I and Type II Errors

Steps of Hypothesis TestingSteps of Hypothesis Testing

Using the Using the pp-Value-Value

4.4. Collect the sample data and compute the value of Collect the sample data and compute the value of the test statistic.the test statistic.

5.5. Use the value of the test statistic to compute the Use the value of the test statistic to compute the pp-value.-value.

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

Page 17: Hypothesis Testing Developing Null and Alternative Hypotheses Developing Null and Alternative Hypotheses Type I and Type II Errors Type I and Type II Errors

One-Tailed Tests about a Population One-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/

HypothesesHypotheses

Test StatisticTest Statistic

Rejection RuleRejection Rule

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

HH00: :

HHaa::

HH00: :

HHaa::

KnownKnown UnknownUnknown

oror

Page 18: Hypothesis Testing Developing Null and Alternative Hypotheses Developing Null and Alternative Hypotheses Type I and Type II Errors Type I and Type II Errors

00 z = 1.645 z = 1.645

Reject H0Reject H0

Do Not Reject H0Do Not Reject H0

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

zz

Samplingdistribution

of

Samplingdistribution

of z xn

0

/z x

n

0

/

Let Let = .05 = .05

Page 19: Hypothesis Testing Developing Null and Alternative Hypotheses Developing Null and Alternative Hypotheses Type I and Type II Errors Type I and Type II Errors

00 z = 1.28 z = 1.28

Reject H0Reject H0

Do Not Reject H0Do Not Reject H0

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

zz

Samplingdistribution

of

Samplingdistribution

of z xn

0

/z x

n

0

/

Let Let = .10 = .10

Page 20: Hypothesis Testing Developing Null and Alternative Hypotheses Developing Null and Alternative Hypotheses Type I and Type II Errors Type I and Type II Errors

Example: Metro EMSExample: Metro EMS

Null and Alternative HypothesesNull and Alternative Hypotheses The response times for a randomThe response times for a randomsample of 40 medical emergenciessample of 40 medical emergencieswere tabulated. The sample meanwere tabulated. The sample meanis 13.25 minutes and the sampleis 13.25 minutes and the samplestandard deviation is 3.2standard deviation is 3.2minutes. minutes. The director of medical servicesThe director of medical serviceswants to perform a hypothesis test, with awants to perform a hypothesis test, with a.05 level of significance, to determine whether or .05 level of significance, to determine whether or not thenot theservice goal of 12 minutes or less is being service goal of 12 minutes or less is being achieved.achieved.

Page 21: Hypothesis Testing Developing Null and Alternative Hypotheses Developing Null and Alternative Hypotheses Type I and Type II Errors Type I and Type II Errors

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

1. Determine the hypotheses.1. Determine the hypotheses.

2. Specify the level of significance.2. Specify the level of significance.

3. Select the test statistic.3. Select the test statistic.

= .05= .05

HH00: :

HHaa::

z xs n

0/

z xs n

0/

4. State the rejection rule.4. State the rejection rule.Reject Reject HH00 if if zz > 1.645 > 1.645

(( is not known) is not known)

Using the Test StatisticUsing the Test Statistic

Page 22: Hypothesis Testing Developing Null and Alternative Hypotheses Developing Null and Alternative Hypotheses Type I and Type II Errors Type I and Type II Errors

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

5. Compute the value of the test statistic.5. Compute the value of the test statistic.

6. Determine whether to reject 6. Determine whether to reject HH00..

13.25 12 2.47

/ 3.2/ 40x

zs n

13.25 12 2.47

/ 3.2/ 40x

zs n

We are 95% confident that Metro We are 95% confident that Metro EMS isEMS isnotnot meeting the response goal of 12 meeting the response goal of 12 minutes.minutes.

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

Using the Test StatisticUsing the Test Statistic

Page 23: Hypothesis Testing Developing Null and Alternative Hypotheses Developing Null and Alternative Hypotheses Type I and Type II Errors Type I and Type II Errors

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

Using the Using the ppValueValue

4. Compute the value of the test statistic.4. Compute the value of the test statistic.

13.25 122.47

/ 3.2/ 40x

zs n

13.25 122.47

/ 3.2/ 40x

zs n

5. Compute the 5. Compute the pp–value.–value.

For For zz = 2.47, cumulative probability = .9932. = 2.47, cumulative probability = .9932.

pp–value = 1 –value = 1 .9932 = .0068 .9932 = .0068

6. Determine whether to reject 6. Determine whether to reject HH00..

Because Because pp–value = .0068 < –value = .0068 < = .05, we reject = .05, we reject HH00..

Page 24: Hypothesis Testing Developing Null and Alternative Hypotheses Developing Null and Alternative Hypotheses Type I and Type II Errors Type I and Type II Errors

• Using the p-value• Using the p-value

p-valuep-value

00 z =1.645 z =1.645

= .05 = .05

zz

z =2.47 z =2.47

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

Page 25: Hypothesis Testing Developing Null and Alternative Hypotheses Developing Null and Alternative Hypotheses Type I and Type II Errors Type I and Type II Errors

Using Excel to Conduct aUsing Excel to Conduct aOne-Tailed Hypothesis TestOne-Tailed Hypothesis Test

Formula WorksheetFormula Worksheet

Note: Rows 13-41 are not shown.Note: Rows 13-41 are not shown.

A B C

1Response

Time Sample Size 402 19.5 Sample Mean =AVERAGE(A2:A41)3 15.2 Sample Std. Dev. =STDEV(A2:A41)4 11.0 5 12.8 Lev. of Signif. 0.056 12.4 Critical Value =NORMSINV(1-C5)7 20.3 8 9.6 Hypoth. Value 129 10.9 Standard Error =C3/SQRT(C1)10 16.2 Test Statistic =(C2-C8)/C911 13.4 p -Value =1-NORMSDIST(C10)12 19.7 Conclusion =IF(C11<C5,"Reject","Do Not Reject")

Page 26: Hypothesis Testing Developing Null and Alternative Hypotheses Developing Null and Alternative Hypotheses Type I and Type II Errors Type I and Type II Errors

Using Excel to Conduct aUsing Excel to Conduct aOne-Tailed Hypothesis TestOne-Tailed Hypothesis Test

Value WorksheetValue WorksheetA B C

1Response

Time Sample Size 402 19.5 Sample Mean 13.253 15.2 Sample Std. Dev. 3.204 11.0 5 12.8 Lev. of Signif. 0.056 12.4 Critical Value 1.6457 20.3 8 9.6 Hypoth. Value 129 10.9 Standard Error 0.506010 16.2 Test Statistic 2.47111 13.4 p -Value 0.006712 19.7 Conclusion Reject

Note: Rows 13-41 are not shown.Note: Rows 13-41 are not shown.

Page 27: Hypothesis Testing Developing Null and Alternative Hypotheses Developing Null and Alternative Hypotheses Type I and Type II Errors Type I and Type II Errors

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/

HypothesesHypotheses

Test StatisticTest Statistic

Rejection RuleRejection Rule

KnownKnown UnknownUnknown

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

0: aH 0: aH 0 0: H 0 0: H

Page 28: Hypothesis Testing Developing Null and Alternative Hypotheses Developing Null and Alternative Hypotheses Type I and Type II Errors Type I and Type II Errors

Example: Glow Toothpaste• Two-Tailed Tests about a Population Mean:

Large n The production line for Glow toothpaste

is designed to fill tubes with a mean weightof 6 oz. Periodically, a sample of 30 tubeswill be selected in order to check thefilling process.

Quality assurance procedures call forthe continuation of the filling process if thesample results are consistent with the assumption thatthe mean filling weight for the population of toothpastetubes is 6 oz.; otherwise the process will be adjusted.

oz.

GloGloww

Page 29: Hypothesis Testing Developing Null and Alternative Hypotheses Developing Null and Alternative Hypotheses Type I and Type II Errors Type I and Type II Errors

Example: Glow ToothpasteExample: Glow Toothpaste

oz.

GloGloww

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

Assume that a sample of 30 toothpasteAssume that a sample of 30 toothpaste

tubes provides a sample mean of 6.1 oz.tubes provides a sample mean of 6.1 oz.

and standard deviation of 0.2 oz. and standard deviation of 0.2 oz.

Perform a hypothesis test, at the .05Perform a hypothesis test, at the .05

level of significance, to help determinelevel of significance, to help determine

whether the filling process shouldwhether the filling process should

continue operating or be stopped andcontinue operating or be stopped and

corrected.corrected.

Page 30: Hypothesis Testing Developing Null and Alternative Hypotheses Developing Null and Alternative Hypotheses Type I and Type II Errors Type I and Type II Errors

1. Determine the hypotheses.1. Determine the hypotheses.

2. Specify the level of significance.2. Specify the level of significance.

3. Select the test statistic.3. Select the test statistic.

= .05= .05

z xs n

0/

z xs n

0/

4. State the rejection rule.4. State the rejection rule.Reject Reject HH00 if | if |z|z| > 1.96 > 1.96

(( is not known) is not known)

Using the Test StatisticUsing the Test Statistic

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

GloGloww

HH00: :

HHaa::

(two-tailed test)(two-tailed test)

6 6

Page 31: Hypothesis Testing Developing Null and Alternative Hypotheses Developing Null and Alternative Hypotheses Type I and Type II Errors Type I and Type II Errors

00 1.96 1.96

Reject H0Reject H0Do Not Reject H0Do Not Reject H0

zz

Reject H0Reject H0

-1.96 -1.96

GloGloww

Two-Tailed Tests about a Population Mean: Large-Sample Case (n > 30)

Using the Test StatisticUsing the Test Statistic

Samplingdistribution

of

Samplingdistribution

of z xn

0

/z x

n

0

/

Page 32: Hypothesis Testing Developing Null and Alternative Hypotheses Developing Null and Alternative Hypotheses Type I and Type II Errors Type I and Type II Errors

GloGloww

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

Using the Test StatisticUsing the Test Statistic

5. Compute the value of the test statistic.5. Compute the value of the test statistic.

6. Determine whether to reject 6. Determine whether to reject HH00..

We are 95% confident that the mean We are 95% confident that the mean filling weight of the toothpaste tubes is filling weight of the toothpaste tubes is not 6 oz. not 6 oz.

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

0 6.1 6 2.74

/ .2/ 30x

zs n

0 6.1 6

2.74/ .2/ 30

xz

s n

Page 33: Hypothesis Testing Developing Null and Alternative Hypotheses Developing Null and Alternative Hypotheses Type I and Type II Errors Type I and Type II Errors

• Using the p-Value

Two-Tailed Tests about a Population Mean: Large-Sample Case (n > 30) GloGlo

ww

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

With With zz = 2.74, the cumulative standard normal = 2.74, the cumulative standard normalprobability table shows there is a 1.0 - .9969 = .0031probability table shows there is a 1.0 - .9969 = .0031probability of a probability of a zz–score greater than 2.74 in the upper–score greater than 2.74 in the uppertail of the distribution.tail of the distribution.

Considering the same probability of a Considering the same probability of a zz-score less-score less

than –2.74 in the lower tail of the distribution, we havethan –2.74 in the 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 34: Hypothesis Testing Developing Null and Alternative Hypotheses Developing Null and Alternative Hypotheses Type I and Type II Errors Type I and Type II Errors

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

ww

00z/2 = 1.96z/2 = 1.96

zz

Using the Using the pp-Value-Value

-z/2 = -1.96-z/2 = -1.96z = 2.74z = 2.74z = -2.74z = -2.74

1/2p-value= .0031

1/2p-value= .0031

1/2p-value= .0031

1/2p-value= .0031

Page 35: Hypothesis Testing Developing Null and Alternative Hypotheses Developing Null and Alternative Hypotheses Type I and Type II Errors Type I and Type II Errors

Using Excel to Conduct aUsing Excel to Conduct aTwo-Tailed Hypothesis TestTwo-Tailed Hypothesis Test

Formula WorksheetFormula WorksheetA B C

1 Weight Sample Size 302 6.04 Sample Mean =AVERAGE(A2:A31)3 5.99 Sample Std. Dev. =STDEV(A2:A31)4 5.92 5 6.03 Lev. of Signif. 0.056 6.01 Crit. Value (lower) =NORMSINV(C5/2)7 5.95 Crit. Value (upper) =NORMSINV(1-C5/2)8 6.099 6.07 Hypoth. Value 610 6.07 Standard Error =C3/SQRT(C1)11 5.97 Test Statistic =(C2-C9)/C1012 5.96 p -Value =2*NORMSDIST(C11)13 6.08 Conclusion =IF(C12<C5,"Reject","Do Not Reject")

Note: Rows 14-31 are not shown.Note: Rows 14-31 are not shown.

GloGloww

Page 36: Hypothesis Testing Developing Null and Alternative Hypotheses Developing Null and Alternative Hypotheses Type I and Type II Errors Type I and Type II Errors

Value WorksheetValue Worksheet

Using Excel to Conduct aUsing Excel to Conduct aTwo-Tailed Hypothesis Test Two-Tailed Hypothesis Test

A B C1 Weight Sample Size 302 6.04 Sample Mean 6.13 5.99 Sample Std. Dev. 0.24 5.92 5 6.03 Lev. of Signif. 0.056 6.01 Crit. Value (lower) -1.9607 5.95 Crit. Value (upper) 1.9608 6.099 6.07 Hypoth. Value 610 6.07 Standard Error 0.036511 5.97 Test Statistic 2.73912 5.96 p -Value 0.00613 6.08 Conclusion Reject

Note: Rows 14-31 are not shown.Note: Rows 14-31 are not shown.

GloGloww

Page 37: Hypothesis Testing Developing Null and Alternative Hypotheses Developing Null and Alternative Hypotheses Type I and Type II Errors Type I and Type II Errors

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

Select a simple random sample from the populationSelect a simple random sample from the population and use the value of the sample mean to developand use the value of the sample mean to develop the confidence interval for the population mean the confidence interval for the population mean .. (Confidence intervals are covered in Chapter 8.)(Confidence intervals are covered in Chapter 8.)

xx

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

Page 38: Hypothesis Testing Developing Null and Alternative Hypotheses Developing Null and Alternative Hypotheses Type I and Type II Errors Type I and Type II Errors

The 95% confidence interval for is

x zn

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

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

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

GloGloww

Because the hypothesized value for theBecause 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 thethe hypothesis-testing conclusion is that the

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

or 6.0284 to 6.1716or 6.0284 to 6.1716

Page 39: Hypothesis Testing Developing Null and Alternative Hypotheses Developing Null and Alternative Hypotheses Type I and Type II Errors Type I and Type II Errors

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

• Test Statistic

txs n

0/

txs n

0/

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

KnownKnown UnknownUnknown

n

xz

/0

Page 40: Hypothesis Testing Developing Null and Alternative Hypotheses Developing Null and Alternative Hypotheses Type I and Type II Errors Type I and Type II Errors

Rejection RuleRejection Rule

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

HH00: : Reject Reject HH0 0 if if tt > > tt

Reject Reject HH0 0 if if tt < - < -tt

Reject Reject HH0 0 if |if |tt| > | > tt

HH00: :

HH00: :

Page 41: Hypothesis Testing Developing Null and Alternative Hypotheses Developing Null and Alternative Hypotheses Type I and Type II Errors Type I and Type II Errors

p -Values and the t Distribution

The format of the The format of the tt distribution table provided in most distribution table provided in most statistics textbooks does not have sufficient detailstatistics textbooks does not have sufficient detail to determine the to determine the exactexact p p-value for a hypothesis test.-value for a hypothesis test. However, we can still use the However, we can still use the tt distribution table to distribution table to identify a identify a rangerange for the for the pp-value.-value. An advantage of computer software packages is thatAn advantage of computer software packages is that the computer output will provide the the computer output will provide the pp-value for the-value for the tt distribution. distribution.

Page 42: Hypothesis Testing Developing Null and Alternative Hypotheses Developing Null and Alternative Hypotheses Type I and Type II Errors Type I and Type II Errors

Example: Highway Patrol

• One-Tailed Test about a Population Mean: Small n

A State Highway Patrol periodically samples

vehicle speeds at various locations

on a particular roadway.

The sample of vehicle speeds

is used to test the hypothesis

H0: < 65

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

Page 43: Hypothesis Testing Developing Null and Alternative Hypotheses Developing Null and Alternative Hypotheses Type I and Type II Errors Type I and Type II Errors

Example: Highway PatrolExample: Highway Patrol

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

At Location F, a sample of 16 vehicles At Location F, a sample of 16 vehicles shows ashows a

mean speed of 68.2 mph with amean speed of 68.2 mph with a

standard deviation ofstandard deviation of

3.8 mph. Use 3.8 mph. Use = .05 to = .05 to

test the hypothesis.test the hypothesis.

Page 44: Hypothesis Testing Developing Null and Alternative Hypotheses Developing Null and Alternative Hypotheses Type I and Type II Errors Type I and Type II Errors

One-Tailed Test about a Population Mean:One-Tailed Test about a Population Mean:Small-Sample Case (Small-Sample Case (nn < 30) < 30)

1. Determine the hypotheses.1. Determine the hypotheses.

2. Specify the level of significance.2. Specify the level of significance.

3. Select the test statistic.3. Select the test statistic.

= .05= .05

4. State the rejection rule.4. State the rejection rule.Reject Reject HH00 if if tt > 1.753 > 1.753

(( is not known) is not known)

Using the Test StatisticUsing the Test Statistic

HH00: : << 65 65

HHaa: : > 65 > 65

txs n

0/

txs n

0/

(d.f. = 16-1 = 15)(d.f. = 16-1 = 15)

Page 45: Hypothesis Testing Developing Null and Alternative Hypotheses Developing Null and Alternative Hypotheses Type I and Type II Errors Type I and Type II Errors

00 1.7531.753

Reject H0Reject H0

Do Not Reject H0Do Not Reject H0

(Critical value)(Critical value)

tt

One-Tailed Test about a Population Mean:One-Tailed Test about a Population Mean:Small-Sample Case (Small-Sample Case (nn < 30) < 30)

Page 46: Hypothesis Testing Developing Null and Alternative Hypotheses Developing Null and Alternative Hypotheses Type I and Type II Errors Type I and Type II Errors

Using the Test StatisticUsing the Test Statistic

5. Compute the value of the test statistic.5. Compute the value of the test statistic.

6. Determine whether to reject 6. Determine whether to reject HH00..

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

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

One-Tailed Test about a Population Mean:One-Tailed Test about a Population Mean:Small-Sample Case (Small-Sample Case (nn < 30) < 30)

0 68.2 65 3.37

/ 3.8/ 16x

ts n

0 68.2 65

3.37/ 3.8/ 16

xt

s n

Page 47: Hypothesis Testing Developing Null and Alternative Hypotheses Developing Null and Alternative Hypotheses Type I and Type II Errors Type I and Type II Errors

Formula WorksheetFormula WorksheetA B C

1Vehicle Speed Sample Size 16

2 69.6 Sample Mean =AVERAGE(A2:A17)3 73.5 Sample Std. Dev. =STDEV(A2:A17)4 74.1 5 64.4 Lev. of Signif. 0.056 66.3 Critical Value =TINV(2*C5,C1-1)7 68.7 8 69.0 Hypoth. Value 659 65.2 Standard Error =C3/SQRT(C1)10 71.1 Test Statistic =(C2-C8)/C911 70.8 p -Value =TDIST(C10, C1-1,1)12 64.6 Conclusion =IF(C11<C5,"Reject","Do Not Reject")

Note: Rows 13-17 are not shown.Note: Rows 13-17 are not shown.

Using Excel to Conduct a One-TailedUsing Excel to Conduct a One-Tailed Hypothesis Test: Hypothesis Test: Small-Sample CaseSmall-Sample Case

Page 48: Hypothesis Testing Developing Null and Alternative Hypotheses Developing Null and Alternative Hypotheses Type I and Type II Errors Type I and Type II Errors

Value WorksheetValue Worksheet

Using Excel to Conduct a One-TailedUsing Excel to Conduct a One-Tailed Hypothesis Test: Hypothesis Test: Small-Sample CaseSmall-Sample Case

Note: Rows 13-17 are not shown.Note: Rows 13-17 are not shown.

A B C

1Vehicle Speed Sample Size 16

2 68.2 Sample Mean 68.203 77.0 Sample Std. Dev. 3.804 71.0 5 64.2 Lev. of Signif. 0.056 66.8 Critical Value 1.7537 68.3 8 65.9 Hypoth. Value 659 63.9 Standard Error 0.949010 71.1 Test Statistic 3.37211 71.6 p -Value 0.002112 60.7 Conclusion Reject